forked from boostorg/conversion
Fixes #6852 for wide characters (ISO C++ does not support the ‘%lg’ gnu_printf format fixed)
[SVN r78408]
This commit is contained in:
@@ -1354,8 +1354,11 @@ namespace boost {
|
||||
static bool shl_real_type(float val, wchar_t* begin, wchar_t*& end)
|
||||
{ using namespace std;
|
||||
if (put_inf_nan(begin, end, val)) return true;
|
||||
const double val_as_double = val;
|
||||
end = begin + swprintf(begin, end-begin,
|
||||
L"%.*g", static_cast<int>(boost::detail::lcast_get_precision<float >()), val );
|
||||
L"%.*g",
|
||||
static_cast<int>(boost::detail::lcast_get_precision<float >()),
|
||||
val_as_double );
|
||||
return end > begin;
|
||||
}
|
||||
|
||||
@@ -1363,7 +1366,7 @@ namespace boost {
|
||||
{ using namespace std;
|
||||
if (put_inf_nan(begin, end, val)) return true;
|
||||
end = begin + swprintf(begin, end-begin,
|
||||
L"%.*lg", static_cast<int>(boost::detail::lcast_get_precision<double >()), val );
|
||||
L"%.*g", static_cast<int>(boost::detail::lcast_get_precision<double >()), val );
|
||||
return end > begin;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user