diff options
Diffstat (limited to 'boost/archive/impl/xml_woarchive_impl.ipp')
-rw-r--r-- | boost/archive/impl/xml_woarchive_impl.ipp | 42 |
1 files changed, 13 insertions, 29 deletions
diff --git a/boost/archive/impl/xml_woarchive_impl.ipp b/boost/archive/impl/xml_woarchive_impl.ipp index 6092a91524..1e5139bc40 100644 --- a/boost/archive/impl/xml_woarchive_impl.ipp +++ b/boost/archive/impl/xml_woarchive_impl.ipp @@ -29,8 +29,8 @@ namespace std{ } // namespace std #endif +#include <boost/archive/xml_woarchive.hpp> #include <boost/serialization/throw_exception.hpp> -#include <boost/serialization/pfto.hpp> #include <boost/archive/iterators/xml_escape.hpp> #include <boost/archive/iterators/wchar_from_mb.hpp> @@ -38,14 +38,6 @@ namespace std{ #include <boost/archive/iterators/dataflow_exception.hpp> #include <boost/archive/add_facet.hpp> -#ifndef BOOST_NO_CXX11_HDR_CODECVT - #include <codecvt> - namespace boost { namespace archive { namespace detail { - typedef std::codecvt_utf8<wchar_t> utf8_codecvt_facet; - } } } -#else - #include <boost/archive/detail/utf8_codecvt_facet.hpp> -#endif namespace boost { namespace archive { @@ -136,31 +128,23 @@ xml_woarchive_impl<Archive>::xml_woarchive_impl( // transforms (such as one to many transforms from getting // mixed up. if(0 == (flags & no_codecvt)){ - boost::archive::detail::utf8_codecvt_facet *pfacet; - #if defined(__SGI_STL_PORT) - // Unfortunately, STLPort doesn't respect b) above - // so the restoration of the original archive locale done by - // the locale_saver doesn't get processed, - // before the current one is destroyed. - // so the codecvt doesn't get replaced with the orginal - // so closing the stream invokes codecvt::do_unshift - // so it crashes because the corresponding locale that contained - // the codecvt isn't around any more. - // we can hack around this by using a static codecvt that never - // gets destroyed. - static boost::archive::detail::utf8_codecvt_facet - facet(static_cast<size_t>(1)); - pfacet = & facet; - #else - pfacet = new boost::archive::detail::utf8_codecvt_facet; - #endif - archive_locale.reset(add_facet(os_.getloc(), pfacet)); - os.imbue(* archive_locale); + archive_locale.reset( + add_facet( + os_.getloc(), + new boost::archive::detail::utf8_codecvt_facet + ) + ); + //os.imbue(* archive_locale); } if(0 == (flags & no_header)) this->init(); } +template<class Archive> +BOOST_WARCHIVE_DECL(BOOST_PP_EMPTY()) +xml_woarchive_impl<Archive>::~xml_woarchive_impl(){ +} + } // namespace archive } // namespace boost |