mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-01 23:07:45 +08:00
Fixed building with -DSDL_HIDAPI=OFF
Fixes https://github.com/libsdl-org/SDL/issues/14975
(cherry picked from commit 56b77177a9)
This commit is contained in:
@@ -836,6 +836,8 @@ typedef struct LIBUSB_hid_device_ LIBUSB_hid_device;
|
|||||||
|
|
||||||
#endif // HAVE_LIBUSB
|
#endif // HAVE_LIBUSB
|
||||||
|
|
||||||
|
#endif // !SDL_HIDAPI_DISABLED
|
||||||
|
|
||||||
/* If the platform has any backend other than libusb, try to avoid using
|
/* If the platform has any backend other than libusb, try to avoid using
|
||||||
* libusb as the main backend for devices, since it detaches drivers and
|
* libusb as the main backend for devices, since it detaches drivers and
|
||||||
* therefore makes devices inaccessible to the rest of the OS.
|
* therefore makes devices inaccessible to the rest of the OS.
|
||||||
@@ -866,8 +868,6 @@ static bool RequiresLibUSB(Uint16 vendor, Uint16 product)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // !SDL_HIDAPI_DISABLED
|
|
||||||
|
|
||||||
#if defined(HAVE_PLATFORM_BACKEND) || defined(HAVE_DRIVER_BACKEND)
|
#if defined(HAVE_PLATFORM_BACKEND) || defined(HAVE_DRIVER_BACKEND)
|
||||||
// We have another way to get HID devices, so use the whitelist to get devices where libusb is preferred
|
// We have another way to get HID devices, so use the whitelist to get devices where libusb is preferred
|
||||||
#define SDL_HINT_HIDAPI_LIBUSB_WHITELIST_DEFAULT true
|
#define SDL_HINT_HIDAPI_LIBUSB_WHITELIST_DEFAULT true
|
||||||
|
|||||||
Reference in New Issue
Block a user