Re: [PATCH:2] Export symbols when compiling a C runtime library
Casper Hornstrup <[email protected]>
| Newsgroups | gmane.comp.gnu.mingw.patches |
|---|---|
| Message-ID | <[email protected]> |
søn, 2002-06-16 kl. 00:18 skrev Danny Smith: > > ----- Original Message ----- > From: "Casper Hornstrup" <[email protected]> > To: <[email protected]> > Sent: Saturday, 15 June 2002 23:48 > Subject: [MinGW-patches] [PATCH:2] Export symbols when compiling a C > runtime library > ... > I really don't like putting building _CRT_ stuff in user-land header. > Why not just let command line defines override header: > > #ifndef __GNUC__ > + # ifndef __MINGW_IMPORT > # define __MINGW_IMPORT __declspec(dllimport) > + # endif > # define __DECLSPEC_SUPPORTED > #else /* __GNUC__ */ > # ifdef __declspec > /* Note the extern. This is needed to work around GCC's > limitations in handling dllimport attribute. */ > + # ifndef __MINGW_IMPORT > # define __MINGW_IMPORT extern __attribute__((dllimport)) > + # endif > + # define __DECLSPEC_SUPPORTED > # else > # undef __DECLSPEC_SUPPORTED > - # undef __MINGW_IMPORT > # endif > > + # ifndef __MINGW_IMPORT > + # define __MINGW_IMPORT extern > + # endif It works so it's good enough for me. > > ==snip== > > > > > Index: include/io.h > > =================================================================== > > RCS file: /cvsroot/mingw/runtime/include/io.h,v > > retrieving revision 1.4 > > diff -u -r1.4 io.h > > --- include/io.h 29 Nov 2001 04:26:33 -0000 1.4 > > +++ include/io.h 15 Jun 2002 11:43:07 -0000 > > @@ -125,6 +125,7 @@ > > int _mkdir (const char*); > > char* _mktemp (char*); > > int _rmdir (const char*); > > +int _chmod (const char*, int); > > > This is also in sys/stat.h. Should we remove from sys/stat.h ?. According to http://doc.ddart.net/chm/vsinc.chm. _chmod is defined only in io.h. Not in sys/stat.h. > > ===snip== > > > Index: include/stdio.h > > =================================================================== > > RCS file: /cvsroot/mingw/runtime/include/stdio.h,v > > retrieving revision 1.8 > > diff -u -r1.8 stdio.h > > --- include/stdio.h 14 Jun 2002 15:12:54 -0000 1.8 > > +++ include/stdio.h 15 Jun 2002 11:43:07 -0000 > > @@ -96,9 +96,16 @@ > > */ > > #define L_tmpnam (16) > > > > -#define _IOFBF 0x0000 > > -#define _IOLBF 0x0040 > > -#define _IONBF 0x0004 > > +#define _IOFBF 0x0000 > > +#define _IOLBF 0x0040 > > +#define _IONBF 0x0004 > > + > > +#define _IOMYBUF 0x0008 > > +#define _IOEOF 0x0010 > > +#define _IOERR 0x0020 > > +#define _IOSTRG 0x0040 > > +#define _IORW 0x0080 > > +#define _IOAPPEND 0x0200 > > > Can you document what these non-standard flags mean with some comments > please.? I was under the impression that comments were basicly banned in mingw headers in order to minimize parsing time. Or is this only true in w32api? Anyways, I'll see if I can get more information on these and come up with some comments. > > +FILE* _wfdopen(int, wchar_t *); > Also put in wchar.h. Unincode mappings in tchar.h. > > > Thanks > > Danny Same source above indicates that _wfdopen is defined in stdio.h and wchar.h. Casper Hornstrup _______________________________________________________________ Don't miss the 2002 Sprint PCS Application Developer's Conference August 25-28 in Las Vegas - http://devcon.sprintpcs.com/adp/index.cfm?source=osdntextlink