mirror of
https://github.com/encounter/SDL.git
synced 2025-07-07 05:35:58 +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
|
#endif
|
||||||
|
|
||||||
#ifdef SDL_LIBUSB_DYNAMIC
|
#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;
|
++attempts;
|
||||||
libusb_ctx.libhandle = SDL_LoadObject(SDL_LIBUSB_DYNAMIC);
|
libusb_ctx.libhandle = SDL_LoadObject(SDL_LIBUSB_DYNAMIC);
|
||||||
if (libusb_ctx.libhandle != NULL) {
|
if (libusb_ctx.libhandle != NULL) {
|
||||||
@ -1087,6 +1092,7 @@ int SDL_hid_init(void)
|
|||||||
++success;
|
++success;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
#endif /* SDL_LIBUSB_DYNAMIC */
|
#endif /* SDL_LIBUSB_DYNAMIC */
|
||||||
|
|
||||||
#if HAVE_PLATFORM_BACKEND
|
#if HAVE_PLATFORM_BACKEND
|
||||||
|
Loading…
x
Reference in New Issue
Block a user