Commit e16fb60323f96085982dc033b7d4544d99ba3bc6

Ozkan Sezer 2021-07-27T17:10:24

tweak HAVE_IMMINTRIN_H in SDL_config_windows.h, add to SDL_config_macosx.h

diff --git a/include/SDL_config_macosx.h b/include/SDL_config_macosx.h
index 9a8f720..ec18866 100644
--- a/include/SDL_config_macosx.h
+++ b/include/SDL_config_macosx.h
@@ -137,6 +137,12 @@
 #define HAVE_SYSCONF    1
 #define HAVE_SYSCTLBYNAME 1
 
+#if defined(__has_include) && (defined(__i386__) || defined(__x86_64))
+# if __has_include(<immintrin.h>)
+#   define HAVE_IMMINTRIN_H 1
+# endif
+#endif
+
 #define HAVE_GCC_ATOMICS 1
 
 /* Enable various audio drivers */
diff --git a/include/SDL_config_windows.h b/include/SDL_config_windows.h
index ec7f3f2..33436c4 100644
--- a/include/SDL_config_windows.h
+++ b/include/SDL_config_windows.h
@@ -85,8 +85,12 @@ typedef unsigned int uintptr_t;
 #define HAVE_MMDEVICEAPI_H 1
 #define HAVE_AUDIOCLIENT_H 1
 #define HAVE_SENSORSAPI_H 1
-#if defined(_M_IX86) || defined(_M_X64) || defined(_M_AMD64)
+#if (defined(_M_IX86) || defined(_M_X64) || defined(_M_AMD64)) && (defined(_MSC_VER) && _MSC_VER >= 1600)
 #define HAVE_IMMINTRIN_H 1
+#elif defined(__has_include) && (defined(__i386__) || defined(__x86_64))
+# if __has_include(<immintrin.h>)
+#   define HAVE_IMMINTRIN_H 1
+# endif
 #endif
 
 /* This is disabled by default to avoid C runtime dependencies and manifest requirements */