mirror of
https://github.com/google/brotli.git
synced 2024-11-21 19:20:09 +00:00
Encoder: modernize builtin clz guard
This commit is contained in:
parent
8d3fdc1dfe
commit
afa2e74fe2
@ -19,7 +19,7 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
static BROTLI_INLINE uint32_t Log2FloorNonZero(size_t n) {
|
||||
#ifdef __GNUC__
|
||||
#if BROTLI_MODERN_COMPILER || __has_builtin(__builtin_clz)
|
||||
return 31u ^ (uint32_t)__builtin_clz((uint32_t)n);
|
||||
#else
|
||||
uint32_t result = 0;
|
||||
|
@ -36,7 +36,7 @@
|
||||
|
||||
#if defined(BROTLI_BUILD_MODERN_COMPILER)
|
||||
#define BROTLI_MODERN_COMPILER 1
|
||||
#elif BROTLI_GCC_VERSION > 300 || BROTLI_ICC_VERSION >= 1600
|
||||
#elif BROTLI_GCC_VERSION >= 304 || BROTLI_ICC_VERSION >= 1600
|
||||
#define BROTLI_MODERN_COMPILER 1
|
||||
#else
|
||||
#define BROTLI_MODERN_COMPILER 0
|
||||
|
Loading…
Reference in New Issue
Block a user