mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
compiler: module init, add init fn definition (#2298)
* test * only call existing module init * add back comment * add def
This commit is contained in:
parent
114fce4242
commit
baeb2e3c0e
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user