Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r73384 - trunk/boost
From: antoshkka_at_[hidden]
Date: 2011-07-26 14:51:39


Author: apolukhin
Date: 2011-07-26 14:51:39 EDT (Tue, 26 Jul 2011)
New Revision: 73384
URL: http://svn.boost.org/trac/boost/changeset/73384

Log:
Fixes #5732.

* fixes compilation errors pgi compiler
* fixes some bugs for MinGW compiler
Text files modified:
   trunk/boost/lexical_cast.hpp | 25 ++++++++++++++++++-------
   1 files changed, 18 insertions(+), 7 deletions(-)

Modified: trunk/boost/lexical_cast.hpp
==============================================================================
--- trunk/boost/lexical_cast.hpp (original)
+++ trunk/boost/lexical_cast.hpp 2011-07-26 14:51:39 EDT (Tue, 26 Jul 2011)
@@ -47,6 +47,10 @@
 #include <boost/detail/lcast_precision.hpp>
 #include <boost/detail/workaround.hpp>
 
+#ifdef __PGI
+#include <cwchar>
+#endif
+
 #ifndef BOOST_NO_STD_LOCALE
 # include <locale>
 #else
@@ -1134,7 +1138,7 @@
                 finish = start + sprintf(out,"%.*lg", static_cast<int>(boost::detail::lcast_get_precision<double >()), val );
                 return finish > start;
             }
-
+#ifndef __MINGW32__
             template <class T>
             bool shl_long_double(long double val,T* out)
             { using namespace std;
@@ -1142,6 +1146,7 @@
                 finish = start + sprintf(out,"%.*Lg", static_cast<int>(boost::detail::lcast_get_precision<long double >()), val );
                 return finish > start;
             }
+#endif
 
 #if (defined _MSC_VER)
 # pragma warning( pop )
@@ -1180,16 +1185,16 @@
                 return finish > start;
             }
 
+#ifndef __MINGW32__
             bool shl_long_double(long double val,wchar_t* out)
             { using namespace std;
                 if (put_inf_nan(start,finish,val)) return true;
- finish = start + swprintf(out,
-#ifndef __MINGW32__
- finish-start,
-#endif
- L"%.*Lg", static_cast<int>(boost::detail::lcast_get_precision<long double >()), val );
+ finish = start + swprintf(out,finish-start,
+ L"%.*Lg", static_cast<int>(boost::detail::lcast_get_precision<long double >()), val );
                 return finish > start;
             }
+ #endif
+
 #endif
 
 /************************************ OPERATORS << ( ... ) ********************************/
@@ -1242,7 +1247,13 @@
 #endif
             bool operator<<(float val) { return shl_float(val,start); }
             bool operator<<(double val) { return shl_double(val,start); }
- bool operator<<(long double val) { return shl_long_double(val,start); }
+ bool operator<<(long double val) {
+#ifndef __MINGW32__
+ return shl_long_double(val,start);
+#else
+ return shl_double(val,start);
+#endif
+ }
 
             template<class InStreamable>
             bool operator<<(const InStreamable& input) { return shl_input_streamable(input); }


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk