Handle showpos bug in gcc libstc++ 4.2.
authorPeter D. Barnes, Jr. <barnes26@llnl.gov>
Wed, 14 Aug 2013 16:55:47 -0700
changeset 10175 d7b91afc71c6
parent 10174 09eca1533421
child 10176 73dfb0c88ed6
Handle showpos bug in gcc libstc++ 4.2.
src/core/model/time.cc
--- a/src/core/model/time.cc	Wed Aug 14 16:55:06 2013 -0700
+++ b/src/core/model/time.cc	Wed Aug 14 16:55:47 2013 -0700
@@ -323,7 +323,17 @@
   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;
 }