From 8190efa5dc6e390bd4021e35c14410cf2fd5ae7d Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Sun, 22 Mar 2020 12:27:58 +1000 Subject: [PATCH] SDLControllerInterface: Fix compilation on Ubuntu LTS --- 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 ce7b6b25d..9b1e6a354 100644 --- a/src/frontend-common/sdl_controller_interface.cpp +++ b/src/frontend-common/sdl_controller_interface.cpp @@ -122,7 +122,11 @@ bool SDLControllerInterface::OpenGameController(int index) return false; } +#if SDL_VERSION_ATLEAST(2, 0, 9) int player_index = SDL_GameControllerGetPlayerIndex(gcontroller); +#else + int player_index = 0; +#endif int joystick_id = SDL_JoystickInstanceID(joystick); Log_InfoPrintf("Opened controller %d (instance id %d, player id %d): %s", index, joystick_id, player_index,