From 03a7abf80c783dbf95e8d30cf30bf85b0f20e7fc Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Wed, 27 May 2020 09:57:26 -0700 Subject: [PATCH] Fixed building with --disable-joystick on macOS --- src/haptic/darwin/SDL_syshaptic.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/haptic/darwin/SDL_syshaptic.c b/src/haptic/darwin/SDL_syshaptic.c index f37a10c5c..fb6c30302 100644 --- a/src/haptic/darwin/SDL_syshaptic.c +++ b/src/haptic/darwin/SDL_syshaptic.c @@ -599,12 +599,14 @@ SDL_SYS_HapticMouse(void) int SDL_SYS_JoystickIsHaptic(SDL_Joystick * joystick) { +#ifdef SDL_JOYSTICK_IOKIT if (joystick->driver != &SDL_DARWIN_JoystickDriver) { return SDL_FALSE; } if (joystick->hwdata->ffservice != 0) { return SDL_TRUE; } +#endif return SDL_FALSE; } @@ -615,6 +617,7 @@ SDL_SYS_JoystickIsHaptic(SDL_Joystick * joystick) int SDL_SYS_JoystickSameHaptic(SDL_Haptic * haptic, SDL_Joystick * joystick) { +#ifdef SDL_JOYSTICK_IOKIT if (joystick->driver != &SDL_DARWIN_JoystickDriver) { return 0; } @@ -622,6 +625,7 @@ SDL_SYS_JoystickSameHaptic(SDL_Haptic * haptic, SDL_Joystick * joystick) joystick->hwdata->ffservice)) { return 1; } +#endif return 0; } @@ -632,6 +636,7 @@ SDL_SYS_JoystickSameHaptic(SDL_Haptic * haptic, SDL_Joystick * joystick) int SDL_SYS_HapticOpenFromJoystick(SDL_Haptic * haptic, SDL_Joystick * joystick) { +#ifdef SDL_JOYSTICK_IOKIT int device_index = 0; SDL_hapticlist_item *item; @@ -648,6 +653,9 @@ SDL_SYS_HapticOpenFromJoystick(SDL_Haptic * haptic, SDL_Joystick * joystick) } return SDL_SYS_HapticOpenFromService(haptic, joystick->hwdata->ffservice); +#else + return -1; +#endif }