Only use __builtin_clz on GCC >= 3.4

Haiku at least still requires GCC 2 for system components.
This commit is contained in:
François Revol 2017-01-25 02:40:11 +01:00
parent 7e347a7c84
commit cd10805e33

View File

@ -19,7 +19,7 @@ extern "C" {
#endif
static BROTLI_INLINE uint32_t Log2FloorNonZero(size_t n) {
#ifdef __GNUC__
#if defined(__GNUC__) && (__GNUC__ > 3 || __GNUC__ == 3 && __GNUC_MINOR__ > 3)
return 31u ^ (uint32_t)__builtin_clz((uint32_t)n);
#else
uint32_t result = 0;