Handle showpos bug in gcc libstc++ 4.2.
--- a/src/core/model/int64x64.cc Thu Aug 01 09:35:13 2013 -0700
+++ b/src/core/model/int64x64.cc Thu Aug 01 16:26:07 2013 -0700
@@ -39,7 +39,24 @@
std::ostream &operator << (std::ostream &os, const int64x64_t &value)
{
int64_t hi = value.GetHigh ();
- os << std::showpos << hi << std::noshowpos << ".";
+
+ // Save stream format flags
+ std::ios_base::fmtflags ff = os.flags ();
+
+ { // See bug 1737: gcc libstc++ 4.2 bug
+ if (hi == 0)
+ {
+ os << '+';
+ }
+ else
+ {
+ os << std::showpos;
+ }
+ }
+
+ os << hi << ".";
+ os.flags (ff); // Restore stream flags
+
uint64_t low = value.GetLow ();
uint8_t msd = MostSignificantDigit (~((uint64_t)0));
do