From 713a7ab8950b6ea7b7f1ec3d26f70b0bc35b0774 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 26 Sep 2018 14:47:45 +0200 Subject: [PATCH] Move wxUSE_ENH_METAFILE check inside wx/msw/enhmeta.h itself This is more consistent with the other headers, which are safe to include even when the corresponding feature is turned off. Also remove the now redundant wxUSE_ENH_METAFILE checks in the source code including this header. See https://github.com/wxWidgets/wxWidgets/pull/951 --- include/wx/msw/enhmeta.h | 6 ++++++ src/common/graphcmn.cpp | 2 -- src/generic/graphicc.cpp | 2 +- src/msw/graphics.cpp | 4 +--- src/msw/printwin.cpp | 5 ++--- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/include/wx/msw/enhmeta.h b/include/wx/msw/enhmeta.h index 74c65ddb2c..bd6c5f729e 100644 --- a/include/wx/msw/enhmeta.h +++ b/include/wx/msw/enhmeta.h @@ -11,6 +11,10 @@ #ifndef _WX_MSW_ENHMETA_H_ #define _WX_MSW_ENHMETA_H_ +#include "wx/defs.h" + +#if wxUSE_ENH_METAFILE + #include "wx/dc.h" #include "wx/gdiobj.h" @@ -192,4 +196,6 @@ protected: #endif // wxUSE_DATAOBJ +#endif // wxUSE_ENH_METAFILE + #endif // _WX_MSW_ENHMETA_H_ diff --git a/src/common/graphcmn.cpp b/src/common/graphcmn.cpp index fc79fbe761..fc0e6ab894 100644 --- a/src/common/graphcmn.cpp +++ b/src/common/graphcmn.cpp @@ -32,10 +32,8 @@ #endif #ifdef __WXMSW__ -#if wxUSE_ENH_METAFILE #include "wx/msw/enhmeta.h" #endif -#endif #include "wx/private/graphics.h" diff --git a/src/generic/graphicc.cpp b/src/generic/graphicc.cpp index ce232060ad..7ed04b4bd4 100644 --- a/src/generic/graphicc.cpp +++ b/src/generic/graphicc.cpp @@ -41,7 +41,7 @@ bool wxCairoInit(); #include "wx/private/graphics.h" #include "wx/rawbmp.h" #include "wx/vector.h" -#if defined(__WXMSW__) && wxUSE_ENH_METAFILE +#ifdef __WXMSW__ #include "wx/msw/enhmeta.h" #endif diff --git a/src/msw/graphics.cpp b/src/msw/graphics.cpp index 78d4a36e68..04cca9d732 100644 --- a/src/msw/graphics.cpp +++ b/src/msw/graphics.cpp @@ -42,9 +42,7 @@ #include "wx/private/graphics.h" #include "wx/msw/wrapgdip.h" #include "wx/msw/dc.h" -#if wxUSE_ENH_METAFILE - #include "wx/msw/enhmeta.h" -#endif +#include "wx/msw/enhmeta.h" #include "wx/dcgraph.h" #include "wx/rawbmp.h" diff --git a/src/msw/printwin.cpp b/src/msw/printwin.cpp index 48e61003c1..b608aeacec 100644 --- a/src/msw/printwin.cpp +++ b/src/msw/printwin.cpp @@ -48,9 +48,8 @@ #include "wx/msw/printdlg.h" #include "wx/msw/private.h" #include "wx/msw/dcprint.h" -#if wxUSE_ENH_METAFILE - #include "wx/msw/enhmeta.h" -#endif +#include "wx/msw/enhmeta.h" + #include // ---------------------------------------------------------------------------