From a9f0704ae1a8ac2a5e7086d8bd8c62aa2e93fb27 Mon Sep 17 00:00:00 2001 From: Ting-Wei Lan Date: Tue, 1 May 2018 22:00:31 +0800 Subject: [PATCH] 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 --- configure.ac | 8 +++++++- gdk/wayland/gdkdevice-wayland.c | 6 ++++-- 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 -#include - #include #include +#if defined(HAVE_DEV_EVDEV_INPUT_H) +#include +#elif defined(HAVE_LINUX_INPUT_H) #include +#endif #define BUTTON_BASE (BTN_LEFT - 1) /* Used to translate to 1-indexed buttons */