summaryrefslogtreecommitdiff
path: root/Xwinsock.h
diff options
context:
space:
mode:
authorYaakov Selkowitz <yselkowitz@users.sourceforge.net>2012-10-22 02:52:44 -0500
committerYaakov Selkowitz <yselkowitz@users.sourceforge.net>2012-10-29 21:46:01 -0500
commitc0dd615fddb6fa487d1a914c6928f3843489725e (patch)
tree2950d4f6906a2c7370783063e3361725dfb341e5 /Xwinsock.h
parentc0d697ffddf14117541e7021c3b80b25c4536f6f (diff)
Adjust wrapping to work with MinGW-w64 headers
Adjust <windows.h> wrapping to work with MinGW-w64 as well MinGW.org headers, which define BOOL in a different way. Add some more comments on what we doing here. v2: Make similar changes to Xwinsock.h, used for MinGW but not Cygwin. Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Diffstat (limited to 'Xwinsock.h')
-rw-r--r--Xwinsock.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/Xwinsock.h b/Xwinsock.h
index e6ca7b5..a81dd7a 100644
--- a/Xwinsock.h
+++ b/Xwinsock.h
@@ -39,7 +39,13 @@ The Open Group.
# undef XFree86Server
#endif
-#define BOOL wBOOL
+/*
+ * mingw-w64 headers define BOOL as a typedef, protecting against macros
+ * mingw.org headers define BOOL in terms of WINBOOL
+ * ... so try to come up with something which works with both :-)
+ */
+#define _NO_BOOL_TYPEDEF
+#define BOOL WINBOOL
#define INT32 wINT32
#undef Status
#define Status wStatus
@@ -58,6 +64,12 @@ The Open Group.
#undef RT_FONT
#undef RT_CURSOR
+/*
+ * Older version of this header used to name the windows API bool type wBOOL,
+ * rather than more standard name WINBOOL
+ */
+#define wBOOL WINBOOL
+
#ifdef _XFree86Server
# define XFree86Server
# undef _XFree86Server