summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTing-Wei Lan <lantw@src.gnome.org>2018-05-01 22:00:31 +0800
committerTing-Wei Lan <lantw@src.gnome.org>2018-05-01 22:00:31 +0800
commita9f0704ae1a8ac2a5e7086d8bd8c62aa2e93fb27 (patch)
tree5488121d329f751eb758b8f43764e75ea853e230
parent33bec5a4fbd95509f6e3b7a457325aeb8b0a0608 (diff)
downloadgtk+-a9f0704ae1a8ac2a5e7086d8bd8c62aa2e93fb27.tar.gz
wayland: Use dev/evdev/input.h on FreeBSD
The header linux/input.h used by GDK is specific to Linux. It is possible to get a few Linux headers on FreeBSD by installing v4l_compat, but it is usually better to use the one shipped with FreeBSD. We prefer dev/evdev/input.h to linux/input.h here, so it will always use dev/evdev/input.h on FreeBSD regardless of v4l_compat. https://svnweb.freebsd.org/changeset/ports/465644
-rw-r--r--configure.ac8
-rw-r--r--gdk/wayland/gdkdevice-wayland.c6
2 files changed, 11 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac
index 023a86fb17..05843eda14 100644
--- a/configure.ac
+++ b/configure.ac
@@ -819,7 +819,13 @@ LIBS=$gtk_save_LIBS
AC_CHECK_HEADERS(linux/memfd.h,
AC_DEFINE(HAVE_LINUX_MEMFD_H, 1,
- [Define to 1 if memfd.h is available]))
+ [Define to 1 if linux/memfd.h is available]))
+AC_CHECK_HEADERS(linux/input.h,
+ AC_DEFINE(HAVE_LINUX_INPUT_H, 1,
+ [Define to 1 if linux/input.h is available]))
+AC_CHECK_HEADERS(dev/evdev/input.h,
+ AC_DEFINE(HAVE_DEV_EVDEV_INPUT_H, 1,
+ [Define to 1 if dev/evdev/input.h is available]))
AC_CHECK_HEADERS(sys/mman.h,
AC_DEFINE(HAVE_SYS_MMAN_H, 1,
[Define to 1 if mman.h is available]))
diff --git a/gdk/wayland/gdkdevice-wayland.c b/gdk/wayland/gdkdevice-wayland.c
index ee2fbd3dc6..d17b5510b8 100644
--- a/gdk/wayland/gdkdevice-wayland.c
+++ b/gdk/wayland/gdkdevice-wayland.c
@@ -38,11 +38,13 @@
#include <xkbcommon/xkbcommon.h>
-#include <linux/input.h>
-
#include <sys/time.h>
#include <sys/mman.h>
+#if defined(HAVE_DEV_EVDEV_INPUT_H)
+#include <dev/evdev/input.h>
+#elif defined(HAVE_LINUX_INPUT_H)
#include <linux/input.h>
+#endif
#define BUTTON_BASE (BTN_LEFT - 1) /* Used to translate to 1-indexed buttons */