diff options
author | Lasse Collin <lasse.collin@tukaani.org> | 2023-05-03 22:46:42 +0300 |
---|---|---|
committer | Lasse Collin <lasse.collin@tukaani.org> | 2023-05-03 22:55:16 +0300 |
commit | 44c0c5eae990a22ef04e9b88c1a15838a0d00878 (patch) | |
tree | 7df5ddace6c71cc0e3ab90ec2c48474128de5963 /src/common | |
parent | CI: Adds a build and test for small configuration. (diff) | |
download | xz-44c0c5eae990a22ef04e9b88c1a15838a0d00878.tar.xz |
tuklib_integer.h: Fix a recent copypaste error in Clang detection.
Wrong line was changed in 7062348bf35c1e4cbfee00ad9fffb4a21aa6eff7.
Also, this has >= instead of == since ints larger than 32 bits would
work too even if not relevant in practice.
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/tuklib_integer.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/common/tuklib_integer.h b/src/common/tuklib_integer.h index aee1ad0d..24d9efb1 100644 --- a/src/common/tuklib_integer.h +++ b/src/common/tuklib_integer.h @@ -742,10 +742,10 @@ ctz32(uint32_t n) #if defined(__INTEL_COMPILER) return _bit_scan_forward(n); -#elif TUKLIB_GNUC_REQ(3, 4) && UINT_MAX >= UINT32_MAX +#elif (TUKLIB_GNUC_REQ(3, 4) || defined(__clang__)) && UINT_MAX >= UINT32_MAX return (uint32_t)__builtin_ctz(n); -#elif (TUKLIB_GNUC_REQ(3, 4) || defined(__clang__)) && UINT_MAX == UINT32_MAX +#elif defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) uint32_t i; __asm__("bsfl %1, %0" : "=r" (i) : "rm" (n)); return i; |