1 /* -----------------------------------------------------------------------------
3 * (c) The GHC Team 2009
5 * The C main() function for a standalone Haskell program.
7 * Note that this is not part of the RTS. It calls into the RTS to get things
8 * going. It is compiled to a separate Main.o which is linked into every
9 * standalone Haskell program that uses a Haskell Main.main function
10 * (as opposed to a mixed Haskell C program using a C main function).
12 * ---------------------------------------------------------------------------*/
17 /* The symbol for the Haskell Main module's init function. It is safe to refer
18 * to it here because this Main.o object file will only be linked in if we are
19 * linking a Haskell program that uses a Haskell Main.main function.
21 extern void __stginit_ZCMain(void);
23 /* Similarly, we can refer to the ZCMain_main_closure here */
24 extern StgClosure ZCMain_main_closure;
26 int main(int argc, char *argv[])
28 return hs_main(argc, argv, &__stginit_ZCMain, &ZCMain_main_closure);