fix non-ARM h/w on FreeBSD builds (bug #5405, patch from David Carlier.)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
diff --git a/src/cpuinfo/SDL_cpuinfo.c b/src/cpuinfo/SDL_cpuinfo.c
index 1920e83..a1cc86d 100644
--- a/src/cpuinfo/SDL_cpuinfo.c
+++ b/src/cpuinfo/SDL_cpuinfo.c
@@ -54,9 +54,6 @@
#include <sys/param.h>
#include <sys/sysctl.h> /* For AltiVec check */
#include <machine/cpu.h>
-#if defined(HAVE_ELF_AUX_INFO)
-#include <sys/auxv.h>
-#endif
#elif SDL_ALTIVEC_BLITTERS && HAVE_SETJMP
#include <signal.h>
#include <setjmp.h>
@@ -94,6 +91,10 @@
#endif
#endif
+#if defined(HAVE_ELF_AUX_INFO)
+#include <sys/auxv.h>
+#endif
+
#ifdef __RISCOS__
#include <kernel.h>
#include <swis.h>
@@ -465,7 +466,7 @@ CPU_haveNEON(void)
return 0; /* assume anything else from Apple doesn't have NEON. */
#elif defined(__OpenBSD__)
return 1; /* OpenBSD only supports ARMv7 CPUs that have NEON. */
-#elif defined(HAVE_ELF_AUX_INFO)
+#elif defined(HAVE_ELF_AUX_INFO) && defined(HWCAP_NEON)
unsigned long hasneon = 0;
if (elf_aux_info(AT_HWCAP, (void *)&hasneon, (int)sizeof(hasneon)) != 0)
return 0;
@@ -494,7 +495,7 @@ CPU_haveNEON(void)
/* Use the VFPSupport_Features SWI to access the MVFR registers */
{
_kernel_swi_regs regs;
- regs.r[0] = 0;
+ regs.r[0] = 0;
if (_kernel_swi(VFPSupport_Features, ®s, ®s) == NULL) {
if ((regs.r[2] & 0xFFF000) == 0x111000) {
return 1;