]> git.saurik.com Git - wxWidgets.git/commitdiff
Avoid problems with conflicting UINT16 definitions in Cygwin headers.
authorVadim Zeitlin <vadim@wxwidgets.org>
Fri, 17 Jun 2011 21:53:22 +0000 (21:53 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Fri, 17 Jun 2011 21:53:22 +0000 (21:53 +0000)
UINT16 is incorrectly defined inside Gdiplus namespace in w32api gdiplus.h
used by Cygwin and MinGW resulting in compilation errors about ambiguous
symbols.

Fix this by forcefully redefining UINT16 in our own code.

Closes #13113.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67970 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/gdiplus.cpp

index df688b1135f92e77c2a3f1c9252475d191baf8b4..724140069953d5adb06c5689d97112f91c5d125a 100644 (file)
 
 #include "wx/msw/wrapgdip.h"
 
+// w32api headers used by both MinGW and Cygwin wrongly define UINT16 inside
+// Gdiplus namespace in gdiplus.h which results in ambiguity errors when using
+// this type as UINT16 is also defined in global scope by windows.h (or rather
+// basetsd.h included from it), so we redefine it to work around this problem.
+#if defined(__CYGWIN__) || defined(__MINGW32__)
+    #define UINT16 unsigned short
+#endif
+
 // ----------------------------------------------------------------------------
 // helper macros
 // ----------------------------------------------------------------------------