include/SDL_cpuinfo.h
changeset 12450 1055156e99f3
parent 12449 17cb4ff70507
child 12452 983247abc7e5
     1.1 --- a/include/SDL_cpuinfo.h	Tue Dec 04 12:34:45 2018 +0100
     1.2 +++ b/include/SDL_cpuinfo.h	Tue Dec 04 16:50:31 2018 +0100
     1.3 @@ -54,8 +54,22 @@
     1.4  #if defined(HAVE_ALTIVEC_H) && defined(__ALTIVEC__) && !defined(__APPLE_ALTIVEC__) && defined(SDL_ENABLE_ALTIVEC_H)
     1.5  #include <altivec.h>
     1.6  #endif
     1.7 -#if defined(__ARM_NEON) && !defined(SDL_DISABLE_ARM_NEON_H)
     1.8 -#include <arm_neon.h>
     1.9 +#if !defined(SDL_DISABLE_ARM_NEON_H)
    1.10 +#  if defined(__ARM_NEON)
    1.11 +#    include <arm_neon.h>
    1.12 +#  elif defined(__WINDOWS__) || defined(__WINRT__)
    1.13 +/* Visual Studio doesn't define __ARM_ARCH, but _M_ARM (if set, always 7), and _M_ARM64 (if set, always 1).
    1.14 +#    if defined(_M_ARM)
    1.15 +#      include <armintr.h>
    1.16 +#      include <arm_neon.h>
    1.17 +#    endif
    1.18 +#    if defined (_M_ARM64)
    1.19 +#      include <armintr.h>
    1.20 +#      include <arm_neon.h>
    1.21 +#    endif
    1.22 +/* Set __ARM_NEON so that it can be used elsewhere, at compile time */
    1.23 +#    define __ARM_NEON 1
    1.24 +#  endif
    1.25  #endif
    1.26  #if defined(__3dNOW__) && !defined(SDL_DISABLE_MM3DNOW_H)
    1.27  #include <mm3dnow.h>