diff options
| author | Matthew Parlane <parlane@gmail.com> | 2017-01-17 21:43:08 +1300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-01-17 21:43:08 +1300 |
| commit | 753455b3793010cc5c04efc3951f5977b5bc1d7e (patch) | |
| tree | 74dff3a26811a5a8aeefc7f9a6f4050ac041c879 /Source/Core/InputCommon/GCAdapter.cpp | |
| parent | a05b7b3922b5c60bd3ccb476ca98f57db0eda564 (diff) | |
| parent | c5b3b52d553d65e0c3307bcd0ca2b381b244e05f (diff) | |
Merge pull request #4671 from endrift/fix-libusb
InputCommon: Fix FreeBSD 11 libusb incompatibilities
Diffstat (limited to 'Source/Core/InputCommon/GCAdapter.cpp')
| -rw-r--r-- | Source/Core/InputCommon/GCAdapter.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Source/Core/InputCommon/GCAdapter.cpp b/Source/Core/InputCommon/GCAdapter.cpp index 26d6d15c48..9caa255aac 100644 --- a/Source/Core/InputCommon/GCAdapter.cpp +++ b/Source/Core/InputCommon/GCAdapter.cpp @@ -51,7 +51,11 @@ static std::function<void(void)> s_detect_callback; static bool s_libusb_driver_not_supported = false; 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; +#endif #if defined(LIBUSB_API_VERSION) && LIBUSB_API_VERSION >= 0x01000102 static libusb_hotplug_callback_handle s_hotplug_handle; #endif @@ -106,7 +110,9 @@ static void ScanThreadFunc() NOTICE_LOG(SERIALINTERFACE, "GC Adapter scanning thread started"); #if defined(LIBUSB_API_VERSION) && LIBUSB_API_VERSION >= 0x01000102 +#ifndef __FreeBSD__ s_libusb_hotplug_enabled = libusb_has_capability(LIBUSB_CAP_HAS_HOTPLUG) != 0; +#endif if (s_libusb_hotplug_enabled) { if (libusb_hotplug_register_callback( |
