Commit 5c6b2ebf2d55c2d27f90c311f716bd5f0a689694

Ryan C. Gordon 2016-11-17T01:26:56

cpuinfo: more robust ARM preprocessor checks.

diff --git a/src/cpuinfo/SDL_cpuinfo.c b/src/cpuinfo/SDL_cpuinfo.c
index 9462875..a3ea355 100644
--- a/src/cpuinfo/SDL_cpuinfo.c
+++ b/src/cpuinfo/SDL_cpuinfo.c
@@ -50,11 +50,11 @@
 #include <setjmp.h>
 #endif
 
-#if defined(__ANDROID__)
+#if defined(__ANDROID__) && defined(__ARM_ARCH)
 #include <cpu-features.h>
 #endif
 
-#if defined(__LINUX__) && HAVE_GETAUXVAL
+#if defined(__LINUX__) && defined(__ARM_ARCH) && HAVE_GETAUXVAL
 #include <sys/auxv.h>
 #include <asm/hwcap.h>
 #endif
@@ -312,12 +312,12 @@ CPU_haveNEON(void)
     const int error = sysctlbyname("hw.optional.neon", &neon, &length, NULL, 0);
     if (!error)
         neon = (neon != 0);
-#elif defined(__ANDROID__)
+#elif defined(__ANDROID__) && defined(__ARM_ARCH)
     if ( (android_getCpuFamily() == ANDROID_CPU_FAMILY_ARM) &&
          ((android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_NEON) != 0) ) {
         neon = 1;
     }
-#elif defined(__LINUX__) && HAVE_GETAUXVAL && defined(__arm__)
+#elif defined(__LINUX__) && defined(__ARM_ARCH) && HAVE_GETAUXVAL
     if (getauxval(AT_HWCAP) & HWCAP_NEON) {
         neon = 1;
     }