From 97782e6c64adac3b3e5583fbbbed8a5b104ec74c Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Tue, 24 Nov 2020 07:11:49 -0800 Subject: [PATCH] Don't try to call IOS_SupportedHIDDevice() if it's not defined --- src/joystick/darwin/SDL_iokitjoystick.c | 6 +++++- src/joystick/iphoneos/SDL_mfijoystick.m | 1 - 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/joystick/darwin/SDL_iokitjoystick.c b/src/joystick/darwin/SDL_iokitjoystick.c index 4484c40e1..9d4514bcc 100644 --- a/src/joystick/darwin/SDL_iokitjoystick.c +++ b/src/joystick/darwin/SDL_iokitjoystick.c @@ -526,11 +526,15 @@ GetDeviceInfo(IOHIDDeviceRef hidDevice, recDevice *pDevice) static SDL_bool JoystickAlreadyKnown(IOHIDDeviceRef ioHIDDeviceObject) { + recDevice *i; + +#if TARGET_OS_OSX extern SDL_bool IOS_SupportedHIDDevice(IOHIDDeviceRef device); if (IOS_SupportedHIDDevice(ioHIDDeviceObject)) { return SDL_TRUE; } - recDevice *i; +#endif + for (i = gpDeviceList; i != NULL; i = i->pNext) { if (i->deviceRef == ioHIDDeviceObject) { return SDL_TRUE; diff --git a/src/joystick/iphoneos/SDL_mfijoystick.m b/src/joystick/iphoneos/SDL_mfijoystick.m index 6d92b4ce8..df5edc303 100644 --- a/src/joystick/iphoneos/SDL_mfijoystick.m +++ b/src/joystick/iphoneos/SDL_mfijoystick.m @@ -1365,7 +1365,6 @@ IOS_JoystickGetGamepadMapping(int device_index, SDL_GamepadMapping *out) } #if TARGET_OS_OSX -extern SDL_bool IOS_SupportedHIDDevice(IOHIDDeviceRef device); SDL_bool IOS_SupportedHIDDevice(IOHIDDeviceRef device) { #ifdef SDL_JOYSTICK_MFI