Win32 utility to bootstrap the PSX subsystem (it is an optional subsystem, therefore...
[reactos.git] / posix / lib / crt0w32.c
1 /* $Id: crt0w32.c,v 1.4 2002/10/29 04:45:26 rex Exp $
2 *
3 * PROJECT : ReactOS / POSIX+ personality
4 * FILE : subsys/psx/lib/crt0w32.c
5 * DESCRIPTION: startup code for POSIX+ applications.
6 * DATE : 2002-01-18
7 * AUTHOR : Emanuele Aliberti <eal@users.sf.net>
8 */
9
10 extern void __stdcall __PdxInitializeData(int*,char***);
11 extern int main (int,char**,char**);
12 extern void exit(int);
13
14 /* ANSI ENVIRONMENT */
15
16 char **_environ = (char**) 0;
17
18 int errno = 0;
19
20 #ifdef __SUBSYSTEM_WINDOWS__
21 void WinMainCRTStartup (void)
22 #else
23 void mainCRTStartup (void)
24 #endif
25 {
26 char * argv[2] = {"none", 0};
27
28 /* TODO: parse the command line */
29 exit(main(1,argv,0));
30 }
31
32 void __main ()
33 {
34 /*
35 * Store in PSXDLL.DLL two well known global symbols
36 * references.
37 */
38 __PdxInitializeData (& errno, & _environ); /* PSXDLL.__PdxInitializeData */
39 /* CRT initialization. */
40 #ifdef __SUBSYSTEM_WINDOWS__
41 WinMainCRTStartup ();
42 #else
43 mainCRTStartup ();
44 #endif
45 }
46 /* EOF */