mirror of
				https://github.com/libsdl-org/SDL.git
				synced 2025-11-04 01:34:38 +00:00 
			
		
		
		
	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?
This commit is contained in:
		@@ -50,12 +50,9 @@
 | 
				
			|||||||
#elif defined(__MINGW64_VERSION_MAJOR)
 | 
					#elif defined(__MINGW64_VERSION_MAJOR)
 | 
				
			||||||
#include <intrin.h>
 | 
					#include <intrin.h>
 | 
				
			||||||
#else
 | 
					#else
 | 
				
			||||||
#ifdef __ALTIVEC__
 | 
					/* 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(__APPLE_ALTIVEC__) && !defined(SDL_DISABLE_ALTIVEC_H)
 | 
					#if defined(HAVE_ALTIVEC_H) && defined(__ALTIVEC__) && !defined(__APPLE_ALTIVEC__) && defined(SDL_ENABLE_ALTIVEC_H)
 | 
				
			||||||
#include <altivec.h>
 | 
					#include <altivec.h>
 | 
				
			||||||
#undef pixel
 | 
					 | 
				
			||||||
#undef bool
 | 
					 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
#if defined(__ARM_NEON__) && !defined(SDL_DISABLE_ARM_NEON_H)
 | 
					#if defined(__ARM_NEON__) && !defined(SDL_DISABLE_ARM_NEON_H)
 | 
				
			||||||
#include <arm_neon.h>
 | 
					#include <arm_neon.h>
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user