From 739de0fec84e18ba689da0c97c6c0c6da3a807ae Mon Sep 17 00:00:00 2001 From: pkubaj Date: Wed, 21 Sep 2022 07:19:23 +0000 Subject: [PATCH] Fix build on FreeBSD/arm64 --- common/LZMA/SDK/C/CpuArch.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/common/LZMA/SDK/C/CpuArch.c b/common/LZMA/SDK/C/CpuArch.c index fa9afe3..912cfc7 100644 --- a/common/LZMA/SDK/C/CpuArch.c +++ b/common/LZMA/SDK/C/CpuArch.c @@ -421,10 +421,17 @@ BoolInt CPU_IsSupported_AES (void) { return APPLE_CRYPTO_SUPPORT_VAL; } #ifdef USE_HWCAP +#ifdef __linux__ #include +#endif +#ifdef __linux__ #define MY_HWCAP_CHECK_FUNC_2(name1, name2) \ BoolInt CPU_IsSupported_ ## name1() { return (getauxval(AT_HWCAP) & (HWCAP_ ## name2)) ? 1 : 0; } +#elif defined(__FreeBSD__) + #define MY_HWCAP_CHECK_FUNC_2(name1, name2) \ + BoolInt CPU_IsSupported_ ## name1() { uint32_t hwcaps = 0; elf_aux_info(AT_HWCAP, &hwcaps, sizeof(hwcaps)); return (hwcaps & (HWCAP_ ## name2)) ? 1 : 0; } +#endif #ifdef MY_CPU_ARM64 #define MY_HWCAP_CHECK_FUNC(name) \