-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Latest macOS system header causes compilation failures #9632
Comments
Which compiler are you using that doesn't define |
It may be a clang version e.g. on linux being used as a cross-compiler.
https://clang.llvm.org/docs/LanguageExtensions.html suggests diff --git a/include/SDL3/SDL_platform_defines.h b/include/SDL3/SDL_platform_defines.h
index de0908f..e582efd 100644
--- a/include/SDL3/SDL_platform_defines.h
+++ b/include/SDL3/SDL_platform_defines.h
@@ -65,6 +65,14 @@
#define SDL_PLATFORM_APPLE 1
/* lets us know what version of macOS we're compiling on */
#include <AvailabilityMacros.h>
+/* macOS 14 SDK has a problematic use of __has_extension in TargetConditionals.h: */
+#ifndef __has_extension
+# ifdef __has_feature
+# define __has_extension __has_feature
+# else
+# define __has_extension(x) 0
+# endif
+#endif
#include <TargetConditionals.h>
/* Fix building with older SDKs that don't define these |
Let's make sure we undef that after the include, if we defined it, but otherwise I say we try this approach. |
|
Issue Description:
Im unable to compile projects that uses SDL2 on latest MacOS. The current system header TargetConditionals.h seems to be incompatible with SDL
How to reproduce:
What I expect:
Use SDL in projects without modifying header files first.
Workaround:
Change the following code in SDL_platform.h
Before (with failure):
After (project builds fine):
The text was updated successfully, but these errors were encountered: