Fix a division bug on 64-bit platforms.
The GCC builtin clzl depends on the sizeof(long), which caused an error if it was other than 32 bits. Fixes issue #17.
This commit is contained in:
parent
10af3a6c60
commit
a3ad27ed10
|
@ -275,7 +275,7 @@ fix16_t fix16_smul(fix16_t inArg0, fix16_t inArg1)
|
|||
#if !defined(FIXMATH_OPTIMIZE_8BIT)
|
||||
#ifdef __GNUC__
|
||||
// Count leading zeros, using processor-specific instruction if available.
|
||||
#define clz(x) __builtin_clzl(x)
|
||||
#define clz(x) (__builtin_clzl(x) - (8 * sizeof(long) - 32))
|
||||
#else
|
||||
static uint8_t clz(uint32_t x)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue