summaryrefslogtreecommitdiff
path: root/cgen.c
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2020-01-14 19:01:58 -0500
committerLeo Tenenbaum <pommicket@gmail.com>2020-01-14 19:01:58 -0500
commit62349b1f6d9f5948f856e26e3b0eef19567198fa (patch)
tree907540e60d2973f4f15e9c7929422e7d24a0477d /cgen.c
parent2d647644449ead4ab3b477b5c2547bc6da29cc20 (diff)
named args for imported fns
Diffstat (limited to 'cgen.c')
-rw-r--r--cgen.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/cgen.c b/cgen.c
index 13c4adc..0c955e0 100644
--- a/cgen.c
+++ b/cgen.c
@@ -288,8 +288,10 @@ static inline void cgen_ident_simple(CGenerator *g, Identifier i) {
static void cgen_ident(CGenerator *g, Identifier i) {
IdentDecl *idecl = ident_decl(i);
- if (idecl && idecl->kind == IDECL_DECL && idecl->decl->flags & DECL_EXPORT)
+ if (idecl && idecl->kind == IDECL_DECL && idecl->decl->flags & DECL_EXPORT) {
+ assert(g->pkg_prefix);
cgen_write(g, "%s__", g->pkg_prefix);
+ }
if (i == g->main_ident) {
/* don't conflict with C's main! */
cgen_write(g, "main__");