Update hid.c #260

Merged
MonkeybreadSoftware merged 2 commits from patch-1 into master 2021-05-05 03:51:16 -05:00
MonkeybreadSoftware commented 2021-04-08 09:08:28 -05:00 (Migrated from github.com)

Put back in HIDIOCSFEATURE define as it's missing for us.

Put back in HIDIOCSFEATURE define as it's missing for us.
MonkeybreadSoftware commented 2021-04-08 09:09:34 -05:00 (Migrated from github.com)

We build hidapi here for 11 platforms. Lot's of combinations of compilers and platforms, but not all have the HIDIOCSFEATURE define yet.

We build hidapi here for 11 platforms. Lot's of combinations of compilers and platforms, but not all have the HIDIOCSFEATURE define yet.
z3ntu commented 2021-04-08 10:00:30 -05:00 (Migrated from github.com)

You're building for kernels older than 2.6.39? We don't have support for those anymore in hidapi, so even if it builds it probably doesn't work at runtime.

You're building for kernels older than 2.6.39? We don't have support for those anymore in hidapi, so even if it builds it probably doesn't work at runtime.
MonkeybreadSoftware commented 2021-04-08 11:44:39 -05:00 (Migrated from github.com)

The build machine is old to avoid some libc dependencies.
The actual machine running the code is usually newer.

And yes, I know we should update it to something newer.

The build machine is old to avoid some libc dependencies. The actual machine running the code is usually newer. And yes, I know we should update it to something newer.
Youw (Migrated from github.com) reviewed 2021-04-08 12:07:22 -05:00
@ -45,6 +45,22 @@
Youw (Migrated from github.com) commented 2021-04-08 12:07:20 -05:00

Since we dropped support of the old 2.6.39 kernel, I'd rather prefer if hidapi build would fail by default on those.

@MonkeybreadSoftware would this compromise work for you?

#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
Since we dropped support of the old `2.6.39` kernel, I'd rather prefer if hidapi build would fail by default on those. @MonkeybreadSoftware would this compromise work for you? ```suggestion #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 ```
Youw (Migrated from github.com) reviewed 2021-04-08 12:08:21 -05:00
@ -45,6 +45,22 @@
Youw (Migrated from github.com) commented 2021-04-08 12:08:21 -05:00

Of course this would require tweaking you build infrastructure tiny bit.

Of course this would require tweaking you build infrastructure tiny bit.
MonkeybreadSoftware (Migrated from github.com) reviewed 2021-04-08 12:10:19 -05:00
@ -45,6 +45,22 @@
MonkeybreadSoftware (Migrated from github.com) commented 2021-04-08 12:10:18 -05:00

Sure, it's fine with me. Thank you.

Sure, it's fine with me. Thank you.
Youw (Migrated from github.com) approved these changes 2021-04-08 12:44:43 -05:00
MonkeybreadSoftware (Migrated from github.com) reviewed 2021-05-15 08:36:48 -05:00
MonkeybreadSoftware (Migrated from github.com) left a comment

looks good

looks good
Sign in to join this conversation.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-libusb/hidapi!260
No description provided.