From: Nathan Moinvaziri Date: Sat, 10 Jan 2026 01:38:55 +0000 (-0800) Subject: __builtin_bitreverse16 CMake compiler check fails for GCC 13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=369ae91066bad2595c64475c99a129d8f2e03659;p=thirdparty%2Fzlib-ng.git __builtin_bitreverse16 CMake compiler check fails for GCC 13 Provide a final check for __builtin_bitreverse16 in code. --- diff --git a/fallback_builtins.h b/fallback_builtins.h index 3b477abd3..0e6a1f1e1 100644 --- a/fallback_builtins.h +++ b/fallback_builtins.h @@ -42,6 +42,14 @@ Z_FORCEINLINE static int __builtin_ctzll(unsigned long long value) { #endif // _MSC_VER && !__clang__ +/* Double-check whether or not __builtin_bitreverse16 is available. It + may not be defined unless compiled for arch. */ +#if !defined(HAVE_BUILTIN_BITREVERSE16) && defined(__has_builtin) +# if __has_builtin(__builtin_bitreverse16) +# define HAVE_BUILTIN_BITREVERSE16 +# endif +#endif + #ifndef HAVE_BUILTIN_BITREVERSE16 # ifdef __loongarch__