From: Earnie B. <ea...@us...> - 2003-10-16 10:36:56
|
BTW, Dimitri, I've updated the CVS version to 4.0, you may begin with your changes. Earnie. Danny Smith wrote: > From: "Dimitri Papadopoulos-Orfanos" > > >>Hi, >> >>The MinGW runtime provides 2 different entry points: >>* mainCRTStartup() for console programs (-subsystem,console) >>* WinMainCRTStartup() for GUI programs (-subsystem,windows) >> >>Currently both call __mingw_CRTStartup() so the behavior is the same > > for > >>console and GUI programs. From crt1.c: >> /* >> * Call the main function. If the user does not supply one >> * the one in the 'libmingw32.a' library will be linked in, and >> * that one calls WinMain. See main.c in the 'lib' dir >> * for more details. >> */ >> nRet = main (_argc, _argv, environ); >> >>This is different from the behavior of Borland and Microsoft > > compilers. > >> >>I think the MinGW runtime should be modified: >>* In the GUI case, WinMain() should have precedence over main(): >> 1) Call WinMain(). >> 2) If the user doesn't supply WinMain(), a default WinMain() is >>linked in. >> 3) The default WinMain() calls main(). >>* In the console case, WinMain() should probably not be called at all: >> 1) Just call main(). >> > > > GCC treats symbol "main" specially, inserting code for aligning stack, > calling global ctors and registering global dtors. What happens if > user-supplied WinMain _doesn't_ > call main()? Maybe a pre-emptive call to __main in WinMainCRTStartup > (see DllMainCRTStartup in dllcrt1.c) or elsewhere would be sufficient?? > > Danny > > <snip> > >>-- >>Dimitri >> >> >> >>------------------------------------------------------- >>This sf.net email is sponsored by:ThinkGeek >>Welcome to geek heaven. >>http://thinkgeek.com/sf >>_______________________________________________ >>MinGW-dvlpr mailing list >>Min...@li... >>https://lists.sourceforge.net/lists/listinfo/mingw-dvlpr > > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > MinGW-dvlpr mailing list > Min...@li... > https://lists.sourceforge.net/lists/listinfo/mingw-dvlpr > -- http://www.mingw.org Powered by SourceForge <http://sourceforge.net/projects/mingw> |