cpuinfo: more robust ARM preprocessor checks.
authorRyan C. Gordon <icculus@icculus.org>
Thu, 17 Nov 2016 01:26:56 -0500
changeset 106213b74422e881d
parent 10620 c37e02dd1a9b
child 10622 972f7f6dd9b9
cpuinfo: more robust ARM preprocessor checks.
src/cpuinfo/SDL_cpuinfo.c
     1.1 --- a/src/cpuinfo/SDL_cpuinfo.c	Thu Nov 17 01:15:16 2016 -0500
     1.2 +++ b/src/cpuinfo/SDL_cpuinfo.c	Thu Nov 17 01:26:56 2016 -0500
     1.3 @@ -50,11 +50,11 @@
     1.4  #include <setjmp.h>
     1.5  #endif
     1.6  
     1.7 -#if defined(__ANDROID__)
     1.8 +#if defined(__ANDROID__) && defined(__ARM_ARCH)
     1.9  #include <cpu-features.h>
    1.10  #endif
    1.11  
    1.12 -#if defined(__LINUX__) && HAVE_GETAUXVAL
    1.13 +#if defined(__LINUX__) && defined(__ARM_ARCH) && HAVE_GETAUXVAL
    1.14  #include <sys/auxv.h>
    1.15  #include <asm/hwcap.h>
    1.16  #endif
    1.17 @@ -312,12 +312,12 @@
    1.18      const int error = sysctlbyname("hw.optional.neon", &neon, &length, NULL, 0);
    1.19      if (!error)
    1.20          neon = (neon != 0);
    1.21 -#elif defined(__ANDROID__)
    1.22 +#elif defined(__ANDROID__) && defined(__ARM_ARCH)
    1.23      if ( (android_getCpuFamily() == ANDROID_CPU_FAMILY_ARM) &&
    1.24           ((android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_NEON) != 0) ) {
    1.25          neon = 1;
    1.26      }
    1.27 -#elif defined(__LINUX__) && HAVE_GETAUXVAL && defined(__arm__)
    1.28 +#elif defined(__LINUX__) && defined(__ARM_ARCH) && HAVE_GETAUXVAL
    1.29      if (getauxval(AT_HWCAP) & HWCAP_NEON) {
    1.30          neon = 1;
    1.31      }