From 7fed0b74ed9f9c2d2e39a2776719f93cca8f6043 Mon Sep 17 00:00:00 2001 From: Ting-Wei Lan Date: Tue, 1 May 2018 22:28:57 +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 --- config.h.meson | 4 ++++ gdk/wayland/gdkdevice-wayland.c | 6 ++++-- meson.build | 2 ++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/config.h.meson b/config.h.meson index 4d4a96e611..74a90d3df8 100644 --- a/config.h.meson +++ b/config.h.meson @@ -286,6 +286,10 @@ /* 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 diff --git a/gdk/wayland/gdkdevice-wayland.c b/gdk/wayland/gdkdevice-wayland.c index 2b28b87aac..c9e710ae1e 100644 --- a/gdk/wayland/gdkdevice-wayland.c +++ b/gdk/wayland/gdkdevice-wayland.c @@ -41,11 +41,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 */ diff --git a/meson.build b/meson.build index 895cef9fc0..921c6294a5 100644 --- a/meson.build +++ b/meson.build @@ -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',