#ifndef WX_PRECOMP
#include "wx/cpp.h"
+ #include "wx/log.h"
#include "wx/module.h"
#include "wx/string.h"
#endif // WX_PRECOMP
#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
// ----------------------------------------------------------------------------
#undef wxDECL_GDIPLUS_FUNC_TYPE
+// Special hack for w32api headers that reference this variable which is
+// normally defined in w32api-specific gdiplus.lib but as we don't link with it
+// and load gdiplus.dll dynamically, it's not defined in our case resulting in
+// linking errors -- so just provide it ourselves, it doesn't matter where it
+// is and if Cygwin headers are modified to not use it in the future, it's not
+// a big deal neither, we'll just have an unused pointer.
+#if defined(__CYGWIN__) || defined(__MINGW32__)
+void *_GdipStringFormatCachedGenericTypographic = NULL;
+#endif // __CYGWIN__ || __MINGW32__
+
} // extern "C"
// ============================================================================
// we're prepared to handler errors so suppress log messages about them
wxLogNull noLog;
- wxDynamicLibrary dllGdip(_T("gdiplus.dll"), wxDL_VERBATIM);
+ wxDynamicLibrary dllGdip(wxT("gdiplus.dll"), wxDL_VERBATIM);
if ( !dllGdip.IsLoaded() )
return false;
return false;
#define wxLOAD_GDIPLUS_FUNC(name, params, args) \
- wxDO_LOAD_FUNC(name, _T("Gdiplus") wxSTRINGIZE_T(name))
+ wxDO_LOAD_FUNC(name, wxT("Gdiplus") wxSTRINGIZE_T(name))
wxFOR_ALL_GDIPLUS_FUNCNAMES(wxLOAD_GDIPLUS_FUNC)
#undef wxLOAD_GDIPLUS_FUNC
#define wxLOAD_GDIP_FUNC(name, params, args) \
- wxDO_LOAD_FUNC(name, _T("Gdip") wxSTRINGIZE_T(name))
+ wxDO_LOAD_FUNC(name, wxT("Gdip") wxSTRINGIZE_T(name))
wxFOR_ALL_GDIP_FUNCNAMES(wxLOAD_GDIP_FUNC)