From 113d2e4706698f7086e5499282ec958aa2de044f Mon Sep 17 00:00:00 2001 From: Jef Driesen Date: Thu, 13 Dec 2012 19:47:43 +0100 Subject: [PATCH] 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. --- src/atomics_cobalt.c | 3 +++ src/context.c | 1 + src/irda.c | 1 + src/serial_win32.c | 2 ++ 4 files changed, 7 insertions(+) diff --git a/src/atomics_cobalt.c b/src/atomics_cobalt.c index aa597fd..543a366 100644 --- a/src/atomics_cobalt.c +++ b/src/atomics_cobalt.c @@ -27,6 +27,9 @@ #include // malloc, free #ifdef HAVE_LIBUSB +#ifdef _WIN32 +#define NOGDI +#endif #include #endif diff --git a/src/context.c b/src/context.c index 0163a3c..344e4ee 100644 --- a/src/context.c +++ b/src/context.c @@ -25,6 +25,7 @@ #include #ifdef _WIN32 +#define NOGDI #include #endif diff --git a/src/irda.c b/src/irda.c index 476fa7e..4556256 100644 --- a/src/irda.c +++ b/src/irda.c @@ -22,6 +22,7 @@ #include // malloc, free #include // snprintf #ifdef _WIN32 + #define NOGDI #include #include #include diff --git a/src/serial_win32.c b/src/serial_win32.c index 4879c2d..fa4d00a 100644 --- a/src/serial_win32.c +++ b/src/serial_win32.c @@ -20,6 +20,8 @@ */ #include + +#define NOGDI #include #include "serial.h"