From eeac2326b044ac4c2f794cd1de93e07295bd3b6b Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 17 Jun 2011 21:53:22 +0000 Subject: [PATCH] Avoid problems with conflicting UINT16 definitions in Cygwin headers. 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 | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/msw/gdiplus.cpp b/src/msw/gdiplus.cpp index df688b1135..7241400699 100644 --- a/src/msw/gdiplus.cpp +++ b/src/msw/gdiplus.cpp @@ -36,6 +36,14 @@ #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 // ---------------------------------------------------------------------------- -- 2.50.0