This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: 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 18:09:39 +0000 (UTC)
- Subject: Re: Make libstdc++ use strtold on MinGW
- References: <Pine.LNX.4.64.0802281305250.28196@digraph.polyomino.org.uk>
I should also add: there are similar issues with long double output to
those with input, since Windows printf functions do not support long
double either.
For the output issue, the fix involves using MinGW's replacement snprintf
functions with long double support, which means enabling C99 support in
libstdc++ so that it uses snprintf. C99 support is disabled on MinGW only
because complex.h support is detected as absent, because MinGW <complex.h>
conditions out all its contents in strict non-C99 mode, as used for
configure tests. This can be fixed by a patch to MinGW such as the one
below (submitted to the MinGW patch tracker). Alternative fixes would be
to make the C99 support in libstdc++ more fine-grained, so snprintf can be
used without needing all the other parts of C99 support, or to use
fixincludes to apply such a change to an existing <complex.h> header.
2008-02-28 Joseph Myers <joseph@codesourcery.com>
* include/complex.h: Don't condition contents on C99 or not
__STRICT_ANSI__.
--- include/complex.h.orig 2007-12-27 06:23:38.000000000 -0800
+++ include/complex.h 2008-02-28 06:36:23.000000000 -0800
@@ -24,9 +24,6 @@
/* All the headers include this file. */
#include <_mingw.h>
-#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) \
- || !defined __STRICT_ANSI__
-
/* These macros are specified by C99 standard */
#ifndef __cplusplus
@@ -199,7 +196,5 @@
}
#endif
-#endif /* __STDC_VERSION__ >= 199901L */
-
#endif /* _COMPLEX_H */
--
Joseph S. Myers
joseph@codesourcery.com