OLD | NEW |
1 diff --git a/libusb/libusb.h b/libusb/libusb.h | 1 diff --git a/libusb/libusb.h b/libusb/libusb.h |
2 index 58b406f..1d0dd7d 100644 | 2 index e8e1201..15bd0d5 100644 |
3 --- a/libusb/libusb.h | 3 --- a/libusb/libusb.h |
4 +++ b/libusb/libusb.h | 4 +++ b/libusb/libusb.h |
5 @@ -881,6 +881,12 @@ typedef void (LIBUSB_CALL *libusb_transfer_cb_fn)(struct li
busb_transfer *transf | 5 @@ -25,6 +25,12 @@ |
6 * completed, the library populates the transfer with the results and passes | 6 #define LIBUSB_H |
7 * it back to the user. | 7 |
| 8 #ifdef _MSC_VER |
| 9 +// Disable warning 4200 for [0]. |
| 10 +#pragma warning(push) |
| 11 +#pragma warning(disable: 4200) |
| 12 +#endif |
| 13 + |
| 14 +#ifdef _MSC_VER |
| 15 /* on MS environments, the inline keyword is available in C++ only */ |
| 16 #if !defined(__cplusplus) |
| 17 #define inline __inline |
| 18 @@ -1938,4 +1944,8 @@ void LIBUSB_CALL libusb_hotplug_deregister_callback(libusb
_context *ctx, |
| 19 } |
| 20 #endif |
| 21 |
| 22 +#ifdef _MSC_VER |
| 23 +#pragma warning(pop) |
| 24 +#endif |
| 25 + |
| 26 #endif |
| 27 diff --git a/libusb/os/threads_posix.c b/libusb/os/threads_posix.c |
| 28 index 9769f58..46f6db7 100644 |
| 29 --- a/libusb/os/threads_posix.c |
| 30 +++ b/libusb/os/threads_posix.c |
| 31 @@ -20,11 +20,6 @@ |
8 */ | 32 */ |
9 + | |
10 +#if defined(OS_WIN) | |
11 +#pragma warning(push) | |
12 +#pragma warning(disable:4200) | |
13 +#endif // defined(OS_WIN) | |
14 + | |
15 struct libusb_transfer { | |
16 /** Handle of the device that this transfer will be submitted to */ | |
17 libusb_device_handle *dev_handle; | |
18 @@ -939,6 +945,10 @@ struct libusb_transfer { | |
19 ; | |
20 }; | |
21 | 33 |
22 +#if defined(OS_WIN) | 34 #if defined(__linux__) || defined(__OpenBSD__) |
23 +#pragma warning(pop) | 35 -# if defined(__linux__) |
24 +#endif // defined(OS_WIN) | 36 -# define _GNU_SOURCE |
25 + | 37 -# else |
26 /** \ingroup misc | 38 -# define _BSD_SOURCE |
27 * Capabilities supported by this instance of libusb. Test if the loaded | 39 -# endif |
28 * library supports a given capability by calling | 40 # include <unistd.h> |
29 diff --git a/libusb/os/windows_usb.h b/libusb/os/windows_usb.h | 41 # include <sys/syscall.h> |
30 index ddbd680..7c2fae5 100644 | 42 #elif defined(__APPLE__) |
31 --- a/libusb/os/windows_usb.h | 43 diff --git a/libusb/os/windows_usb.c b/libusb/os/windows_usb.c |
32 +++ b/libusb/os/windows_usb.h | 44 index 63357b1..51ce55d 100644 |
33 @@ -101,7 +101,7 @@ const GUID GUID_DEVINTERFACE_USB_DEVICE = { 0xA5DCBF10, 0x65
30, 0x11D2, {0x90, 0 | 45 --- a/libusb/os/windows_usb.c |
34 #if !defined(GUID_DEVINTERFACE_USB_HUB) | 46 +++ b/libusb/os/windows_usb.c |
35 const GUID GUID_DEVINTERFACE_USB_HUB = { 0xF18A0E88, 0xC30C, 0x11D0, {0x88, 0x1
5, 0x00, 0xA0, 0xC9, 0x06, 0xBE, 0xD8} }; | 47 @@ -2142,6 +2142,7 @@ static int windows_handle_events(struct libusb_context *ct
x, struct pollfd *fds, |
36 #endif | 48 » » » windows_handle_callback(transfer, io_result, io_size); |
37 -const GUID GUID_NULL = { 0x00000000, 0x0000, 0x0000, {0x00, 0x00, 0x00, 0x00, 0
x00, 0x00, 0x00, 0x00} }; | 49 » » } else { |
38 +static const GUID GUID_NULL = { 0x00000000, 0x0000, 0x0000, {0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00} }; | 50 » » » usbi_err(ctx, "could not find a matching transfer for fd
%x", fds[i]); |
39 | 51 +» » » usbi_mutex_unlock(&ctx->open_devs_lock); |
40 | 52 » » » return LIBUSB_ERROR_NOT_FOUND; |
41 /* | 53 » » } |
| 54 » } |
OLD | NEW |