浏览代码

Build `JoypadLinux` sandbox detection method only with udev

Fixes an `unused-function` warning when building with `udev=no`.
Riteo 2 年之前
父节点
当前提交
51dfdfab96
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      platform/linuxbsd/joypad_linux.cpp

+ 2 - 0
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