From bf00e40c4bb4375919ddba071652c0c887358800 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 12 Apr 2014 00:11:02 +0000 Subject: [PATCH] Compilation fix for MinGW in GDI+ code. Don't use the XXXModeInvalid constants which are missing from MinGW headers for some reason. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76317 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/graphics.cpp | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/msw/graphics.cpp b/src/msw/graphics.cpp index 3a35d6a25f..3a4865dd19 100644 --- a/src/msw/graphics.cpp +++ b/src/msw/graphics.cpp @@ -1549,7 +1549,12 @@ bool wxGDIPlusContext::SetAntialiasMode(wxAntialiasMode antialias) if (m_antialias == antialias) return true; - SmoothingMode antialiasMode = SmoothingModeInvalid; + // MinGW currently doesn't provide InterpolationModeInvalid in its headers, + // so use our own definition. + static const SmoothingMode + wxSmoothingModeInvalid = static_cast(-1); + + SmoothingMode antialiasMode = wxSmoothingModeInvalid; switch (antialias) { case wxANTIALIAS_DEFAULT: @@ -1561,7 +1566,7 @@ bool wxGDIPlusContext::SetAntialiasMode(wxAntialiasMode antialias) break; } - wxCHECK_MSG( antialiasMode != SmoothingModeInvalid, false, + wxCHECK_MSG( antialiasMode != wxSmoothingModeInvalid, false, wxS("Unknown antialias mode") ); if ( m_context->SetSmoothingMode(antialiasMode) != Gdiplus::Ok ) @@ -1577,7 +1582,12 @@ bool wxGDIPlusContext::SetInterpolationQuality(wxInterpolationQuality interpolat if (m_interpolation == interpolation) return true; - InterpolationMode interpolationMode = InterpolationModeInvalid; + // MinGW currently doesn't provide InterpolationModeInvalid in its headers, + // so use our own definition. + static const InterpolationMode + wxInterpolationModeInvalid = static_cast(-1); + + InterpolationMode interpolationMode = wxInterpolationModeInvalid; switch (interpolation) { case wxINTERPOLATION_DEFAULT: @@ -1601,7 +1611,7 @@ bool wxGDIPlusContext::SetInterpolationQuality(wxInterpolationQuality interpolat break; } - wxCHECK_MSG( interpolationMode != InterpolationModeInvalid, false, + wxCHECK_MSG( interpolationMode != wxInterpolationModeInvalid, false, wxS("Unknown interpolation mode") ); if ( m_context->SetInterpolationMode(interpolationMode) != Gdiplus::Ok )