From ac15de18bd587b5af9322a38afe3838a2bb7c733 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Mon, 19 Nov 2018 21:28:52 -0800 Subject: [PATCH] Fixed bug 4392 - SDL_cpuinfo.h breaks compilation with C bool type Luke Dashjr Bug 3993 was "fixed" by #undef'ing bool. But this breaks C99's stdbool.h bool too. For example, mpv's build fails with: ../audio/out/ao_sdl.c:35:5: error: unknown type name ?bool? It seems ill-advised to be #undef'ing *anything* here - what if the code including SDL_cpuinfo.h actually wants to use altivec? --- include/SDL_cpuinfo.h | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/include/SDL_cpuinfo.h b/include/SDL_cpuinfo.h index ee3a47e841242..ac8263a1bdaa2 100644 --- a/include/SDL_cpuinfo.h +++ b/include/SDL_cpuinfo.h @@ -50,12 +50,9 @@ #elif defined(__MINGW64_VERSION_MAJOR) #include #else -#ifdef __ALTIVEC__ -#if defined(HAVE_ALTIVEC_H) && !defined(__APPLE_ALTIVEC__) && !defined(SDL_DISABLE_ALTIVEC_H) +/* altivec.h redefining bool causes a number of problems, see bugs 3993 and 4392, so you need to explicitly define SDL_ENABLE_ALTIVEC_H to have it included. */ +#if defined(HAVE_ALTIVEC_H) && defined(__ALTIVEC__) && !defined(__APPLE_ALTIVEC__) && defined(SDL_ENABLE_ALTIVEC_H) #include -#undef pixel -#undef bool -#endif #endif #if defined(__ARM_NEON__) && !defined(SDL_DISABLE_ARM_NEON_H) #include