From 23f891a92bddc38dce8c99674edd31281eaf7ca8 Mon Sep 17 00:00:00 2001 From: "arseny.kapoulkine@gmail.com" Date: Wed, 14 Mar 2012 04:21:26 +0000 Subject: Different versions of RWSTL have different headers; revert the previous change and instead introduce PUGIXML_NO_STL_FWDDECL macro (that disables forward declaration of STL classes, which is not compliant). git-svn-id: http://pugixml.googlecode.com/svn/trunk@857 99668b35-9821-0410-8761-19e4c4f06640 --- src/pugiconfig.hpp | 2 +- src/pugixml.hpp | 26 ++++++++++++-------------- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/src/pugiconfig.hpp b/src/pugiconfig.hpp index a5e96a3..8842180 100644 --- a/src/pugiconfig.hpp +++ b/src/pugiconfig.hpp @@ -32,7 +32,7 @@ // #define PUGIXML_FUNCTION __fastcall // to set calling conventions to all public functions to fastcall // In absence of PUGIXML_CLASS/PUGIXML_FUNCTION definitions PUGIXML_API is used instead -// Header-only version +// Uncomment this to switch to header-only version // #define PUGIXML_HEADER_ONLY // #include "pugixml.cpp" diff --git a/src/pugixml.hpp b/src/pugixml.hpp index efcc471..1400fb1 100644 --- a/src/pugixml.hpp +++ b/src/pugixml.hpp @@ -32,8 +32,13 @@ #ifndef PUGIXML_NO_STL // cstddef is needed so that we get the 'std' namespace declaration (STLport sometimes makes std a define) -#include +# include +# if defined(PUGIXML_NO_STL_FWDDECL) +# include +# include +# include +# else // Forward declarations for STL classes to reduce include dependencies namespace std { @@ -41,19 +46,11 @@ namespace std #ifdef __SUNPRO_CC // Sun C++ compiler has a bug which forces template argument names in forward declarations to be the same as in actual definitions -# ifndef _STLPORT_VERSION - template class allocator; - template struct char_traits; - template class basic_istream; - template class basic_ostream; - template class basic_string; -# else - template class allocator; - template struct char_traits; - template class basic_istream; - template class basic_ostream; - template class basic_string; -# endif + template class allocator; + template struct char_traits; + template class basic_istream; + template class basic_ostream; + template class basic_string; #else // Borland C++ compiler has a bug which forces template argument names in forward declarations to be the same as in actual definitions template class allocator; @@ -77,6 +74,7 @@ namespace std #endif } #endif +#endif // Macro for deprecated features #ifndef PUGIXML_DEPRECATED -- cgit v1.2.3