File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,15 @@ inline bool CanUseArm64Crc32() {
3838 // From 'arch/arm64/include/uapi/asm/hwcap.h' in Linux kernel source code.
3939 constexpr unsigned long kHWCAP_PMULL = 1 << 4 ;
4040 constexpr unsigned long kHWCAP_CRC32 = 1 << 7 ;
41- unsigned long hwcap = (&getauxval != nullptr ) ? getauxval (AT_HWCAP) : 0 ;
41+ unsigned long hwcap =
42+ #if HAVE_STRONG_GETAUXVAL
43+ // Some compilers warn on (&getauxval != nullptr) in the block below.
44+ getauxval (AT_HWCAP);
45+ #elif HAVE_WEAK_GETAUXVAL
46+ (&getauxval != nullptr ) ? getauxval (AT_HWCAP) : 0 ;
47+ #else
48+ #error This is supposed to be nested inside a check for HAVE_*_GETAUXVAL.
49+ #endif // HAVE_STRONG_GETAUXVAL
4250 return (hwcap & (kHWCAP_PMULL | kHWCAP_CRC32 )) ==
4351 (kHWCAP_PMULL | kHWCAP_CRC32 );
4452#elif defined(__APPLE__)
You can’t perform that action at this time.
0 commit comments