Fixes #6852 for wide characters (ISO C++ does not support the ‘%lg’ gnu_printf format fixed)

[SVN r78408]
This commit is contained in:
Antony Polukhin
2012-05-10 17:39:46 +00:00
parent d30dd9e3c8
commit bb46dbc46c

View File

@@ -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;
}