From: Jonathan Wakely Date: Thu, 28 May 2015 16:27:46 +0000 (+0100) Subject: backport: re PR libstdc++/37522 (Incorrect vswprintf prototype breaks __to_xstring) X-Git-Tag: releases/gcc-4.9.3~125 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cae7590a8570d2d3c03a23711553570813b2e0b4;p=thirdparty%2Fgcc.git backport: re PR libstdc++/37522 (Incorrect vswprintf prototype breaks __to_xstring) Backport from mainline 2014-12-22 Jonathan Wakely PR libstdc++/37522 * include/bits/basic_string.h (stod, stof, stoi, stol, stold, stoll, stoul, stoull, to_string): Only use _GLIBCXX_HAVE_BROKEN_VSWPRINTF to guard definition of to_wstring. From-SVN: r223840 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 6ac5a4807793..4c34eb21cbc3 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,13 @@ +2015-05-28 Jonathan Wakely + + Backport from mainline + 2014-12-22 Jonathan Wakely + + PR libstdc++/37522 + * include/bits/basic_string.h (stod, stof, stoi, stol, stold, stoll, + stoul, stoull, to_string): Only use _GLIBCXX_HAVE_BROKEN_VSWPRINTF + to guard definition of to_wstring. + 2015-05-22 David Edelsohn Backport from mainline diff --git a/libstdc++-v3/include/bits/basic_string.h b/libstdc++-v3/include/bits/basic_string.h index 89189656bcda..a629390c7896 100644 --- a/libstdc++-v3/include/bits/basic_string.h +++ b/libstdc++-v3/include/bits/basic_string.h @@ -2844,8 +2844,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION _GLIBCXX_END_NAMESPACE_VERSION } // namespace -#if ((__cplusplus >= 201103L) && defined(_GLIBCXX_USE_C99) \ - && !defined(_GLIBCXX_HAVE_BROKEN_VSWPRINTF)) +#if __cplusplus >= 201103L && defined(_GLIBCXX_USE_C99) #include @@ -2995,6 +2994,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION stold(const wstring& __str, size_t* __idx = 0) { return __gnu_cxx::__stoa(&std::wcstold, "stold", __str.c_str(), __idx); } +#ifndef _GLIBCXX_HAVE_BROKEN_VSWPRINTF // DR 1261. inline wstring to_wstring(int __val) @@ -3056,6 +3056,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION return __gnu_cxx::__to_xstring(&std::vswprintf, __n, L"%Lf", __val); } +#endif // _GLIBCXX_HAVE_BROKEN_VSWPRINTF #endif _GLIBCXX_END_NAMESPACE_VERSION