]> git.ipfire.org Git - thirdparty/gcc.git/commit
libstdc++: Check autoconf macros for strtof and strtold [PR110653]
authorJonathan Wakely <jwakely@redhat.com>
Thu, 13 Jul 2023 09:44:57 +0000 (10:44 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Wed, 19 Jul 2023 10:03:31 +0000 (11:03 +0100)
commit58303d42809f0e01f23262f592d37943f7703f71
tree464e441812242893c5e468b7a0a13db32385a270
parent85da0b40538fb0d17d89de1e7905984668e3dfef
libstdc++: Check autoconf macros for strtof and strtold [PR110653]

As well as the _GLIBCXX_USE_C99_STDLIB check, we also have a separate
check in linkage.m4 for just strtof and strtold. We can use that to
declare std::strtof and std::strtold in <cstdlib> for additional
targets. That allows us to enable std::stold on hpux11.11 which is
missing strtoll, strtoull and strtof, so doesn't define
_GLIBCXX_USE_C99_STDLIB. Although it doesn't help hpux11.11, we can
define std::stof for more targets this way too.

As with the previous commit for PR110653, this only affects the narrow
character overloads. std::stof and std::stold for wstring still requires
C99 <wchar.h> support.

libstdc++-v3/ChangeLog:

PR libstdc++/110653
* include/bits/basic_string.h [_GLIBCXX_HAVE_STRTOF] (stof):
Define.
[_GLIBCXX_HAVE_STRTOLD] (stold): Define.
* include/c_global/cstdlib [_GLIBCXX_HAVE_STRTOF] (strtof):
Declare in namespace std.
[_GLIBCXX_HAVE_STRTOLD] (strtold): Likewise.
libstdc++-v3/include/bits/basic_string.h
libstdc++-v3/include/c_global/cstdlib