| diff --git a/libusb/libusb.h b/libusb/libusb.h |
| index e8e1201..15bd0d5 100644 |
| --- a/libusb/libusb.h |
| +++ b/libusb/libusb.h |
| @@ -25,6 +25,12 @@ |
| #define LIBUSB_H |
| |
| #ifdef _MSC_VER |
| +// Disable warning 4200 for [0]. |
| +#pragma warning(push) |
| +#pragma warning(disable: 4200) |
| +#endif |
| + |
| +#ifdef _MSC_VER |
| /* on MS environments, the inline keyword is available in C++ only */ |
| #if !defined(__cplusplus) |
| #define inline __inline |
| @@ -1938,4 +1944,8 @@ void LIBUSB_CALL libusb_hotplug_deregister_callback(libusb_context *ctx, |
| } |
| #endif |
| |
| +#ifdef _MSC_VER |
| +#pragma warning(pop) |
| +#endif |
| + |
| #endif |
| diff --git a/libusb/os/threads_posix.c b/libusb/os/threads_posix.c |
| index 9769f58..46f6db7 100644 |
| --- a/libusb/os/threads_posix.c |
| +++ b/libusb/os/threads_posix.c |
| @@ -20,11 +20,6 @@ |
| */ |
| |
| #if defined(__linux__) || defined(__OpenBSD__) |
| -# if defined(__linux__) |
| -# define _GNU_SOURCE |
| -# else |
| -# define _BSD_SOURCE |
| -# endif |
| # include <unistd.h> |
| # include <sys/syscall.h> |
| #elif defined(__APPLE__) |
| diff --git a/libusb/os/windows_usb.c b/libusb/os/windows_usb.c |
| index 63357b1..51ce55d 100644 |
| --- a/libusb/os/windows_usb.c |
| +++ b/libusb/os/windows_usb.c |
| @@ -2142,6 +2142,7 @@ static int windows_handle_events(struct libusb_context *ctx, struct pollfd *fds, |
| windows_handle_callback(transfer, io_result, io_size); |
| } else { |
| usbi_err(ctx, "could not find a matching transfer for fd %x", fds[i]); |
| + usbi_mutex_unlock(&ctx->open_devs_lock); |
| return LIBUSB_ERROR_NOT_FOUND; |
| } |
| } |