This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Make libstdc++ use strtold on MinGW
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: gcc-patches at gcc dot gnu dot org, libstdc++ at gcc dot gnu dot org
- Date: Thu, 28 Feb 2008 13:07:32 +0000 (UTC)
- Subject: Make libstdc++ use strtold on MinGW
libstdc++ has code (in config/locale/generic/c_locale.cc) that uses
strtold to convert strings to long double if available, falling back
to scanf %Lf if strtold is not available. MinGW has strtold - but
does not have working scanf %Lf (Kai Tietz's patch correctly records
this format as unavailable on Windows). Thus it's important for
libstdc++ to know that strtold is available. OK to commit this patch
which marks strtold and strtof as available on MinGW in
crossconfig.m4?
(This is not a regression, as far as I know, so I only propose this
for trunk.)
Tested with no regressions with cross to i686-mingw32, where it fixes
the following libstdc++ test failures:
FAIL: 22_locale/money_get/get/char/5.cc execution test
FAIL: 22_locale/money_get/get/wchar_t/5.cc execution test
FAIL: 22_locale/num_get/get/char/10.cc execution test
FAIL: 22_locale/num_get/get/char/4.cc execution test
FAIL: 22_locale/num_get/get/wchar_t/10.cc execution test
FAIL: 22_locale/num_get/get/wchar_t/4.cc execution test
FAIL: 26_numerics/complex/inserters_extractors/char/1.cc execution test
FAIL: 26_numerics/complex/inserters_extractors/wchar_t/1.cc execution test
FAIL: 27_io/basic_istream/extractors_arithmetic/char/01.cc execution test
FAIL: 27_io/basic_istream/extractors_arithmetic/char/12.cc execution test
FAIL: 27_io/basic_istream/extractors_arithmetic/wchar_t/01.cc execution test
FAIL: 27_io/basic_istream/extractors_arithmetic/wchar_t/12.cc execution test
2008-02-28 Joseph Myers <joseph@codesourcery.com>
* crossconfig.m4 (*-mingw32*): Define HAVE_STRTOF and
HAVE_STRTOLD.
* configure: Regenerate.
Index: libstdc++-v3/crossconfig.m4
===================================================================
--- libstdc++-v3/crossconfig.m4 (revision 132692)
+++ libstdc++-v3/crossconfig.m4 (working copy)
@@ -234,6 +234,8 @@
;;
*-mingw32*)
AC_CHECK_HEADERS([sys/types.h locale.h float.h])
+ AC_DEFINE(HAVE_STRTOF)
+ AC_DEFINE(HAVE_STRTOLD)
GLIBCXX_CHECK_LINKER_FEATURES
GLIBCXX_CHECK_COMPLEX_MATH_SUPPORT
;;
--
Joseph S. Myers
joseph@codesourcery.com