From cd9bc5fa836fdf196dc65f7f75631f80849eed1e Mon Sep 17 00:00:00 2001 From: "arseny.kapoulkine" Date: Tue, 25 May 2010 21:46:07 +0000 Subject: Added support for Sun C++ compiler git-svn-id: http://pugixml.googlecode.com/svn/trunk@452 99668b35-9821-0410-8761-19e4c4f06640 --- src/pugixml.hpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/pugixml.hpp') diff --git a/src/pugixml.hpp b/src/pugixml.hpp index 9b0eddd..f57dba2 100644 --- a/src/pugixml.hpp +++ b/src/pugixml.hpp @@ -21,12 +21,21 @@ namespace std { struct bidirectional_iterator_tag; +#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 + 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; template struct char_traits; template class basic_istream; template class basic_ostream; template class basic_string; +#endif // Digital Mars compiler has a bug which requires a forward declaration for explicit instantiation (otherwise type selection is messed up later, producing link errors) // Also note that we have to declare char_traits as a class here, since it's defined that way @@ -2330,6 +2339,15 @@ namespace std } #endif +#if !defined(PUGIXML_NO_STL) && defined(__SUNPRO_CC) +namespace std +{ + // Workarounds for (non-standard) iterator category detection + std::bidirectional_iterator_tag __iterator_category(const pugi::xml_node_iterator&); + std::bidirectional_iterator_tag __iterator_category(const pugi::xml_attribute_iterator&); +} +#endif + #endif /** -- cgit v1.2.3