From 9925ee52d77893d614ebe1a3b19a4f168d6a15ba Mon Sep 17 00:00:00 2001
From: Joshua Root <[EMAIL REDACTED]>
Date: Thu, 24 Nov 2022 07:37:36 +1100
Subject: [PATCH] SDL_mfijoystick.m: fix build with Xcode < 9
Fixes #6601.
(cherry picked from commit 53ca1f77029289a58f1a9963a00b637b903f494d)
---
src/joystick/iphoneos/SDL_mfijoystick.m | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/joystick/iphoneos/SDL_mfijoystick.m b/src/joystick/iphoneos/SDL_mfijoystick.m
index 8f207afb2efa..86e481067896 100644
--- a/src/joystick/iphoneos/SDL_mfijoystick.m
+++ b/src/joystick/iphoneos/SDL_mfijoystick.m
@@ -639,11 +639,16 @@ @interface GCMicroGamepad (SDL)
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 {