Removed usage of TARGET_OS_OSX for building with older SDKs

This commit is contained in:
Sam Lantinga 2020-11-24 07:56:59 -08:00
parent a7d91ebaa5
commit e4b7d9a221
2 changed files with 3 additions and 5 deletions

View File

@ -528,7 +528,7 @@ JoystickAlreadyKnown(IOHIDDeviceRef ioHIDDeviceObject)
{ {
recDevice *i; recDevice *i;
#if TARGET_OS_OSX #if defined(SDL_JOYSTICK_MFI) && !TARGET_OS_IOS
extern SDL_bool IOS_SupportedHIDDevice(IOHIDDeviceRef device); extern SDL_bool IOS_SupportedHIDDevice(IOHIDDeviceRef device);
if (IOS_SupportedHIDDevice(ioHIDDeviceObject)) { if (IOS_SupportedHIDDevice(ioHIDDeviceObject)) {
return SDL_TRUE; return SDL_TRUE;

View File

@ -60,7 +60,7 @@ static id disconnectObserver = nil;
* they are only ever used indirectly through objc_msgSend * they are only ever used indirectly through objc_msgSend
*/ */
@interface GCController (SDL) @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; + (BOOL)supportsHIDDevice:(IOHIDDeviceRef)device;
#endif #endif
@end @end
@ -1378,14 +1378,12 @@ IOS_JoystickGetGamepadMapping(int device_index, SDL_GamepadMapping *out)
return SDL_FALSE; return SDL_FALSE;
} }
#if TARGET_OS_OSX #if defined(SDL_JOYSTICK_MFI) && !TARGET_OS_IOS
SDL_bool IOS_SupportedHIDDevice(IOHIDDeviceRef device) SDL_bool IOS_SupportedHIDDevice(IOHIDDeviceRef device)
{ {
#ifdef SDL_JOYSTICK_MFI
if (is_macos11()) { if (is_macos11()) {
return [GCController supportsHIDDevice:device] ? SDL_TRUE : SDL_FALSE; return [GCController supportsHIDDevice:device] ? SDL_TRUE : SDL_FALSE;
} }
#endif
return SDL_FALSE; return SDL_FALSE;
} }
#endif #endif