mirror of https://github.com/encounter/SDL.git
SDL_mfijoystick.m: fix build using older toolchains
Fixes https://github.com/libsdl-org/SDL/issues/4992 Fixes https://github.com/libsdl-org/SDL/issues/4958
This commit is contained in:
parent
1927c08036
commit
ee2afa00ba
|
@ -1331,6 +1331,7 @@ IOS_JoystickGetCapabilities(SDL_Joystick *joystick)
|
||||||
{
|
{
|
||||||
Uint32 result = 0;
|
Uint32 result = 0;
|
||||||
|
|
||||||
|
#if defined(ENABLE_MFI_LIGHT) || defined(ENABLE_MFI_RUMBLE)
|
||||||
@autoreleasepool {
|
@autoreleasepool {
|
||||||
SDL_JoystickDeviceItem *device = joystick->hwdata;
|
SDL_JoystickDeviceItem *device = joystick->hwdata;
|
||||||
|
|
||||||
|
@ -1340,13 +1341,13 @@ IOS_JoystickGetCapabilities(SDL_Joystick *joystick)
|
||||||
|
|
||||||
if (@available(macos 11.0, iOS 14.0, tvOS 14.0, *)) {
|
if (@available(macos 11.0, iOS 14.0, tvOS 14.0, *)) {
|
||||||
GCController *controller = device->controller;
|
GCController *controller = device->controller;
|
||||||
#ifdef ENABLE_MFI_LIGHT
|
#ifdef ENABLE_MFI_LIGHT
|
||||||
if (controller.light) {
|
if (controller.light) {
|
||||||
result |= SDL_JOYCAP_LED;
|
result |= SDL_JOYCAP_LED;
|
||||||
}
|
}
|
||||||
#endif /* ENABLE_MFI_LIGHT */
|
#endif
|
||||||
|
|
||||||
#ifdef ENABLE_MFI_RUMBLE
|
#ifdef ENABLE_MFI_RUMBLE
|
||||||
if (controller.haptics) {
|
if (controller.haptics) {
|
||||||
for (GCHapticsLocality locality in controller.haptics.supportedLocalities) {
|
for (GCHapticsLocality locality in controller.haptics.supportedLocalities) {
|
||||||
if ([locality isEqualToString:GCHapticsLocalityHandles]) {
|
if ([locality isEqualToString:GCHapticsLocalityHandles]) {
|
||||||
|
@ -1356,9 +1357,10 @@ IOS_JoystickGetCapabilities(SDL_Joystick *joystick)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif /* ENABLE_MFI_RUMBLE */
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif /* ENABLE_MFI_LIGHT || ENABLE_MFI_RUMBLE */
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue