compiler: module init, add init fn definition (#2298)

* test

* only call existing module init

* add back comment

* add def
pull/2300/head
joe-conigliaro 2019-10-12 12:35:33 +11:00 committed by GitHub
parent 114fce4242
commit baeb2e3c0e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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 {