From e4b7d9a22109414bcac9af691e888a531c288a8d Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Tue, 24 Nov 2020 07:56:59 -0800 Subject: [PATCH] Removed usage of TARGET_OS_OSX for building with older SDKs --- src/joystick/darwin/SDL_iokitjoystick.c | 2 +- src/joystick/iphoneos/SDL_mfijoystick.m | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/joystick/darwin/SDL_iokitjoystick.c b/src/joystick/darwin/SDL_iokitjoystick.c index 9d4514bcc..dfbec20ee 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 c7b432489..fb453e4c3 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