[PATCH libevdev 2/2] Add a file to define missing bits for older kernels

Peter Hutterer peter.hutterer at who-t.net
Mon Oct 7 21:58:01 PDT 2013


This is a very simple patch for now, adding more bits gets complicated
really quickly. So let's just add the most recent bits for now.

CC: Gaetan Nadon <memsize at videotron.ca>
Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
I've got a larger patchset that enables a lot more bits including RHEL6 support but
I think for now we should just enable the most recent additions. It gets complicated
really quickly otherwise and until we actually start shipping libevdev on RHEL6 we
don't need to worry about more.

 libevdev/Makefile.am        |  1 +
 libevdev/libevdev-defines.h | 43 +++++++++++++++++++++++++++++++++++++++++++
 libevdev/libevdev-int.h     |  1 +
 3 files changed, 45 insertions(+)
 create mode 100644 libevdev/libevdev-defines.h

diff --git a/libevdev/Makefile.am b/libevdev/Makefile.am
index 552df70..b2f49c0 100644
--- a/libevdev/Makefile.am
+++ b/libevdev/Makefile.am
@@ -4,6 +4,7 @@ AM_CPPFLAGS = $(GCC_CFLAGS) $(GCOV_CFLAGS) -I$(top_srcdir)
 
 libevdev_la_SOURCES = \
                    libevdev.h \
+                   libevdev-defines.h \
                    libevdev-int.h \
                    libevdev-util.h \
                    libevdev-uinput.c \
diff --git a/libevdev/libevdev-defines.h b/libevdev/libevdev-defines.h
new file mode 100644
index 0000000..1289ad7
--- /dev/null
+++ b/libevdev/libevdev-defines.h
@@ -0,0 +1,43 @@
+/*
+ * Copyright © 2013 Red Hat, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that copyright
+ * notice and this permission notice appear in supporting documentation, and
+ * that the name of the copyright holders not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission.  The copyright holders make no representations
+ * about the suitability of this software for any purpose.  It is provided "as
+ * is" without express or implied warranty.
+ *
+ * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+ * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * OF THIS SOFTWARE.
+ */
+
+/* @file backwards-compatible defines
+ *
+ * #defines needed to make libevdev build on older kernels where linux/input.h
+ * is missing the required defines.
+ *
+ * This file is NOT for general defines, only add linux/input.h defines here!
+ */
+
+#ifndef LIBEVDEV_DEFINES_H
+#define LIBEVDEV_DEFINES_H
+
+#ifndef EVIOCSCLOCKID
+#define EVIOCSCLOCKID           _IOW('E', 0xa0, int)
+#endif
+
+#ifndef ABS_MT_TOOL_Y
+#define ABS_MT_TOOL_Y 0x3d
+#endif
+
+#endif /* LIBEVDEV_DEFINES_H */
+
diff --git a/libevdev/libevdev-int.h b/libevdev/libevdev-int.h
index 21d67d3..3f1ca81 100644
--- a/libevdev/libevdev-int.h
+++ b/libevdev/libevdev-int.h
@@ -28,6 +28,7 @@
 #include <stdlib.h>
 #include <errno.h>
 #include "libevdev.h"
+#include "libevdev-defines.h"
 
 #define LONG_BITS (sizeof(long) * 8)
 #define NLONGS(x) (((x) + LONG_BITS - 1) / LONG_BITS)
-- 
1.8.3.1



More information about the Input-tools mailing list