summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorarseny.kapoulkine@gmail.com <arseny.kapoulkine@gmail.com@99668b35-9821-0410-8761-19e4c4f06640>2012-03-14 04:21:26 +0000
committerarseny.kapoulkine@gmail.com <arseny.kapoulkine@gmail.com@99668b35-9821-0410-8761-19e4c4f06640>2012-03-14 04:21:26 +0000
commit23f891a92bddc38dce8c99674edd31281eaf7ca8 (patch)
tree3a6e3052dc51cb17bc8958cbb57150ad785d8f5a
parentcf779955d9c77a35eb50296c7d00306a8900c828 (diff)
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
-rw-r--r--src/pugiconfig.hpp2
-rw-r--r--src/pugixml.hpp26
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 <cstddef>
+# include <cstddef>
+# if defined(PUGIXML_NO_STL_FWDDECL)
+# include <iterator>
+# include <iosfwd>
+# include <string>
+# 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 T> class allocator;
- template <class charT> struct char_traits;
- template <class charT, class traits > class basic_istream;
- template <class charT, class traits > class basic_ostream;
- template <class charT, class traits, class Allocator> class basic_string;
-# else
- template <class _T> class allocator;
- template <class _charT> struct char_traits;
- template <class _charT, class _Traits> class basic_istream;
- template <class _charT, class _Traits> class basic_ostream;
- template <class _charT, class _Traits, class _Allocator> class basic_string;
-# endif
+ template <class _T> class allocator;
+ template <class _charT> struct char_traits;
+ template <class _charT, class _Traits> class basic_istream;
+ template <class _charT, class _Traits> class basic_ostream;
+ template <class _charT, class _Traits, class _Allocator> 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 _Ty> class allocator;
@@ -77,6 +74,7 @@ namespace std
#endif
}
#endif
+#endif
// Macro for deprecated features
#ifndef PUGIXML_DEPRECATED