Qt: Fix SDL 1.2 build

This commit is contained in:
Crestwave 2020-03-01 09:51:21 +08:00 committed by Vicki Pfau
parent 71995f77d5
commit 3b0ff3ea56
1 changed files with 1 additions and 1 deletions

View File

@ -272,8 +272,8 @@ void InputController::setPreferredGamepad(uint32_t type, int index) {
return;
}
#ifdef BUILD_SDL
char name[34] = {0};
#if SDL_VERSION_ATLEAST(2, 0, 0)
char name[34] = {0};
SDL_JoystickGetGUIDString(SDL_JoystickGetGUID(SDL_JoystickListGetPointer(&s_sdlEvents.joysticks, index)->joystick), name, sizeof(name));
#else
const char* name = SDL_JoystickName(SDL_JoystickIndex(SDL_JoystickListGetPointer(&s_sdlEvents.joysticks, index)->joystick));