Skip to content

Commit

Permalink
Build workaround for kernels older than 2.6.39 (#260)
Browse files Browse the repository at this point in the history
  • Loading branch information
MonkeybreadSoftware authored May 5, 2021
1 parent b883701 commit 6f0056e
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions linux/hid.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,22 @@

#include "hidapi.h"

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

#endif


/* USB HID device property names */
const char *device_string_names[] = {
Expand Down

0 comments on commit 6f0056e

Please sign in to comment.