]> git.saurik.com Git - wxWidgets.git/commitdiff
Try to avoid accidental use of wxXmlNode in XRC handlers.
authorVadim Zeitlin <vadim@wxwidgets.org>
Wed, 24 Oct 2012 18:34:19 +0000 (18:34 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Wed, 24 Oct 2012 18:34:19 +0000 (18:34 +0000)
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

index 85b8a87722b07c510eeb36ff63b99dc6ec66c760..7ddca28eef4118c866f8a4e8d0dbe64573b23ea5 100644 (file)
 #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"