From 7be536c5dfe3621d1d42a13ec0a3ef98ceb7f570 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Wed, 16 Apr 2025 02:05:50 -0400 Subject: Bugfix for top-level variables in libraries --- src/compile.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/compile.c') diff --git a/src/compile.c b/src/compile.c index 5c153f87..023b2e2e 100644 --- a/src/compile.c +++ b/src/compile.c @@ -4262,7 +4262,7 @@ CORD compile_top_level_code(env_t *env, ast_t *ast) if ((decl->value && is_constant(env, decl->value)) || (!decl->value && !has_heap_memory(t))) { set_binding(env, decl_name, t, full_name); return CORD_all( - is_private ? "static " : CORD_EMPTY, + is_private ? "static " : "public ", compile_declaration(t, full_name), " = ", val_code, ";\n"); } else { CORD checked_access = CORD_all("check_initialized(", full_name, ", \"", decl_name, "\")"); @@ -4270,7 +4270,7 @@ CORD compile_top_level_code(env_t *env, ast_t *ast) return CORD_all( "static bool ", full_name, "$initialized = false;\n", - is_private ? "static " : CORD_EMPTY, + is_private ? "static " : "public ", compile_declaration(t, full_name), ";\n"); } } -- cgit v1.2.3