summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRiteo <riteo@posteo.net>2023-05-25 04:43:07 +0200
committerRiteo <riteo@posteo.net>2023-05-25 04:47:43 +0200
commit51dfdfab967234f0fa9939bd7158cc96a9ec3547 (patch)
treeae1947905b8ab98bc36064aba5750c8a439e03ed
parent4c677c88e918e22ad696f225d189124444f9665e (diff)
downloadredot-engine-51dfdfab967234f0fa9939bd7158cc96a9ec3547.tar.gz
Build `JoypadLinux` sandbox detection method only with udev
Fixes an `unused-function` warning when building with `udev=no`.
-rw-r--r--platform/linuxbsd/joypad_linux.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/platform/linuxbsd/joypad_linux.cpp b/platform/linuxbsd/joypad_linux.cpp
index a9725fff2e..ab79885fb4 100644
--- a/platform/linuxbsd/joypad_linux.cpp
+++ b/platform/linuxbsd/joypad_linux.cpp
@@ -74,6 +74,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() {
@@ -93,6 +94,7 @@ static bool detect_sandbox() {
return false;
}
+#endif // UDEV_ENABLED
JoypadLinux::JoypadLinux(Input *in) {
#ifdef UDEV_ENABLED