From 6d39e67bad7b93729b9586bdfafa425677cdd864 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sat, 10 Mar 2018 21:20:25 -0800 Subject: [PATCH] Fixed bug 4103 - SDL_cpuinfo.h provokes warnings with -Wundef on non-x86 hosts Felix Geyer Forwarding from https://bugs.debian.org/892087 quoting verbatim: The SDL2 header SDL_cpuinfo.h generates gcc warnings if the program using it compiles with the -Wundef warning. (In particular, this means that QEMU builds using it fail on at least sparc hosts, since QEMU dev builds use both -Wundef and -Werror.). /usr/include/SDL2/SDL_cpuinfo.h:63:5: warning: "HAVE_IMMINTRIN_H" is not defined, evaluates to 0 [-Wundef] #if HAVE_IMMINTRIN_H && !defined(SDL_DISABLE_IMMINTRIN_H) --- include/SDL_cpuinfo.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/SDL_cpuinfo.h b/include/SDL_cpuinfo.h index 0812705309637..74d9fdf87ab1d 100644 --- a/include/SDL_cpuinfo.h +++ b/include/SDL_cpuinfo.h @@ -51,7 +51,7 @@ #include #else #ifdef __ALTIVEC__ -#if HAVE_ALTIVEC_H && !defined(__APPLE_ALTIVEC__) && !defined(SDL_DISABLE_ALTIVEC_H) +#if defined(HAVE_ALTIVEC_H) && !defined(__APPLE_ALTIVEC__) && !defined(SDL_DISABLE_ALTIVEC_H) #include #undef pixel #undef bool @@ -60,7 +60,7 @@ #if defined(__3dNOW__) && !defined(SDL_DISABLE_MM3DNOW_H) #include #endif -#if HAVE_IMMINTRIN_H && !defined(SDL_DISABLE_IMMINTRIN_H) +#if defined(HAVE_IMMINTRIN_H) && !defined(SDL_DISABLE_IMMINTRIN_H) #include #else #if defined(__MMX__) && !defined(SDL_DISABLE_MMINTRIN_H)