diff --git a/README.md b/README.md index c9e7984..891bf68 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ |----------------------|--------| | `macOS master` | ![macOS Build](https://github.com/libusb/hidapi/workflows/macOS%20Build/badge.svg?branch=master) | | `Windows master` | [![Build status](https://ci.appveyor.com/api/projects/status/xfmr5fo8w0re8ded/branch/master?svg=true)](https://ci.appveyor.com/project/libusb/hidapi/branch/master) | -| `Linux/BSD, last build (branch/PR)` | [![builds.sr.ht status](https://builds.sr.ht/~qbicz/hidapi.svg)](https://builds.sr.ht/~qbicz/hidapi?) | +| `Linux/BSD, last build (branch/PR)` | [![builds.sr.ht status](https://builds.sr.ht/~z3ntu/hidapi.svg)](https://builds.sr.ht/~z3ntu/hidapi) | HIDAPI is a multi-platform library which allows an application to interface with USB and Bluetooth HID-Class devices on Windows, Linux, FreeBSD, and macOS. diff --git a/linux/hid.c b/linux/hid.c index 718541e..e5f85d1 100644 --- a/linux/hid.c +++ b/linux/hid.c @@ -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[] = { diff --git a/windows/hidapi.vcxproj b/windows/hidapi.vcxproj index c793017..aa6f208 100644 --- a/windows/hidapi.vcxproj +++ b/windows/hidapi.vcxproj @@ -26,24 +26,40 @@ DynamicLibrary - v140 + v110 + v120 + v140 + v141 + v142 Unicode true DynamicLibrary - v140 + v110 + v120 + v140 + v141 + v142 Unicode true DynamicLibrary - v140 + v110 + v120 + v140 + v141 + v142 Unicode DynamicLibrary - v140 + v110 + v120 + v140 + v141 + v142 Unicode diff --git a/windows/hidtest.vcxproj b/windows/hidtest.vcxproj index b3d8fbc..ca59a12 100644 --- a/windows/hidtest.vcxproj +++ b/windows/hidtest.vcxproj @@ -25,24 +25,40 @@ Application - v140 + v110 + v120 + v140 + v141 + v142 MultiByte true Application - v140 + v110 + v120 + v140 + v141 + v142 MultiByte true Application - v140 + v110 + v120 + v140 + v141 + v142 MultiByte Application - v140 + v110 + v120 + v140 + v141 + v142 MultiByte