Update contrib.
1 // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // EPOC32 version of crt0.c for pure C programs
24 __asm int CallMain(int argc, char *argv[], char *envp[])
30 #define CALLMAIN(argc, argv, envp) CallMain(argc, argv, envp)
32 extern "C" int main (int argc, char *argv[], char *envp[]);
33 #define CALLMAIN(argc, argv, envp) main(argc, argv, envp)
36 GLDEF_C TInt E32Main()
44 __crt0(argc,argv,envp); // get args & environment from somewhere
45 int ret=CALLMAIN(argc, argv, envp); // go
47 // no need to explicitly delete the cleanup stack here as all memory used by
48 // the process will be released by RProcess::Terminate(), called from inside exit().
50 exit(ret); // finish with atexit processing
56 #if defined __GCC32__ && !defined __X86GCC__
58 /* stub function inserted into main() by GCC */
59 extern "C" void __gccmain (void) {}
61 /* Default GCC entrypoint */
62 extern "C" TInt _mainCRTStartup (void)
64 extern TInt _E32Startup();
68 #endif /* __GCC32__ */
70 // X86GCC uses def files derived from EABI
71 #if (defined (__EABI__) || defined (__X86GCC__))
73 // standard entrypoint for C runtime, expected by some linkers
74 // Symbian OS does not currently use this function
75 extern "C" void __main() {}