summaryrefslogtreecommitdiff
path: root/platform/x11
diff options
context:
space:
mode:
authorhondres <liu.gam3@gmail.com>2016-02-15 15:09:48 +0100
committerhondres <liu.gam3@gmail.com>2016-02-15 15:09:48 +0100
commit306518730078c0e4d8beb6d5d9afb90437de437f (patch)
treedfcbc1c2d85d6f9662a8bb8a40f9c5216010050f /platform/x11
parentb350ece864633013d7b59197945f304c20fa5c42 (diff)
include libudev only on udev builds
Diffstat (limited to 'platform/x11')
-rw-r--r--platform/x11/joystick_linux.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/platform/x11/joystick_linux.cpp b/platform/x11/joystick_linux.cpp
index 9fd19a767e..9a52c4ff36 100644
--- a/platform/x11/joystick_linux.cpp
+++ b/platform/x11/joystick_linux.cpp
@@ -33,11 +33,14 @@
#include "joystick_linux.h"
#include <linux/input.h>
-#include <libudev.h>
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
+#ifdef UDEV_ENABLED
+#include <libudev.h>
+#endif
+
#define LONG_BITS (sizeof(long) * 8)
#define test_bit(nr, addr) (((1UL << ((nr) % LONG_BITS)) & ((addr)[(nr) / LONG_BITS])) != 0)
#define NBITS(x) ((((x)-1)/LONG_BITS)+1)