From e7bb37436ae3c256117016deb95269a0a02e2f46 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 6 Jul 2020 12:53:07 +0200 Subject: [PATCH] Warn if wxCairoContext(wxPrinterDC) ctor is not implemented Use an explicit #warning to explain the problem. This is more informative and avoids errors when building with -Werror (but also -Wno-error=cpp). --- src/generic/graphicc.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/generic/graphicc.cpp b/src/generic/graphicc.cpp index 244330580a..b98a62ecf7 100644 --- a/src/generic/graphicc.cpp +++ b/src/generic/graphicc.cpp @@ -1917,9 +1917,7 @@ wxCairoContext::wxCairoContext( wxGraphicsRenderer* renderer, const wxPrinterDC& // Since we switched from MM_ANISOTROPIC to MM_TEXT mapping mode // we have to apply rescaled DC's device origin to Cairo context. ApplyTransformFromDC(dc, Apply_scaled_dev_origin); -#endif // __WXMSW__ - -#ifdef __WXGTK20__ +#elif defined(__WXGTK20__) const wxDCImpl *impl = dc.GetImpl(); cairo_t* cr = static_cast(impl->GetCairoContext()); Init(cr ? cairo_reference(cr) : NULL); @@ -1930,6 +1928,9 @@ wxCairoContext::wxCairoContext( wxGraphicsRenderer* renderer, const wxPrinterDC& // Transfer transformation settings from source DC to Cairo context. ApplyTransformFromDC(dc); +#else + #warning "Constructing wxCairoContext from wxPrinterDC not implemented." + wxUnusedVar(dc); #endif } #endif