| OLD | NEW |
| (Empty) |
| 1 //========================================== | |
| 2 // LIBCTINY - Matt Pietrek 2001 | |
| 3 // MSDN Magazine, January 2001 | |
| 4 // FILE: CRT0TCON.CPP | |
| 5 //========================================== | |
| 6 #include "libctiny.h" | |
| 7 #include <windows.h> | |
| 8 #include "argcargv.h" | |
| 9 #include "initterm.h" | |
| 10 | |
| 11 // Force the linker to include KERNEL32.LIB | |
| 12 #pragma comment(linker, "/defaultlib:kernel32.lib") | |
| 13 | |
| 14 //#pragma comment(linker, "/nodefaultlib:libc.lib") | |
| 15 //#pragma comment(linker, "/nodefaultlib:libcmt.lib") | |
| 16 | |
| 17 extern "C" int __cdecl main(int, char **, char **); // In user's code | |
| 18 | |
| 19 extern "C" void DoInitialization(); | |
| 20 extern "C" void DoCleanup(); | |
| 21 | |
| 22 // | |
| 23 // Modified version of the Visual C++ startup code. Simplified to | |
| 24 // make it easier to read. Only supports ANSI programs. | |
| 25 // | |
| 26 extern "C" void __cdecl mainCRTStartup() { | |
| 27 int mainret, argc; | |
| 28 | |
| 29 argc = _ConvertCommandLineToArgcArgv( ); | |
| 30 | |
| 31 // set up our minimal cheezy atexit table | |
| 32 _atexit_init(); | |
| 33 | |
| 34 // Call C++ constructors | |
| 35 _initterm( __xc_a, __xc_z ); | |
| 36 | |
| 37 // DoInitialization(); | |
| 38 | |
| 39 mainret = main( argc, _ppszArgv, 0 ); | |
| 40 | |
| 41 _DoExit(); | |
| 42 // DoCleanup(); | |
| 43 | |
| 44 ExitProcess(mainret); | |
| 45 } | |
| OLD | NEW |