Fix build on FreeBSD/arm64

This commit is contained in:
pkubaj 2022-09-21 07:19:23 +00:00 committed by Vitaly Cheptsov
parent 152fcc44a5
commit 739de0fec8

View file

@ -421,10 +421,17 @@ BoolInt CPU_IsSupported_AES (void) { return APPLE_CRYPTO_SUPPORT_VAL; }
#ifdef USE_HWCAP
#ifdef __linux__
#include <asm/hwcap.h>
#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) \