mirror of
https://github.com/Ryujinx/SDL.git
synced 2025-01-18 15:07:09 +00:00
hidapi: Allow disabling libusb support at runtime
This commit is contained in:
parent
c87b0142fe
commit
964e979d06
|
@ -1037,6 +1037,11 @@ int SDL_hid_init(void)
|
|||
#endif
|
||||
|
||||
#ifdef SDL_LIBUSB_DYNAMIC
|
||||
if (SDL_getenv("SDL_HIDAPI_DISABLE_LIBUSB") != NULL) {
|
||||
SDL_LogDebug(SDL_LOG_CATEGORY_INPUT,
|
||||
"libusb disabled by SDL_HIDAPI_DISABLE_LIBUSB");
|
||||
libusb_ctx.libhandle = NULL;
|
||||
} else {
|
||||
++attempts;
|
||||
libusb_ctx.libhandle = SDL_LoadObject(SDL_LIBUSB_DYNAMIC);
|
||||
if (libusb_ctx.libhandle != NULL) {
|
||||
|
@ -1087,6 +1092,7 @@ int SDL_hid_init(void)
|
|||
++success;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif /* SDL_LIBUSB_DYNAMIC */
|
||||
|
||||
#if HAVE_PLATFORM_BACKEND
|
||||
|
|
Loading…
Reference in a new issue