Fix a conflict with the Windows header files
In one of the Windows system header files, an "interface" macro is
defined as:
#define interface struct
This results in some very strange build errors when also including the
descriptor-private.h header file. That's because the dc_usb_params_t
struct has a member field named "interface":
typedef struct dc_usb_params_t {
unsigned int interface;
unsigned char endpoint_in;
unsigned char endpoint_out;
} dc_usb_params_t;
As a workaround, define the WIN32_LEAN_AND_MEAN macro before including
the windows.h header file. This excludes some less common Windows API
declarations, including the above one.
This commit is contained in:
parent
51b1ae925c
commit
7a4c5e919f
@ -29,6 +29,7 @@
|
||||
#include <string.h>
|
||||
|
||||
#ifdef _WIN32
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#define NOGDI
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
@ -21,6 +21,7 @@
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#define NOGDI
|
||||
#include <windows.h>
|
||||
|
||||
|
||||
@ -23,6 +23,7 @@
|
||||
#define DC_SOCKET_H
|
||||
|
||||
#ifdef _WIN32
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#define NOGDI
|
||||
#include <winsock2.h>
|
||||
#include <windows.h>
|
||||
|
||||
@ -26,6 +26,7 @@
|
||||
#include <stdlib.h>
|
||||
|
||||
#ifdef _WIN32
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#define NOGDI
|
||||
#include <windows.h>
|
||||
#else
|
||||
|
||||
@ -28,6 +28,7 @@
|
||||
|
||||
#ifdef HAVE_LIBUSB
|
||||
#ifdef _WIN32
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#define NOGDI
|
||||
#endif
|
||||
#include <libusb.h>
|
||||
|
||||
@ -29,6 +29,7 @@
|
||||
#include <pthread.h>
|
||||
#endif
|
||||
#ifdef _WIN32
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#define NOGDI
|
||||
#include <windows.h>
|
||||
#endif
|
||||
@ -43,6 +44,7 @@
|
||||
|
||||
#if defined(USE_LIBUSB)
|
||||
#ifdef _WIN32
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#define NOGDI
|
||||
#endif
|
||||
#include <libusb.h>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user