From baeb2e3c0e791be305509e68203ab3552e83f40e Mon Sep 17 00:00:00 2001 From: joe-conigliaro Date: Sat, 12 Oct 2019 12:35:33 +1100 Subject: [PATCH] compiler: module init, add init fn definition (#2298) * test * only call existing module init * add back comment * add def --- compiler/main.v | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/main.v b/compiler/main.v index 93bb63002e..8e1d8df41b 100644 --- a/compiler/main.v +++ b/compiler/main.v @@ -394,7 +394,7 @@ fn (v mut V) generate_init() { v.cgen.nogen = false consts_init_body := v.cgen.consts_init.join_lines() init_fn_name := mod_gen_name(v.mod) + '__init_consts' - v.cgen.genln('void ${init_fn_name}() {\n$consts_init_body\n}') + v.cgen.genln('void ${init_fn_name}();\nvoid ${init_fn_name}() {\n$consts_init_body\n}') v.cgen.nogen = nogen } if v.pref.build_mode == .default_mode {