summaryrefslogtreecommitdiff
path: root/cgen.c
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2020-02-07 19:29:53 -0500
committerLeo Tenenbaum <pommicket@gmail.com>2020-02-07 19:29:53 -0500
commitf94bf833f031611b49fa9674af44dba1f55e7c24 (patch)
tree207001de6fdf84410a0d9aa09037f91f1aa7244d /cgen.c
parentb40db0bcddda8472f3d4f5fbf7d86a4efb77a6a4 (diff)
got #export to work
Diffstat (limited to 'cgen.c')
-rw-r--r--cgen.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/cgen.c b/cgen.c
index a193d6d..62fd4fc 100644
--- a/cgen.c
+++ b/cgen.c
@@ -562,7 +562,8 @@ static bool cgen_fn_args(CGenerator *g, FnExpr *f, U64 instance, U64 which_are_c
static bool cgen_fn_header(CGenerator *g, FnExpr *f, U64 instance, U64 which_are_const) {
bool out_param = cgen_uses_ptr(&f->ret_type);
assert(cgen_should_gen_fn(f));
- cgen_write(g, "static ");
+ if (!(f->flags & FN_EXPR_EXPORT))
+ cgen_write(g, "static ");
if (out_param) {
cgen_write(g, "void ");
} else {