summaryrefslogtreecommitdiff
path: root/src/pugixml.hpp
diff options
context:
space:
mode:
authorarseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640>2010-11-12 19:28:51 +0000
committerarseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640>2010-11-12 19:28:51 +0000
commit9eae52a7cdfb6c0d25c89bd703e6f7f8bb7bb1cb (patch)
treed94d2e9f93a3872960232f13ed53c90e9617e60c /src/pugixml.hpp
parenta049c2db1d9741b3a162e4789f94d711858a0927 (diff)
Improved STLport support (now code compiles fine if STLport is in its own namespace and does #define std), fixed AirPlay SDK compilation
git-svn-id: http://pugixml.googlecode.com/svn/trunk@796 99668b35-9821-0410-8761-19e4c4f06640
Diffstat (limited to 'src/pugixml.hpp')
-rw-r--r--src/pugixml.hpp26
1 files changed, 19 insertions, 7 deletions
diff --git a/src/pugixml.hpp b/src/pugixml.hpp
index 78959ac..8e8f3e1 100644
--- a/src/pugixml.hpp
+++ b/src/pugixml.hpp
@@ -16,7 +16,19 @@
#include "pugiconfig.hpp"
+// Include stddef.h for size_t and ptrdiff_t
+#include <stddef.h>
+
+// Include exception header for XPath
+#if !defined(PUGIXML_NO_XPATH) && !defined(PUGIXML_NO_EXCEPTIONS)
+# include <exception>
+#endif
+
#ifndef PUGIXML_NO_STL
+// cstddef is needed so that we get the 'std' namespace declaration (STLport sometimes makes std a define)
+#include <cstddef>
+
+// Forward declarations for STL classes to reduce include dependencies
namespace std
{
struct bidirectional_iterator_tag;
@@ -31,7 +43,14 @@ namespace std
#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;
+
+ // STLport defines char_traits as a class instead of a struct
+# ifdef _STLPORT_VERSION
+ template <class _Ty> class char_traits;
+# else
template <class _Ty> struct char_traits;
+# endif
+
template <class _Elem, class _Traits> class basic_istream;
template <class _Elem, class _Traits> class basic_ostream;
template <class _Elem, class _Traits, class _Ax> class basic_string;
@@ -56,11 +75,6 @@ namespace std
# endif
#endif
-// Include exception header for XPath
-#if !defined(PUGIXML_NO_XPATH) && !defined(PUGIXML_NO_EXCEPTIONS)
-# include <exception>
-#endif
-
// If no API is defined, assume default
#ifndef PUGIXML_API
# define PUGIXML_API
@@ -76,8 +90,6 @@ namespace std
# define PUGIXML_FUNCTION PUGIXML_API
#endif
-#include <stddef.h>
-
// Character interface macros
#ifdef PUGIXML_WCHAR_MODE
# define PUGIXML_TEXT(t) L ## t