Fix a redefinition warning for the ERROR macro.

Apparantly, the windows wingdi.h header file already defines the
ERROR macro. By defining the NOGDI macro before including the
windows.h header file, we can prevent the wingdi.h file from being
included and thus avoid the warning. We don't need that header for
anything anyway.

Because the libusb header file includes the windows.h file
explicitly, it needs the same fix.
This commit is contained in:
Jef Driesen 2012-12-13 19:47:43 +01:00
parent f65f808b6c
commit 113d2e4706
4 changed files with 7 additions and 0 deletions

View File

@ -27,6 +27,9 @@
#include <stdlib.h> // malloc, free
#ifdef HAVE_LIBUSB
#ifdef _WIN32
#define NOGDI
#endif
#include <libusb-1.0/libusb.h>
#endif

View File

@ -25,6 +25,7 @@
#include <string.h>
#ifdef _WIN32
#define NOGDI
#include <windows.h>
#endif

View File

@ -22,6 +22,7 @@
#include <stdlib.h> // malloc, free
#include <stdio.h> // snprintf
#ifdef _WIN32
#define NOGDI
#include <winsock2.h>
#include <windows.h>
#include <af_irda.h>

View File

@ -20,6 +20,8 @@
*/
#include <stdlib.h>
#define NOGDI
#include <windows.h>
#include "serial.h"