[Commits] SDL: Fixed bug 3993 - altivec.h include in SDL_cpuinfo.h breaks ...

libsdl.org revision control commits-owner at libsdl.org
Tue Dec 12 16:25:46 PST 2017


details:   https://hg.libsdl.org/SDL/rev/58a69c196061
changeset: 11770:58a69c196061
user:      Sam Lantinga <slouken at libsdl.org>
date:      Tue Dec 12 16:25:43 2017 -0800
description:
Fixed bug 3993 - altivec.h include in SDL_cpuinfo.h breaks compilation with -std=c++11

bastien.bouclet

According to this GCC bug report, altivec.h requires building with the gnu extensions: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78263.

As an application developer, I don't want SDL to force me to enable the gnu extensions.

diffstat:

 include/SDL_cpuinfo.h |  18 ++++++++----------
 1 files changed, 8 insertions(+), 10 deletions(-)

diffs (42 lines):

diff -r f0aad4dbf696 -r 58a69c196061 include/SDL_cpuinfo.h
--- a/include/SDL_cpuinfo.h	Tue Dec 12 16:10:20 2017 -0800
+++ b/include/SDL_cpuinfo.h	Tue Dec 12 16:25:43 2017 -0800
@@ -51,30 +51,28 @@
 #include <intrin.h>
 #else
 #ifdef __ALTIVEC__
-#if HAVE_ALTIVEC_H && !defined(__APPLE_ALTIVEC__)
+#if HAVE_ALTIVEC_H && !defined(__APPLE_ALTIVEC__) && !defined(SDL_DISABLE_ALTIVEC_H)
 #include <altivec.h>
 #undef pixel
+#undef bool
 #endif
 #endif
-#ifdef __3dNOW__
+#if defined(__3dNOW__) && !defined(SDL_DISABLE_MM3DNOW_H)
 #include <mm3dnow.h>
 #endif
-#if HAVE_IMMINTRIN_H
+#if HAVE_IMMINTRIN_H && !defined(SDL_DISABLE_IMMINTRIN_H)
 #include <immintrin.h>
 #else
-#ifdef __MMX__
+#if defined(__MMX__) && !defined(SDL_DISABLE_MMINTRIN_H)
 #include <mmintrin.h>
 #endif
-#ifdef __3dNOW__
-#include <mm3dnow.h>
-#endif
-#ifdef __SSE__
+#if defined(__SSE__) && !defined(SDL_DISABLE_XMMINTRIN_H)
 #include <xmmintrin.h>
 #endif
-#ifdef __SSE2__
+#if defined(__SSE2__) && !defined(SDL_DISABLE_EMMINTRIN_H)
 #include <emmintrin.h>
 #endif
-#ifdef __SSE3__
+#if defined(__SSE3__) && !defined(SDL_DISABLE_PMMINTRIN_H)
 #include <pmmintrin.h>
 #endif
 #endif /* HAVE_IMMINTRIN_H */


More information about the commits mailing list