From 19f87dbe255b5e85236547bfb4e20ad310644373 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 24 Oct 2012 18:34:19 +0000 Subject: [PATCH] Try to avoid accidental use of wxXmlNode in XRC handlers. Now that the handlers can be defined outside of the XRC library, we can't use wxXmlNode in them because this would create an (unsatisfied) link dependency on the xml library. To avoid this happening accidentally, don't include wx/xml/xml.h from the XRC header, unless building the xrc library itself. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72756 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/xrc/xmlres.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/include/wx/xrc/xmlres.h b/include/wx/xrc/xmlres.h index 85b8a87722..7ddca28eef 100644 --- a/include/wx/xrc/xmlres.h +++ b/include/wx/xrc/xmlres.h @@ -29,7 +29,17 @@ #include "wx/animate.h" #include "wx/vector.h" -#include "wx/xml/xml.h" +// We want to prevent the handlers defined outside of the XRC library from ever +// using wxXmlNode directly as this would result in linking errors as the other +// libraries don't link with the xml one (only xrc does). So do not include +// this header unless building xrc itself (where a lot of code does use +// wxXmlNode directly). +#ifdef WXMAKINGDLL_XRC + #include "wx/xml/xml.h" +#else + class WXDLLIMPEXP_FWD_XML wxXmlDocument; + class WXDLLIMPEXP_FWD_XML wxXmlNode; +#endif #include "wx/xrc/xmlreshandler.h" -- 2.45.2