diff options
author | Danny Smith <dannysmith@users.sourceforge.net> | 2002-10-20 04:30:28 +0000 |
---|---|---|
committer | Danny Smith <dannysmith@users.sourceforge.net> | 2002-10-20 04:30:28 +0000 |
commit | 1c00ad29b8186d3462261dfbddaa30f89591edc0 (patch) | |
tree | 3726f66364bcf775205ad917bc348fd4e919298d /winsup/mingw/crt1.c | |
parent | bfda61d41921b6945aa99f3b729e1b51f5782498 (diff) | |
download | cygnal-1c00ad29b8186d3462261dfbddaa30f89591edc0.tar.gz cygnal-1c00ad29b8186d3462261dfbddaa30f89591edc0.tar.bz2 cygnal-1c00ad29b8186d3462261dfbddaa30f89591edc0.zip |
2002-10-19 Danny Smith <dannysmith@users.sourceforge.net>
* crt1.c: Define new macro __IN_MINGW_RUNTIME before including
stdlib.h. Comment on reason.
Define WIN32_MEAN_AND_LEAN before including windows.h
* include/stdlib.h (_fmode): Protect declaration as dllimported
variable with __IN_MINGW_RUNTIME.
2002-10-19 Igor Pechtchanski <pechtcha@cs.nyu.edu>
* crt1.c: Include stdlib.h.
Diffstat (limited to 'winsup/mingw/crt1.c')
-rw-r--r-- | winsup/mingw/crt1.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/winsup/mingw/crt1.c b/winsup/mingw/crt1.c index 40c8d466a..ef4623f51 100644 --- a/winsup/mingw/crt1.c +++ b/winsup/mingw/crt1.c @@ -26,10 +26,17 @@ * */ +/* Hide the declaration of _fmode with dllimport attribute in stdlib.h. + This is not necessary with Mumit Khan's patches to gcc's winnt.c, + but those patches are still unofficial. */ + +#define __IN_MINGW_RUNTIME +#include <stdlib.h> #include <stdio.h> #include <io.h> #include <process.h> #include <float.h> +#define WIN32_LEAN_AND_MEAN #include <windows.h> #include <signal.h> @@ -55,8 +62,9 @@ __MINGW_IMPORT void __set_app_type(int); /* Global _fmode for this .exe, not the one in msvcrt.dll, The default is set in txtmode.o in libmingw32.a */ -#undef _fmode -extern int _fmode; +/* Override the dllimport'd declarations in stdlib.h */ +#undef _fmode +extern int _fmode; extern int* __p__fmode(void); /* To access the dll _fmode */ /* @@ -68,7 +76,7 @@ extern int _CRT_fmode; static void _mingw32_init_fmode () { - /* Don't set the file mode if the user hasn't set any value for it. */ + /* Don't set the std file mode if the user hasn't set any value for it. */ if (_CRT_fmode) { _fmode = _CRT_fmode; @@ -239,6 +247,7 @@ WinMainCRTStartup () __set_app_type (__GUI_APP); #endif __mingw_CRTStartup (); +return 0; } /* |