This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Make libstdc++ use strtold on MinGW


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]