mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-10 08:09:26 +01:00
InputCommon: Fix FreeBSD 11 libusb incompatibilities
This commit is contained in:
parent
cd29d565c4
commit
c5b3b52d55
@ -51,7 +51,11 @@ static std::function<void(void)> s_detect_callback;
|
|||||||
|
|
||||||
static bool s_libusb_driver_not_supported = false;
|
static bool s_libusb_driver_not_supported = false;
|
||||||
static libusb_context* s_libusb_context = nullptr;
|
static libusb_context* s_libusb_context = nullptr;
|
||||||
|
#if defined(__FreeBSD__) && __FreeBSD__ >= 11
|
||||||
|
static bool s_libusb_hotplug_enabled = true;
|
||||||
|
#else
|
||||||
static bool s_libusb_hotplug_enabled = false;
|
static bool s_libusb_hotplug_enabled = false;
|
||||||
|
#endif
|
||||||
#if defined(LIBUSB_API_VERSION) && LIBUSB_API_VERSION >= 0x01000102
|
#if defined(LIBUSB_API_VERSION) && LIBUSB_API_VERSION >= 0x01000102
|
||||||
static libusb_hotplug_callback_handle s_hotplug_handle;
|
static libusb_hotplug_callback_handle s_hotplug_handle;
|
||||||
#endif
|
#endif
|
||||||
@ -106,7 +110,9 @@ static void ScanThreadFunc()
|
|||||||
NOTICE_LOG(SERIALINTERFACE, "GC Adapter scanning thread started");
|
NOTICE_LOG(SERIALINTERFACE, "GC Adapter scanning thread started");
|
||||||
|
|
||||||
#if defined(LIBUSB_API_VERSION) && LIBUSB_API_VERSION >= 0x01000102
|
#if defined(LIBUSB_API_VERSION) && LIBUSB_API_VERSION >= 0x01000102
|
||||||
|
#ifndef __FreeBSD__
|
||||||
s_libusb_hotplug_enabled = libusb_has_capability(LIBUSB_CAP_HAS_HOTPLUG) != 0;
|
s_libusb_hotplug_enabled = libusb_has_capability(LIBUSB_CAP_HAS_HOTPLUG) != 0;
|
||||||
|
#endif
|
||||||
if (s_libusb_hotplug_enabled)
|
if (s_libusb_hotplug_enabled)
|
||||||
{
|
{
|
||||||
if (libusb_hotplug_register_callback(
|
if (libusb_hotplug_register_callback(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user