summaryrefslogtreecommitdiff
path: root/cgen.c
diff options
context:
space:
mode:
Diffstat (limited to 'cgen.c')
-rw-r--r--cgen.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/cgen.c b/cgen.c
index 1c13039..152baf6 100644
--- a/cgen.c
+++ b/cgen.c
@@ -159,5 +159,11 @@ static bool cgen_file(CGenerator *g, ParsedFile *f) {
arr_foreach(&f->stmts, Statement, s) {
if (!cgen_fns_in_stmt(g, s)) return false;
}
+ g->writing_to = CGEN_WRITING_TO_C;
+ /* write actual main function */
+ cgen_write(g, "\nint main(void) {\n"
+ "\tmain__();\n"
+ "\treturn 0;\n"
+ "}\n");
return ret;
}