Fixed build when events are disabled

Fixes https://github.com/libsdl-org/SDL/issues/5413
This commit is contained in:
Sam Lantinga 2022-03-17 08:52:31 -07:00
parent 01bfde4520
commit bcb0f1de23
1 changed files with 0 additions and 4 deletions

View File

@ -2731,9 +2731,7 @@ int SDL_PrivateJoystickTouchpad(SDL_Joystick *joystick, int touchpad, int finger
SDL_JoystickTouchpadInfo *touchpad_info; SDL_JoystickTouchpadInfo *touchpad_info;
SDL_JoystickTouchpadFingerInfo *finger_info; SDL_JoystickTouchpadFingerInfo *finger_info;
int posted; int posted;
#if !SDL_EVENTS_DISABLED
Uint32 event_type; Uint32 event_type;
#endif
if (touchpad < 0 || touchpad >= joystick->ntouchpads) { if (touchpad < 0 || touchpad >= joystick->ntouchpads) {
return 0; return 0;
@ -2777,7 +2775,6 @@ int SDL_PrivateJoystickTouchpad(SDL_Joystick *joystick, int touchpad, int finger
} }
} }
#if !SDL_EVENTS_DISABLED
if (state == finger_info->state) { if (state == finger_info->state) {
event_type = SDL_CONTROLLERTOUCHPADMOTION; event_type = SDL_CONTROLLERTOUCHPADMOTION;
} else if (state) { } else if (state) {
@ -2785,7 +2782,6 @@ int SDL_PrivateJoystickTouchpad(SDL_Joystick *joystick, int touchpad, int finger
} else { } else {
event_type = SDL_CONTROLLERTOUCHPADUP; event_type = SDL_CONTROLLERTOUCHPADUP;
} }
#endif
/* We ignore events if we don't have keyboard focus, except for touch release */ /* We ignore events if we don't have keyboard focus, except for touch release */
if (SDL_PrivateJoystickShouldIgnoreEvent()) { if (SDL_PrivateJoystickShouldIgnoreEvent()) {