diff options
author | Thomas BERNARD <miniupnp@free.fr> | 2020-02-09 23:04:08 +0100 |
---|---|---|
committer | Erik de Castro Lopo <erikd@mega-nerd.com> | 2020-05-03 17:14:33 +1000 |
commit | 4fbb6d4f2ecf2a96c17ea9880108409f852c08a9 (patch) | |
tree | a8160aa0a950a57e62f632ce89d7090c9592cfb3 /src | |
parent | e0b62a61a7b65aef187b038454925a34fa315125 (diff) | |
download | flac-4fbb6d4f2ecf2a96c17ea9880108409f852c08a9.tar.gz |
fix build under Mac OS X with PowerPC CPU
revert 44036c9a9b45d03373fe90e9c112852bfc054c51 because auxv.h is only
available under Linux and FreeBSD.
Diffstat (limited to 'src')
-rw-r--r-- | src/libFLAC/cpu.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/libFLAC/cpu.c b/src/libFLAC/cpu.c index c90b8999..8b92f4c7 100644 --- a/src/libFLAC/cpu.c +++ b/src/libFLAC/cpu.c @@ -54,8 +54,10 @@ #endif #if defined FLAC__CPU_PPC +#if defined(__linux__) || (defined(__FreeBSD__) && (__FreeBSD__ >= 12)) #include <sys/auxv.h> #endif +#endif #if (defined FLAC__CPU_IA32 || defined FLAC__CPU_X86_64) && (defined FLAC__HAS_NASM || FLAC__HAS_X86INTRIN) && !defined FLAC__NO_ASM @@ -251,18 +253,23 @@ ppc_cpu_info (FLAC__CPUInfo *info) } else if (getauxval(AT_HWCAP2) & PPC_FEATURE2_ARCH_2_07) { info->ppc.arch_2_07 = true; } -#elif defined(__FreeBSD__) +#elif defined(__FreeBSD__) && (__FreeBSD__ >= 12) long hwcaps; + /* elf_aux_info() appeared in FreeBSD 12.0 */ elf_aux_info(AT_HWCAP2, &hwcaps, sizeof(hwcaps)); -#else -#error Unsupported platform! Please add support for reading ppc hwcaps. -#endif - if (hwcaps & PPC_FEATURE2_ARCH_3_00) { info->ppc.arch_3_00 = true; } else if (hwcaps & PPC_FEATURE2_ARCH_2_07) { info->ppc.arch_2_07 = true; } +#elif defined(__APPLE__) + /* no Mac OS X version supports CPU with Power AVI v2.07 or better */ + info->ppc.arch_2_07 = false; + info->ppc.arch_3_00 = false; +#else +#error Unsupported platform! Please add support for reading ppc hwcaps. +#endif + #else info->ppc.arch_2_07 = false; info->ppc.arch_3_00 = false; |