1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

fix disappearing printf when compiling with

This commit is contained in:
Alexander Medvednikov 2019-07-10 22:07:56 +02:00
parent 4a8ba9756f
commit da51fea605

View File

@ -509,13 +509,6 @@ fn (p mut Parser) fn_call(f Fn, method_ph int, receiver_var, receiver_type strin
p.error('function `$f.name` is private') p.error('function `$f.name` is private')
} }
p.calling_c = f.is_c p.calling_c = f.is_c
is_print := p.pref.is_prod &&// Hide prints only in prod
!p.pref.is_test &&
!p.builtin_pkg &&// Allow prints in builtin pkgs
f.is_c && f.name == 'printf'
if !p.cgen.nogen {
p.cgen.nogen = is_print
}
cgen_name := p.table.cgen_name(f) cgen_name := p.table.cgen_name(f)
// if p.pref.is_prof { // if p.pref.is_prof {
// p.cur_fn.called_fns << cgen_name // p.cur_fn.called_fns << cgen_name
@ -557,9 +550,6 @@ fn (p mut Parser) fn_call(f Fn, method_ph int, receiver_var, receiver_type strin
p.fn_call_args(f) p.fn_call_args(f)
p.gen(')') p.gen(')')
p.calling_c = false p.calling_c = false
if is_print {
p.cgen.nogen = false
}
// println('end of fn call typ=$f.typ') // println('end of fn call typ=$f.typ')
} }