Fixed bug 3791 - SDL_bits.h: __builtin_clz is supported in gcc >= 3.4
authorSam Lantinga <slouken@libsdl.org>
Thu, 31 Aug 2017 15:17:59 -0700
changeset 11433b5e2b88d5193
parent 11432 04dd43a2c83a
child 11434 fffd7c61e077
Fixed bug 3791 - SDL_bits.h: __builtin_clz is supported in gcc >= 3.4

Ozkan Sezer

__builtin_clz is supported in gcc >= 3.4. The following patchlet adjusts
SDL_bits.h for it.
include/SDL_bits.h
     1.1 --- a/include/SDL_bits.h	Thu Aug 31 15:12:08 2017 -0700
     1.2 +++ b/include/SDL_bits.h	Thu Aug 31 15:17:59 2017 -0700
     1.3 @@ -60,7 +60,7 @@
     1.4  SDL_FORCE_INLINE int
     1.5  SDL_MostSignificantBitIndex32(Uint32 x)
     1.6  {
     1.7 -#if defined(__GNUC__) && __GNUC__ >= 4
     1.8 +#if defined(__GNUC__) && (__GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
     1.9      /* Count Leading Zeroes builtin in GCC.
    1.10       * http://gcc.gnu.org/onlinedocs/gcc-4.3.4/gcc/Other-Builtins.html
    1.11       */