From 18c96e27d25c6e4ec20d31d97774f28eedf88975 Mon Sep 17 00:00:00 2001
From: Joshua Root <[EMAIL REDACTED]>
Date: Mon, 8 Sep 2025 09:20:11 +1000
Subject: [PATCH] Guard use of @available in SDL_cocoaevents.m
Older compilers don't understand this syntax.
(cherry picked from commit eb974470ece29ce7ebe77bddc5e340354f3dd558)
---
src/video/cocoa/SDL_cocoaevents.m | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/video/cocoa/SDL_cocoaevents.m b/src/video/cocoa/SDL_cocoaevents.m
index 39c5c4f38846e..f97ee63c1fc38 100644
--- a/src/video/cocoa/SDL_cocoaevents.m
+++ b/src/video/cocoa/SDL_cocoaevents.m
@@ -295,9 +295,11 @@ - (void)applicationDidFinishLaunching:(NSNotification *)notification
behaviour there. https://github.com/libsdl-org/SDL/issues/10340
(13.6 still needs it, presumably 13.7 does, too.) */
SDL_bool background_app_default = SDL_FALSE;
+#if _SDL_HAS_BUILTIN(__builtin_available)
if (@available(macOS 14.0, *)) {
background_app_default = SDL_TRUE; /* by default, don't explicitly activate the dock and then us again to force to foreground */
}
+#endif
if (!SDL_GetHintBoolean(SDL_HINT_MAC_BACKGROUND_APP, background_app_default)) {
/* Get more aggressive for Catalina: activate the Dock first so we definitely reset all activation state. */