]> git.ipfire.org Git - thirdparty/xz.git/commitdiff
tuklib_integer.h: Fix a recent copypaste error in Clang detection.
authorLasse Collin <lasse.collin@tukaani.org>
Wed, 3 May 2023 19:46:42 +0000 (22:46 +0300)
committerLasse Collin <lasse.collin@tukaani.org>
Wed, 3 May 2023 19:55:16 +0000 (22:55 +0300)
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

index aee1ad0d9c34f6e69b5ec6c271d9d16c4718230a..24d9efb1165ae6698606db0f4dc603b6ba97cd6b 100644 (file)
@@ -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;