Skip to content

Commit

Permalink
Removed usage of TARGET_OS_OSX for building with older SDKs
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Nov 24, 2020
1 parent a7d91eb commit e4b7d9a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/joystick/darwin/SDL_iokitjoystick.c
Expand Up @@ -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;
Expand Down
6 changes: 2 additions & 4 deletions src/joystick/iphoneos/SDL_mfijoystick.m
Expand Up @@ -60,7 +60,7 @@
* 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
Expand Down Expand Up @@ -1378,14 +1378,12 @@ -(void)cleanup
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
Expand Down

0 comments on commit e4b7d9a

Please sign in to comment.