summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2014-10-19 20:22:58 (GMT)
committerTobias Markmann <tm@ayena.de>2014-10-20 13:49:33 (GMT)
commit6b22dfcf59474dd016a0355a3102a1dd3692d92c (patch)
tree2b1fd33be433a91e81fee84fdc2bf1b52575d934 /3rdParty/Boost/src/boost/format/internals.hpp
parent38b0cb785fea8eae5e48fae56440695fdfd10ee1 (diff)
downloadswift-contrib-6b22dfcf59474dd016a0355a3102a1dd3692d92c.zip
swift-contrib-6b22dfcf59474dd016a0355a3102a1dd3692d92c.tar.bz2
Update Boost in 3rdParty to version 1.56.0.
This updates Boost in our 3rdParty directory to version 1.56.0. Updated our update.sh script to stop on error. Changed error reporting in SwiftTools/CrashReporter.cpp to SWIFT_LOG due to missing include of <iostream> with newer Boost. Change-Id: I4b35c77de951333979a524097f35f5f83d325edc
Diffstat (limited to '3rdParty/Boost/src/boost/format/internals.hpp')
-rw-r--r--3rdParty/Boost/src/boost/format/internals.hpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/3rdParty/Boost/src/boost/format/internals.hpp b/3rdParty/Boost/src/boost/format/internals.hpp
index b0d874a..1c67006 100644
--- a/3rdParty/Boost/src/boost/format/internals.hpp
+++ b/3rdParty/Boost/src/boost/format/internals.hpp
@@ -72,88 +72,89 @@ namespace detail {
argN_ignored = -3 // ignored directive. (no argument read)
};
typedef BOOST_IO_STD basic_ios<Ch, Tr> basic_ios;
typedef detail::stream_format_state<Ch, Tr> stream_format_state;
typedef ::std::basic_string<Ch, Tr, Alloc> string_type;
format_item(Ch fill) :argN_(argN_no_posit), fmtstate_(fill),
truncate_(max_streamsize()), pad_scheme_(0) {}
void reset(Ch fill);
void compute_states(); // sets states according to truncate and pad_scheme.
static std::streamsize max_streamsize() {
return (std::numeric_limits<std::streamsize>::max)();
}
// --- data ---
int argN_; //- argument number (starts at 0, eg : %1 => argN=0)
// negative values for items that don't process an argument
string_type res_; //- result of the formatting of this item
string_type appendix_; //- piece of string between this item and the next
stream_format_state fmtstate_;// set by parsing, is only affected by modify_item
std::streamsize truncate_;//- is set for directives like %.5s that ask truncation
unsigned int pad_scheme_;//- several possible padding schemes can mix. see pad_values
};
//--- Definitions ------------------------------------------------------------
// - stream_format_state:: -------------------------------------------------
template<class Ch, class Tr>
void stream_format_state<Ch,Tr>:: apply_on (basic_ios & os,
boost::io::detail::locale_t * loc_default) const {
+ // If a locale is available, set it first. "os.fill(fill_);" may chrash otherwise.
+#if !defined(BOOST_NO_STD_LOCALE)
+ if(loc_)
+ os.imbue(loc_.get());
+ else if(loc_default)
+ os.imbue(*loc_default);
+#else
+ (void) loc_default; // keep compiler quiet if we don't support locales
+#endif
// set the state of this stream according to our params
if(width_ != -1)
os.width(width_);
if(precision_ != -1)
os.precision(precision_);
if(fill_ != 0)
os.fill(fill_);
os.flags(flags_);
os.clear(rdstate_);
os.exceptions(exceptions_);
-#if !defined(BOOST_NO_STD_LOCALE)
- if(loc_)
- os.imbue(loc_.get());
- else if(loc_default)
- os.imbue(*loc_default);
-#else
- (void) loc_default; // keep compiler quiet if we don't support locales
-#endif
}
template<class Ch, class Tr>
void stream_format_state<Ch,Tr>:: set_by_stream(const basic_ios& os) {
// set our params according to the state of this stream
flags_ = os.flags();
width_ = os.width();
precision_ = os.precision();
fill_ = os.fill();
rdstate_ = os.rdstate();
exceptions_ = os.exceptions();
}
template<class Ch, class Tr, class T>
void apply_manip_body( stream_format_state<Ch, Tr>& self,
T manipulator) {
// modify our params according to the manipulator
basic_oaltstringstream<Ch, Tr> ss;
self.apply_on( ss );
ss << manipulator;
self.set_by_stream( ss );
}
template<class Ch, class Tr> inline
void stream_format_state<Ch,Tr>:: reset(Ch fill) {
// set our params to standard's default state. cf 27.4.4.1 of the C++ norm
width_=0; precision_=6;
fill_=fill; // default is widen(' '), but we cant compute it without the locale
flags_ = std::ios_base::dec | std::ios_base::skipws;
// the adjust_field part is left equal to 0, which means right.
exceptions_ = std::ios_base::goodbit;
rdstate_ = std::ios_base::goodbit;
}