Skip to content

Commit 6f0056e

Browse files
Build workaround for kernels older than 2.6.39 (#260)
1 parent b883701 commit 6f0056e

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

linux/hid.c

+16
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,22 @@
4545

4646
#include "hidapi.h"
4747

48+
#ifdef HIDAPI_ALLOW_BUILD_WORKAROUND_KERNEL_2_6_39
49+
/* This definitions first appeared in Linux Kernel 2.6.39 in linux/hidraw.h.
50+
hidapi doesn't support kernels older than that,
51+
so we don't define macros below explicitly, to fail builds on old kernels.
52+
For those who really need this as a workaround (e.g. to be able to build on old build machines),
53+
can workaround by defining the macro above.
54+
*/
55+
#ifndef HIDIOCSFEATURE
56+
#define HIDIOCSFEATURE(len) _IOC(_IOC_WRITE|_IOC_READ, 'H', 0x06, len)
57+
#endif
58+
#ifndef HIDIOCGFEATURE
59+
#define HIDIOCGFEATURE(len) _IOC(_IOC_WRITE|_IOC_READ, 'H', 0x07, len)
60+
#endif
61+
62+
#endif
63+
4864

4965
/* USB HID device property names */
5066
const char *device_string_names[] = {

0 commit comments

Comments
 (0)