summaryrefslogtreecommitdiff
path: root/types_cgen.c
diff options
context:
space:
mode:
Diffstat (limited to 'types_cgen.c')
-rw-r--r--types_cgen.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/types_cgen.c b/types_cgen.c
index 541f1b5..28db722 100644
--- a/types_cgen.c
+++ b/types_cgen.c
@@ -26,6 +26,8 @@ static bool cgen_types_expr(CGenerator *g, Expression *e) {
case EXPR_FN: {
if (e->fn.name && g->block == NULL) { /* write named function prototypes in global scope to header file */
g->writing_to = CGEN_WRITING_TO_H;
+ } else {
+ g->writing_to = CGEN_WRITING_TO_C;
}
if (!cgen_types_fn(g, &e->fn, e->where))
return false;