From: Earnie B. <ear...@ya...> - 2002-03-30 15:59:25
|
Your suggestion has my vote of approval. Earnie. On 3/25/2002 at 11:53 AM Danny Smith wrote: >Currently mingw runtime includes stdarg.h, varargs.h stddef.h. These are >not really necessary since the ones provided by GCC could do the job, but >are masked by the mingw ones. They also create maintenance woes. If we >want the mingw runtime versions of these files to be compatable with GCC's >internal builtins (which changes from version to version), we have to do >this kind of thing in, eg, stdio.h: > >#if defined __GNUC__ && __GNUC__ >= 3 >typedef __builtin_va_list va_list; >#else >typedef char* va_list; >#endif > >What happens in GCC 3.2? > >This is especially bothersome because the ANSI standard says that va_list >should be defined in stdarg.h, not in stdio.h (see the comments in GCC's >stdarg.h). > >Why not just let GCC's version-specific fixincludes take care of that kind >of maintenance, as do other platforms. > >I propose that we get rid of the mingw runtime versions of stdarg.h, >vararg.h and stddef.h and use GCC's. The only modification necessary for >the GCC ones is to guard everything with ndef RC_INVOKED. That is easy. >The other modification necessary is in stdio.h. Rather than putting >va_list typedef in stdio.h as mingw does, do what cygwin and other >platforms do: > > >#define __need___va_list >#include <stdarg.h> > >then > >#ifdef __GNUC__ >#define __VALIST __gnuc_va_list >#else >#define __VALIST char* >#endif > >then replace all va_list parms in function prototypes with __VALIST. > >Yes, it works with MS versions of vprintf, vsprintf, _vsnprintf and wide >counterparts. No I haven't run into the varargs/stdarg conflicts that >Colin Peters notes in mingw stdio.h comments. > >Danny > >http://www.sold.com.au - SOLD.com.au Auctions >- 1,000s of Bargains! > >_______________________________________________ >MinGW-dvlpr mailing list >Min...@li... >https://lists.sourceforge.net/lists/listinfo/mingw-dvlpr _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com |