From d1977b20a477367db1f799592e5f6d00a73e20b9 Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Wed, 8 Sep 2021 11:46:04 +1000 Subject: [PATCH] SDLControllerInterface: Fix compilation on older SDL versions (ugh) --- src/frontend-common/sdl_controller_interface.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/frontend-common/sdl_controller_interface.cpp b/src/frontend-common/sdl_controller_interface.cpp index 1bacefc8a..e2958d274 100644 --- a/src/frontend-common/sdl_controller_interface.cpp +++ b/src/frontend-common/sdl_controller_interface.cpp @@ -43,10 +43,14 @@ bool SDLControllerInterface::Initialize(CommonHostInterface* host_interface) if (ds4_rumble_enabled) { Log_InfoPrintf("Enabling PS4/PS5 enhanced mode."); +#if SDL_VERSION_ATLEAST(2, 0, 9) SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_PS4, "true"); SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_PS4_RUMBLE, "true"); +#endif +#if SDL_VERSION_ATLEAST(2, 0, 16) SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_PS5, "true"); SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_PS5_RUMBLE, "true"); +#endif } if (SDL_InitSubSystem(SDL_INIT_JOYSTICK | SDL_INIT_GAMECONTROLLER | SDL_INIT_HAPTIC) < 0)