This is the mail archive of the
mailing list for the libstdc++ project.
Re: Fwd: [PATCH] Enable libstdc++ numeric conversions on Cygwin
- From: Jonathan Wakely <jwakely at redhat dot com>
- To: Jennifer Yao <jenny dot hyphen dot fa at gmail dot com>
- Cc: libstdc++ at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Fri, 18 Sep 2015 16:49:17 +0100
- Subject: Re: Fwd: [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>
On 18/09/15 11:17 -0400, Jennifer Yao wrote:
A number of functions in libstdc++ are guarded by the _GLIBCXX_USE_C99
preprocessor macro, which is only defined on systems that pass all of
the checks for a large set of C99 functions. Consequently, on systems
which lack any of the required C99 facilities (e.g. Cygwin, which
lacks some C99 complex math functions), the numeric conversion
functions (std::stoi(), std::stol(), std::to_string(), etc.) are not
definedâa rather silly outcome, as none of the numeric conversion
functions are implemented using C99 math functions.
This patch enables numeric conversion functions on the aforementioned
systems by splitting the checks for C99 support and defining several
new macros (_GLIBCXX_USE_C99_STDIO, _GLIBCXX_USE_C99_STDLIB, and
_GLIBCXX_USE_C99_WCHAR), which replace the use of _GLIBCXX_USE_C99 in
#if conditionals where appropriate.
Awesome! This has been on my TODO list for ages, but I've not made
much progress. I *definitely* want to see this change happen, but
there are some legal prerequisites that need to be met before that can
Do you already have a copyright assignment for GCC?
If not, would you be willing to complete one?
THanks for doing this work, it will help several other platforms, not
N.B. I don't see a patch attached to your mail, but that's not a
problem for now as I don't want to look at it until I know the status
of your copyright assignment (if we don't end up using your patch and
I do it myself then I don't want to plagiarise your work!)