wayland: Use dev/evdev/input.h on FreeBSD
authorTing-Wei Lan <lantw@src.gnome.org>
Tue, 1 May 2018 14:28:57 +0000 (22:28 +0800)
committerTing-Wei Lan <lantw@src.gnome.org>
Tue, 1 May 2018 14:28:57 +0000 (22:28 +0800)
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

config.h.meson
gdk/wayland/gdkdevice-wayland.c
meson.build

index 4d4a96e611685f21615a2903fb1ce0d1fee831ca..74a90d3df8ce8bfb76624df000bd3a5d7c49be2d 100644 (file)
 /* Define to 1 if linux/memfd.h exists */
 #mesondefine HAVE_LINUX_MEMFD_H
 
+#mesondefine HAVE_LINUX_INPUT_H
+
+#mesondefine HAVE_DEV_EVDEV_INPUT_H
+
 #mesondefine GTK_SYSCONFDIR
 
 #mesondefine GTK_LOCALEDIR
index 2b28b87aacadc14b87c63ee65d5233a57517c984..c9e710ae1ef97ceaf2370a719b305c2f05853051 100644 (file)
 
 #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 */
 
index 895cef9fc0618fd634d106a77592c0116afa41c3..921c6294a553cac95e0d6488df42b130eca0b819 100644 (file)
@@ -149,9 +149,11 @@ cdata.set('GTK_INTERFACE_AGE', gtk_interface_age)
 
 check_headers = [
   'crt/externs.h',
+  'dev/evdev/input.h',
   'dlfcn.h',
   'ftw.h',
   'inttypes.h',
+  'linux/input.h',
   'linux/memfd.h',
   'locale.h',
   'memory.h',