Check for immintrin.h before using it in SDL_cpuinfo.h

This commit is contained in:
Sam Lantinga
2017-12-11 12:00:12 -08:00
parent 1b16618b13
commit f1ec8a5f4c
6 changed files with 46 additions and 5 deletions

View File

@@ -191,11 +191,12 @@
#endif /* HAVE_LIBC */
#cmakedefine HAVE_ALTIVEC_H 1
#cmakedefine HAVE_LIBUDEV_H 1
#cmakedefine HAVE_DBUS_DBUS_H 1
#cmakedefine HAVE_IBUS_IBUS_H 1
#cmakedefine HAVE_FCITX_FRONTEND_H 1
#cmakedefine HAVE_IBUS_IBUS_H 1
#cmakedefine HAVE_IMMINTRIN_H 1
#cmakedefine HAVE_LIBSAMPLERATE_H 1
#cmakedefine HAVE_LIBUDEV_H 1
#cmakedefine HAVE_D3D_H @HAVE_D3D_H@
#cmakedefine HAVE_D3D11_H @HAVE_D3D11_H@

View File

@@ -193,11 +193,12 @@
#endif /* HAVE_LIBC */
#undef HAVE_ALTIVEC_H
#undef HAVE_LIBUDEV_H
#undef HAVE_DBUS_DBUS_H
#undef HAVE_IBUS_IBUS_H
#undef HAVE_FCITX_FRONTEND_H
#undef HAVE_IBUS_IBUS_H
#undef HAVE_IMMINTRIN_H
#undef HAVE_LIBSAMPLERATE_H
#undef HAVE_LIBUDEV_H
#undef HAVE_DDRAW_H
#undef HAVE_DINPUT_H

View File

@@ -59,10 +59,26 @@
#ifdef __3dNOW__
#include <mm3dnow.h>
#endif
#if defined(__i386__) || defined(__x86_64__)
#if HAVE_IMMINTRIN_H
#include <immintrin.h>
#else
#ifdef __MMX__
#include <mmintrin.h>
#endif
#ifdef __3dNOW__
#include <mm3dnow.h>
#endif
#ifdef __SSE__
#include <xmmintrin.h>
#endif
#ifdef __SSE2__
#include <emmintrin.h>
#endif
#ifdef __SSE3__
#include <pmmintrin.h>
#endif
#endif /* HAVE_IMMINTRIN_H */
#endif /* compiler version */
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */