[Spice-devel] [PATCH 2/6] mingw: #ifdef unneeded #define in common.h

Christophe Fergeau cfergeau at redhat.com
Wed Feb 29 10:01:55 PST 2012


common.h has some #define when doing win32 build to workaround a few
missing functions on these systems. However, since mingw32 has some
of these, this causes either warnings about redefining preprocessor
symbols or wreak havoc in mingw headers trying to use these symbols.
This commit wraps these symbols in an #ifndef __MINGW32__ to avoid
using them on this platform.
---
 client/common.h |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/client/common.h b/client/common.h
index 268057a..e9a7ea8 100644
--- a/client/common.h
+++ b/client/common.h
@@ -44,6 +44,7 @@
 #ifdef __GNUC__
 #define UNICODE 1
 #define _UNICODE 1
+#if !defined __MINGW32__
 #define WINVER 0x0501
 #define swprintf_s(_str, _len, _fmt, ...) \
     swprintf(_str, _fmt, ## __VA_ARGS__)
@@ -51,6 +52,7 @@
     vsnprintf(_str, _len2, _fmt, _valist)
 #define _ftime_s(_t) _ftime(_t)
 #endif
+#endif
 #include <winsock2.h>
 #include <windows.h>
 
-- 
1.7.7.6



More information about the Spice-devel mailing list