Removed usage of TARGET_OS_OSX for building with older SDKs
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
diff --git a/src/joystick/darwin/SDL_iokitjoystick.c b/src/joystick/darwin/SDL_iokitjoystick.c
index 9d4514b..dfbec20 100644
--- a/src/joystick/darwin/SDL_iokitjoystick.c
+++ b/src/joystick/darwin/SDL_iokitjoystick.c
@@ -528,7 +528,7 @@ JoystickAlreadyKnown(IOHIDDeviceRef ioHIDDeviceObject)
{
recDevice *i;
-#if TARGET_OS_OSX
+#if defined(SDL_JOYSTICK_MFI) && !TARGET_OS_IOS
extern SDL_bool IOS_SupportedHIDDevice(IOHIDDeviceRef device);
if (IOS_SupportedHIDDevice(ioHIDDeviceObject)) {
return SDL_TRUE;
diff --git a/src/joystick/iphoneos/SDL_mfijoystick.m b/src/joystick/iphoneos/SDL_mfijoystick.m
index c7b4324..fb453e4 100644
--- a/src/joystick/iphoneos/SDL_mfijoystick.m
+++ b/src/joystick/iphoneos/SDL_mfijoystick.m
@@ -60,7 +60,7 @@ static id disconnectObserver = nil;
* they are only ever used indirectly through objc_msgSend
*/
@interface GCController (SDL)
-#if TARGET_OS_OSX && (__MAC_OS_X_VERSION_MAX_ALLOWED <= 101600)
+#if !TARGET_OS_IOS && (__MAC_OS_X_VERSION_MAX_ALLOWED <= 101600)
+ (BOOL)supportsHIDDevice:(IOHIDDeviceRef)device;
#endif
@end
@@ -1378,14 +1378,12 @@ IOS_JoystickGetGamepadMapping(int device_index, SDL_GamepadMapping *out)
return SDL_FALSE;
}
-#if TARGET_OS_OSX
+#if defined(SDL_JOYSTICK_MFI) && !TARGET_OS_IOS
SDL_bool IOS_SupportedHIDDevice(IOHIDDeviceRef device)
{
-#ifdef SDL_JOYSTICK_MFI
if (is_macos11()) {
return [GCController supportsHIDDevice:device] ? SDL_TRUE : SDL_FALSE;
}
-#endif
return SDL_FALSE;
}
#endif