aboutsummaryrefslogtreecommitdiffstats
path: root/samples
diff options
context:
space:
mode:
Diffstat (limited to 'samples')
-rw-r--r--samples/hidraw/hid-example.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/samples/hidraw/hid-example.c b/samples/hidraw/hid-example.c
index 40e3d620058..816e2dcda7c 100644
--- a/samples/hidraw/hid-example.c
+++ b/samples/hidraw/hid-example.c
@@ -14,6 +14,17 @@
#include <linux/input.h>
#include <linux/hidraw.h>
+/*
+ * Ugly hack to work around failing compilation on systems that don't
+ * yet populate new version of hidraw.h to userspace.
+ *
+ * If you need this, please have your distro update the kernel headers.
+ */
+#ifndef HIDIOCSFEATURE
+#define HIDIOCSFEATURE(len) _IOC(_IOC_WRITE|_IOC_READ, 'H', 0x06, len)
+#define HIDIOCGFEATURE(len) _IOC(_IOC_WRITE|_IOC_READ, 'H', 0x07, len)
+#endif
+
/* Unix */
#include <sys/ioctl.h>
#include <sys/types.h>