This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Enable libstdc++ numeric conversions on Cygwin
- From: Jonathan Wakely <jwakely at redhat dot com>
- To: Christophe Lyon <christophe dot lyon at linaro dot org>
- Cc: Jennifer Yao <jenny dot hyphen dot fa at gmail dot com>, "libstdc++ at gcc dot gnu dot org" <libstdc++ at gcc dot gnu dot org>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, Andreas Tobler <andreast-list at fgznet dot ch>
- Date: Sun, 15 Nov 2015 11:14:28 +0000
- Subject: Re: [PATCH] Enable libstdc++ numeric conversions on Cygwin
- Authentication-results: sourceware.org; auth=none
- References: <CAPQfdh=Kshcq=Eg5EV9rpho=Q0USrGgODPoLzSLuvK+5D6LGeA at mail dot gmail dot com> <CAPQfdhmMGJeb-tq29jTheoo5jUaeiFzcycWFTrpShRE-kPftGw at mail dot gmail dot com> <CAPQfdh=uOjLzi60Dnd0Dd1ycJUDqMWQBCv1aRAGBP97DSUS3+Q at mail dot gmail dot com> <20151112114049 dot GY2937 at redhat dot com> <20151112133947 dot GA2937 at redhat dot com> <20151113145219 dot GQ2937 at redhat dot com> <CAKdteObx+-EmP+zeF8vp3diy7Y_52eR+=9H4=kNowJAa=ZnoCA at mail dot gmail dot com> <20151114163223 dot GE2937 at redhat dot com> <CAKdteOZfHT5EDt6U7i3ym6HNXXkgzJMWwm42BUGhjpbNqXhpog at mail dot gmail dot com>
On 15/11/15 09:58 +0100, Christophe Lyon wrote:
Ha, and my newlib copy is not very recent, it's from Oct 30th 2013:
maybe it's too old?
The autoconf checks should handle old versions as well as new.
The problem is I didn't change a defined(_GLIBCXX_USE_C99_WCHAR) to
just test its value, rather than whether it's defined.
As I added to include/bits/c++config on Friday:
// N.B. these _GLIBCXX_USE_C99_XXX macros are defined unconditionally
// so they should be tested with #if not with #ifdef.
Fixed with this patch, committed to trunk.
commit 8c33b5d8510378148bdac7247fd99b1f70eec04f
Author: Jonathan Wakely <jwakely@redhat.com>
Date: Sun Nov 15 11:03:54 2015 +0000
PR libstdc++/68353 fix _GLIBCXX_USE_C99_WCHAR test
PR libstdc++/68353
* include/bits/basic_string.h: Test value of _GLIBCXX_USE_C99_WCHAR
not whether it is defined.
* include/ext/vstring.h: Likewise.
diff --git a/libstdc++-v3/include/bits/basic_string.h b/libstdc++-v3/include/bits/basic_string.h
index b3853cd..e7f965e 100644
--- a/libstdc++-v3/include/bits/basic_string.h
+++ b/libstdc++-v3/include/bits/basic_string.h
@@ -5503,7 +5503,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
}
#endif // _GLIBCXX_USE_C99_STDIO
-#if defined(_GLIBCXX_USE_WCHAR_T) && defined(_GLIBCXX_USE_C99_WCHAR)
+#if defined(_GLIBCXX_USE_WCHAR_T) && _GLIBCXX_USE_C99_WCHAR
inline int
stoi(const wstring& __str, size_t* __idx = 0, int __base = 10)
{ return __gnu_cxx::__stoa<long, int>(&std::wcstol, "stoi", __str.c_str(),
diff --git a/libstdc++-v3/include/ext/vstring.h b/libstdc++-v3/include/ext/vstring.h
index 8732bd3..529e4f3 100644
--- a/libstdc++-v3/include/ext/vstring.h
+++ b/libstdc++-v3/include/ext/vstring.h
@@ -2794,7 +2794,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
}
#endif // _GLIBCXX_USE_C99_STDIO
-#if defined(_GLIBCXX_USE_WCHAR_T) && defined(_GLIBCXX_USE_C99_WCHAR)
+#if defined(_GLIBCXX_USE_WCHAR_T) && _GLIBCXX_USE_C99_WCHAR
inline int
stoi(const __wvstring& __str, std::size_t* __idx = 0, int __base = 10)
{ return __gnu_cxx::__stoa<long, int>(&std::wcstol, "stoi", __str.c_str(),