Build `JoypadLinux` sandbox detection method only with udev

Fixes an `unused-function` warning when building with `udev=no`.

(cherry picked from commit 51dfdfab96)
This commit is contained in:
Riteo 2023-05-25 04:43:07 +02:00 committed by Rémi Verschelde
parent 4c00ecd146
commit 1850325666
No known key found for this signature in database
GPG Key ID: C3336907360768E1
1 changed files with 2 additions and 0 deletions

View File

@ -79,6 +79,7 @@ void JoypadLinux::Joypad::reset() {
events.clear(); events.clear();
} }
#ifdef UDEV_ENABLED
// This function is derived from SDL: // This function is derived from SDL:
// https://github.com/libsdl-org/SDL/blob/main/src/core/linux/SDL_sandbox.c#L28-L45 // https://github.com/libsdl-org/SDL/blob/main/src/core/linux/SDL_sandbox.c#L28-L45
static bool detect_sandbox() { static bool detect_sandbox() {
@ -98,6 +99,7 @@ static bool detect_sandbox() {
return false; return false;
} }
#endif // UDEV_ENABLED
JoypadLinux::JoypadLinux(InputDefault *in) { JoypadLinux::JoypadLinux(InputDefault *in) {
#ifdef UDEV_ENABLED #ifdef UDEV_ENABLED