Commit 242ce20cbf9e89679cce0c384a27ac56d00fc94d

Joshua Root 2022-11-24T07:37:36

SDL_mfijoystick.m: fix build with Xcode < 9 Fixes #6601. (cherry picked from commit 53ca1f77029289a58f1a9963a00b637b903f494d)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
diff --git a/src/joystick/iphoneos/SDL_mfijoystick.m b/src/joystick/iphoneos/SDL_mfijoystick.m
index 8f207af..86e4810 100644
--- a/src/joystick/iphoneos/SDL_mfijoystick.m
+++ b/src/joystick/iphoneos/SDL_mfijoystick.m
@@ -639,11 +639,16 @@ static int
 IOS_JoystickInit(void)
 {
 #if defined(__MACOSX__)
+#if _SDL_HAS_BUILTIN(__builtin_available)
     if (@available(macOS 10.16, *)) {
         /* Continue with initialization on macOS 11+ */
     } else {
         return 0;
     }
+#else
+    /* No @available, must be an older macOS version */
+    return 0;
+#endif
 #endif
 
     @autoreleasepool {