From a445ccb56c4219a4a01706496582fb7cec8fe4cb Mon Sep 17 00:00:00 2001 From: Jim Pick Date: Tue, 26 Sep 2023 15:24:37 -0700 Subject: [PATCH] OS X enumerate fix: also look for IOKit in /System/Library/Frameworks It appears the location of the library has moved recently. --- hidapi/mac/hid.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/hidapi/mac/hid.c b/hidapi/mac/hid.c index 58ba49b..be1491f 100644 --- a/hidapi/mac/hid.c +++ b/hidapi/mac/hid.c @@ -303,7 +303,11 @@ static io_service_t hidapi_IOHIDDeviceGetService(IOHIDDeviceRef device) * and the fallback method will be used. */ if (iokit_framework == NULL) { - iokit_framework = dlopen("/System/Library/IOKit.framework/IOKit", RTLD_LAZY); + iokit_framework = dlopen("/System/Library/Frameworks/IOKit.framework/IOKit", RTLD_LAZY); + + if (iokit_framework == NULL) { + iokit_framework = dlopen("/System/Library/IOKit.framework/IOKit", RTLD_LAZY); + } if (iokit_framework != NULL) dynamic_IOHIDDeviceGetService = dlsym(iokit_framework, "IOHIDDeviceGetService");