From eba69d2728c5c9119d992cf33bfff9422fbed45a Mon Sep 17 00:00:00 2001 From: "Peter D. Barnes, Jr." Date: Wed, 14 Aug 2013 16:55:47 -0700 Subject: [PATCH] Handle showpos bug in gcc libstc++ 4.2. --- src/core/model/time.cc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/core/model/time.cc b/src/core/model/time.cc index ce8e9de6f..d95433238 100644 --- a/src/core/model/time.cc +++ b/src/core/model/time.cc @@ -323,7 +323,17 @@ operator<< (std::ostream& os, const Time & time) int64_t v = time.ToInteger (res); std::ios_base::fmtflags ff = os.flags (); - os << std::showpos << v << ".0" << unit; + { // See bug 1737: gcc libstc++ 4.2 bug + if (v == 0) + { + os << '+'; + } + else + { + os << std::showpos; + } + } + os << v << ".0" << unit; os.flags (ff); // Restore stream flags return os; }