Do not blindly use __builtin_clz() #ifdef __GNUC__, but only if gcc >= 3.4 for

it did not exist in previous releases.
ok matthieu@
This commit is contained in:
miod 2013-07-17 19:27:22 +00:00
parent 2fb4e077c6
commit 2673d4da6b

View File

@ -37,7 +37,8 @@
static force_inline int
count_leading_zeros (uint32_t x)
{
#ifdef __GNUC__
#if defined(__GNUC__) && \
(__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
return __builtin_clz (x);
#else
int n = 0;