diff --git a/Controllers/HyperXQuadcastController/HyperXQuadcastSController.cpp b/Controllers/HyperXQuadcastController/HyperXQuadcastSController.cpp index f950aef7..869ab665 100644 --- a/Controllers/HyperXQuadcastController/HyperXQuadcastSController.cpp +++ b/Controllers/HyperXQuadcastController/HyperXQuadcastSController.cpp @@ -18,7 +18,7 @@ HyperXQuadcastSController::HyperXQuadcastSController(hidapi_wrapper hid_wrapper, location = path; wchar_t serial_string[128]; - int ret = wrapper.hid_get_serial_num_string(dev, serial_string, 128); + int ret = wrapper.hid_get_serial_number_string(dev, serial_string, 128); if(ret != 0) { diff --git a/ResourceManager.cpp b/ResourceManager.cpp index 5e960bd0..2281caa2 100644 --- a/ResourceManager.cpp +++ b/ResourceManager.cpp @@ -26,14 +26,14 @@ const hidapi_wrapper default_wrapper = { NULL, - (hidapi_wrapper_send_feature_report) hid_send_feature_report, - (hidapi_wrapper_get_feature_report) hid_get_feature_report, - (hidapi_wrapper_get_serial_num_string) hid_get_serial_number_string, - (hidapi_wrapper_open_path) hid_open_path, - (hidapi_wrapper_enumerate) hid_enumerate, - (hidapi_wrapper_free_enumeration) hid_free_enumeration, - (hidapi_wrapper_close) hid_close, - (hidapi_wrapper_error) hid_error + (hidapi_wrapper_send_feature_report) hid_send_feature_report, + (hidapi_wrapper_get_feature_report) hid_get_feature_report, + (hidapi_wrapper_get_serial_number_string) hid_get_serial_number_string, + (hidapi_wrapper_open_path) hid_open_path, + (hidapi_wrapper_enumerate) hid_enumerate, + (hidapi_wrapper_free_enumeration) hid_free_enumeration, + (hidapi_wrapper_close) hid_close, + (hidapi_wrapper_error) hid_error }; ResourceManager* ResourceManager::instance; @@ -1263,22 +1263,26 @@ void ResourceManager::DetectDevicesThreadFunction() /*-------------------------------------------------*\ | Load the libhidapi-libusb library | \*-------------------------------------------------*/ +#ifdef __GLIBC__ if(dyn_handle = dlopen("libhidapi-libusb.so", RTLD_NOW | RTLD_NODELETE | RTLD_DEEPBIND)) +#else + if(dyn_handle = dlopen("libhidapi-libusb.so", RTLD_NOW | RTLD_NODELETE )) +#endif { /*-------------------------------------------------*\ | Create a wrapper with the libusb functions | \*-------------------------------------------------*/ wrapper = { - .dyn_handle = dyn_handle, - .hid_send_feature_report = (hidapi_wrapper_send_feature_report) dlsym(dyn_handle,"hid_send_feature_report"), - .hid_get_feature_report = (hidapi_wrapper_get_feature_report) dlsym(dyn_handle,"hid_get_feature_report"), - .hid_get_serial_num_string = (hidapi_wrapper_get_serial_num_string) dlsym(dyn_handle,"hid_get_serial_number_string"), - .hid_open_path = (hidapi_wrapper_open_path) dlsym(dyn_handle,"hid_open_path"), - .hid_enumerate = (hidapi_wrapper_enumerate) dlsym(dyn_handle,"hid_enumerate"), - .hid_free_enumeration = (hidapi_wrapper_free_enumeration) dlsym(dyn_handle,"hid_free_enumeration"), - .hid_close = (hidapi_wrapper_close) dlsym(dyn_handle,"hid_close"), - .hid_error = (hidapi_wrapper_error) dlsym(dyn_handle,"hid_free_enumeration") + .dyn_handle = dyn_handle, + .hid_send_feature_report = (hidapi_wrapper_send_feature_report) dlsym(dyn_handle,"hid_send_feature_report"), + .hid_get_feature_report = (hidapi_wrapper_get_feature_report) dlsym(dyn_handle,"hid_get_feature_report"), + .hid_get_serial_number_string = (hidapi_wrapper_get_serial_number_string) dlsym(dyn_handle,"hid_get_serial_number_string"), + .hid_open_path = (hidapi_wrapper_open_path) dlsym(dyn_handle,"hid_open_path"), + .hid_enumerate = (hidapi_wrapper_enumerate) dlsym(dyn_handle,"hid_enumerate"), + .hid_free_enumeration = (hidapi_wrapper_free_enumeration) dlsym(dyn_handle,"hid_free_enumeration"), + .hid_close = (hidapi_wrapper_close) dlsym(dyn_handle,"hid_close"), + .hid_error = (hidapi_wrapper_error) dlsym(dyn_handle,"hid_free_enumeration") }; hid_devices = wrapper.hid_enumerate(0, 0); diff --git a/hidapi_wrapper/hidapi_wrapper.h b/hidapi_wrapper/hidapi_wrapper.h index 85eb5f62..57757e94 100644 --- a/hidapi_wrapper/hidapi_wrapper.h +++ b/hidapi_wrapper/hidapi_wrapper.h @@ -21,7 +21,7 @@ \*-----------------------------------------------------*/ typedef int (*hidapi_wrapper_send_feature_report) (hid_device*, const unsigned char*, size_t); typedef int (*hidapi_wrapper_get_feature_report) (hid_device*, unsigned char*, size_t); -typedef int (*hidapi_wrapper_get_serial_num_string) (hid_device*, wchar_t*, size_t); +typedef int (*hidapi_wrapper_get_serial_number_string) (hid_device*, wchar_t*, size_t); typedef hid_device* (*hidapi_wrapper_open_path) (const char*); typedef hid_device_info* (*hidapi_wrapper_enumerate) (unsigned short, unsigned short); typedef void (*hidapi_wrapper_free_enumeration) (hid_device_info*); @@ -37,7 +37,7 @@ struct hidapi_wrapper void* dyn_handle; hidapi_wrapper_send_feature_report hid_send_feature_report; hidapi_wrapper_get_feature_report hid_get_feature_report; - hidapi_wrapper_get_serial_num_string hid_get_serial_num_string; + hidapi_wrapper_get_serial_number_string hid_get_serial_number_string; hidapi_wrapper_open_path hid_open_path; hidapi_wrapper_enumerate hid_enumerate; hidapi_wrapper_free_enumeration hid_free_enumeration;