summaryrefslogtreecommitdiff
path: root/types_cgen.c
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2019-08-27 15:21:06 -0400
committerLeo Tenenbaum <pommicket@gmail.com>2019-08-27 15:21:06 -0400
commitdf10470f1f10f1f1f2f5cad792976de8d734bf27 (patch)
tree5377bd2f9efc2af4f5c46430da88a4476f14103a /types_cgen.c
parent126c496ad8a6e9a3b90ecd25c8ff3ead630f7f65 (diff)
fixed functions
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;