Fixed building with --disable-joystick on iOS
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
diff --git a/src/video/uikit/SDL_uikitview.m b/src/video/uikit/SDL_uikitview.m
index b9ecfed..b46e183 100644
--- a/src/video/uikit/SDL_uikitview.m
+++ b/src/video/uikit/SDL_uikitview.m
@@ -37,7 +37,9 @@
#define MAX_MOUSE_BUTTONS 5
/* This is defined in SDL_sysjoystick.m */
+#if !SDL_JOYSTICK_DISABLED
extern int SDL_AppleTVRemoteOpenedAsJoystick;
+#endif
@implementation SDL_uikitview {
SDL_Window *sdlwindow;
@@ -374,6 +376,7 @@ extern int SDL_AppleTVRemoteOpenedAsJoystick;
}
#endif
+#if !SDL_JOYSTICK_DISABLED
/* Presses from Apple TV remote */
if (!SDL_AppleTVRemoteOpenedAsJoystick) {
switch (press.type) {
@@ -398,6 +401,7 @@ extern int SDL_AppleTVRemoteOpenedAsJoystick;
break;
}
}
+#endif /* !SDL_JOYSTICK_DISABLED */
return SDL_SCANCODE_UNKNOWN;
}
@@ -465,6 +469,7 @@ extern int SDL_AppleTVRemoteOpenedAsJoystick;
{
/* Swipe gestures don't trigger begin states. */
if (gesture.state == UIGestureRecognizerStateEnded) {
+#if !SDL_JOYSTICK_DISABLED
if (!SDL_AppleTVRemoteOpenedAsJoystick) {
/* Send arrow key presses for now, as we don't have an external API
* which better maps to swipe gestures. */
@@ -483,6 +488,7 @@ extern int SDL_AppleTVRemoteOpenedAsJoystick;
break;
}
}
+#endif /* !SDL_JOYSTICK_DISABLED */
}
}
#endif /* TARGET_OS_TV */