From 809a2fd6984c6789b4db17cfb6b206d96bff9d0c Mon Sep 17 00:00:00 2001 From: Lasse Collin Date: Wed, 3 May 2023 22:46:42 +0300 Subject: 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. --- src/common/tuklib_integer.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/common/tuklib_integer.h') diff --git a/src/common/tuklib_integer.h b/src/common/tuklib_integer.h index 414c5626..08290842 100644 --- a/src/common/tuklib_integer.h +++ b/src/common/tuklib_integer.h @@ -700,10 +700,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; -- cgit v1.2.3