mirror of
https://github.com/boostorg/serialization.git
synced 2026-02-23 16:02:13 +00:00
fixing codecvt for libstc++ broke things for libc++
This should work for everything
This commit is contained in:
@@ -69,7 +69,11 @@ public:
|
||||
m_locale(s.getloc())
|
||||
{}
|
||||
~basic_ios_locale_saver(){
|
||||
// libc++ doesn't support std::[w]ostream.sync()
|
||||
// but gcc will throw an error if sync() isn't invoked
|
||||
#ifndef _LIBCPP_VERSION
|
||||
m_ios.sync();
|
||||
#endif
|
||||
m_ios.imbue(m_locale);
|
||||
}
|
||||
private:
|
||||
|
||||
@@ -119,9 +119,10 @@ basic_text_iprimitive<IStream>::basic_text_iprimitive(
|
||||
locale_saver(is)
|
||||
{
|
||||
if(! no_codecvt){
|
||||
is.imbue(archive_locale);
|
||||
is_.sync();
|
||||
is_.imbue(archive_locale);
|
||||
}
|
||||
is >> std::noboolalpha;
|
||||
is_ >> std::noboolalpha;
|
||||
}
|
||||
#else
|
||||
{}
|
||||
|
||||
@@ -93,9 +93,14 @@ basic_text_oprimitive<OStream>::basic_text_oprimitive(
|
||||
locale_saver(os)
|
||||
{
|
||||
if(! no_codecvt){
|
||||
os.imbue(archive_locale);
|
||||
// libc++ doesn't support std::wostream.sync()
|
||||
// but gcc will throw an error if sync() isn't invoked
|
||||
#ifndef _LIBCPP_VERSION
|
||||
os_.sync();
|
||||
#endif
|
||||
os_.imbue(archive_locale);
|
||||
}
|
||||
os << std::noboolalpha;
|
||||
os_ << std::noboolalpha;
|
||||
}
|
||||
#else
|
||||
{}
|
||||
|
||||
@@ -163,8 +163,8 @@ xml_wiarchive_impl<Archive>::xml_wiarchive_impl(
|
||||
is_.getloc(),
|
||||
new boost::archive::detail::utf8_codecvt_facet
|
||||
);
|
||||
is.sync();
|
||||
is.imbue(l);
|
||||
is_.sync();
|
||||
is_.imbue(l);
|
||||
}
|
||||
if(0 == (flags & no_header))
|
||||
init();
|
||||
|
||||
@@ -125,8 +125,12 @@ xml_woarchive_impl<Archive>::xml_woarchive_impl(
|
||||
os_.getloc(),
|
||||
new boost::archive::detail::utf8_codecvt_facet
|
||||
);
|
||||
os.sync();
|
||||
os.imbue(l);
|
||||
// libc++ doesn't support std::[w]ostream.sync()
|
||||
// but gcc will throw an error if sync() isn't invoked
|
||||
#ifndef _LIBCPP_VERSION
|
||||
os_.sync();
|
||||
#endif
|
||||
os_.imbue(l);
|
||||
}
|
||||
if(0 == (flags & no_header))
|
||||
this->init();
|
||||
|
||||
Reference in New Issue
Block a user