From 913c3164b5dcd47eb3d625f8034c80590422e9d0 Mon Sep 17 00:00:00 2001 From: Riteo Date: Thu, 25 May 2023 04:43:07 +0200 Subject: [PATCH] Build `JoypadLinux` sandbox detection method only with udev Fixes an `unused-function` warning when building with `udev=no`. (cherry picked from commit 51dfdfab967234f0fa9939bd7158cc96a9ec3547) --- platform/x11/joypad_linux.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/platform/x11/joypad_linux.cpp b/platform/x11/joypad_linux.cpp index f816cbbef..d20ba401c 100644 --- a/platform/x11/joypad_linux.cpp +++ b/platform/x11/joypad_linux.cpp @@ -79,6 +79,7 @@ void JoypadLinux::Joypad::reset() { events.clear(); } +#ifdef UDEV_ENABLED // This function is derived from SDL: // https://github.com/libsdl-org/SDL/blob/main/src/core/linux/SDL_sandbox.c#L28-L45 static bool detect_sandbox() { @@ -98,6 +99,7 @@ static bool detect_sandbox() { return false; } +#endif // UDEV_ENABLED JoypadLinux::JoypadLinux(InputDefault *in) { #ifdef UDEV_ENABLED