Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(57)

Side by Side Diff: third_party/libusb/windows-build.patch

Issue 10198035: Fix warnings in libusb.h so that other chromium code doesn't suffer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More WIN chicanery. Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « third_party/libusb/libusb/os/poll_windows.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 diff --git a/libusb/libusb.h b/libusb/libusb.h
2 index de2d050..beff229 100644
3 --- a/libusb/libusb.h
4 +++ b/libusb/libusb.h
5 @@ -833,6 +833,10 @@ typedef void (LIBUSB_CALL *libusb_transfer_cb_fn)(struct li busb_transfer *transf
6 * completed, the library populates the transfer with the results and passes
7 * it back to the user.
8 */
9 +#if defined(OS_WIN)
10 +#pragma warning(push)
11 +#pragma warning(disable:4200)
12 +#endif // defined(OS_WIN)
13 struct libusb_transfer {
14 /** Handle of the device that this transfer will be submitted to */
15 libusb_device_handle *dev_handle;
16 @@ -884,12 +888,15 @@ struct libusb_transfer {
17 /** Isochronous packet descriptors, for isochronous transfers only. */
18 struct libusb_iso_packet_descriptor iso_packet_desc
19 #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
20 - [] /* valid C99 code */
21 + [] /* valid C99 code */
22 #else
23 - [0] /* non-standard, but usually working code */
24 + [0] /* non-standard, but usually working code */
25 #endif
26 - ;
27 + ;
28 };
29 +#if defined(OS_WIN)
30 +#pragma warning(pop)
31 +#endif // defined(OS_WIN)
32
33 /** \ingroup misc
34 * Capabilities supported by this instance of libusb. Test if the running
1 diff --git a/libusb/os/poll_windows.h b/libusb/os/poll_windows.h 35 diff --git a/libusb/os/poll_windows.h b/libusb/os/poll_windows.h
2 index fee89f5..27986b8 100644 36 index fee89f5..76bab0f 100644
3 --- a/libusb/os/poll_windows.h 37 --- a/libusb/os/poll_windows.h
4 +++ b/libusb/os/poll_windows.h 38 +++ b/libusb/os/poll_windows.h
5 @@ -19,6 +19,9 @@ 39 @@ -19,6 +19,9 @@
6 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 40 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
7 * 41 *
8 */ 42 */
9 + 43 +
10 +#ifndef LIBUSB_POLL_WINDOWS_H 44 +#ifndef LIBUSB_POLL_WINDOWS_H
11 +#define LIBUSB_POLL_WINDOWS_H 45 +#define LIBUSB_POLL_WINDOWS_H
12 #pragma once 46 #pragma once
13 47
14 #if defined(_MSC_VER) 48 #if defined(_MSC_VER)
15 @@ -57,12 +60,6 @@ extern enum windows_version windows_version; 49 @@ -50,19 +53,6 @@ extern enum windows_version windows_version;
16 #define POLLHUP 0x0010 /* Hung up */
17 #define POLLNVAL 0x0020 /* Invalid request: fd not open */
18 50
51 #define MAX_FDS 256
52
53 -#define POLLIN 0x0001 /* There is data to read */
54 -#define POLLPRI 0x0002 /* There is urgent data to read */
55 -#define POLLOUT 0x0004 /* Writing now will not block */
56 -#define POLLERR 0x0008 /* Error condition */
57 -#define POLLHUP 0x0010 /* Hung up */
58 -#define POLLNVAL 0x0020 /* Invalid request: fd not open */
59 -
19 -struct pollfd { 60 -struct pollfd {
20 - int fd; /* file descriptor */ 61 - int fd; /* file descriptor */
21 - short events; /* requested events */ 62 - short events; /* requested events */
22 - short revents; /* returned events */ 63 - short revents; /* returned events */
23 -}; 64 -};
24 - 65 -
25 // access modes 66 // access modes
26 enum rw_type { 67 enum rw_type {
27 RW_NONE, 68 RW_NONE,
28 @@ -118,3 +115,4 @@ do { \ 69 @@ -118,3 +108,4 @@ do { \
29 } while (0) 70 } while (0)
30 #endif 71 #endif
31 72
32 +#endif /* LIBUSB_POLL_WINDOWS_H */ 73 +#endif /* LIBUSB_POLL_WINDOWS_H */
33 diff --git a/libusb/os/windows_usb.h b/libusb/os/windows_usb.h 74 diff --git a/libusb/os/windows_usb.h b/libusb/os/windows_usb.h
34 index b629d18..6dbfaf5 100644 75 index b629d18..6dbfaf5 100644
35 --- a/libusb/os/windows_usb.h 76 --- a/libusb/os/windows_usb.h
36 +++ b/libusb/os/windows_usb.h 77 +++ b/libusb/os/windows_usb.h
37 @@ -101,8 +101,6 @@ const GUID GUID_DEVINTERFACE_USB_DEVICE = { 0xA5DCBF10, 0x65 30, 0x11D2, {0x90, 0 78 @@ -101,8 +101,6 @@ const GUID GUID_DEVINTERFACE_USB_DEVICE = { 0xA5DCBF10, 0x65 30, 0x11D2, {0x90, 0
38 #if !defined(GUID_DEVINTERFACE_USB_HUB) 79 #if !defined(GUID_DEVINTERFACE_USB_HUB)
39 const GUID GUID_DEVINTERFACE_USB_HUB = { 0xF18A0E88, 0xC30C, 0x11D0, {0x88, 0x1 5, 0x00, 0xA0, 0xC9, 0x06, 0xBE, 0xD8} }; 80 const GUID GUID_DEVINTERFACE_USB_HUB = { 0xF18A0E88, 0xC30C, 0x11D0, {0x88, 0x1 5, 0x00, 0xA0, 0xC9, 0x06, 0xBE, 0xD8} };
40 #endif 81 #endif
41 -const GUID GUID_NULL = { 0x00000000, 0x0000, 0x0000, {0x00, 0x00, 0x00, 0x00, 0 x00, 0x00, 0x00, 0x00} }; 82 -const GUID GUID_NULL = { 0x00000000, 0x0000, 0x0000, {0x00, 0x00, 0x00, 0x00, 0 x00, 0x00, 0x00, 0x00} };
42 - 83 -
43 84
44 /* 85 /*
45 * Multiple USB API backend support 86 * Multiple USB API backend support
46 diff --git a/msvc/config.h b/msvc/config.h 87 diff --git a/msvc/config.h b/msvc/config.h
47 index 43b4d4e..9ac6134 100644 88 index 43b4d4e..9ac6134 100644
48 --- a/msvc/config.h 89 --- a/msvc/config.h
49 +++ b/msvc/config.h 90 +++ b/msvc/config.h
50 @@ -19,3 +19,5 @@ 91 @@ -19,3 +19,5 @@
51 92
52 /* type of second poll() argument */ 93 /* type of second poll() argument */
53 #define POLL_NFDS_TYPE unsigned int 94 #define POLL_NFDS_TYPE unsigned int
54 + 95 +
55 +#include <Winsock2.h> 96 +#include <Winsock2.h>
OLDNEW
« no previous file with comments | « third_party/libusb/libusb/os/poll_windows.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698