mirror of
https://github.com/vlang/v.git
synced 2025-09-13 22:42:26 +03:00
cgen: fix build with-parallel-cc
, when a closure is used (#23230)
This commit is contained in:
parent
c968c9ec60
commit
70152e21e7
1 changed files with 6 additions and 1 deletions
|
@ -4412,7 +4412,12 @@ fn (mut g Gen) gen_closure_fn(expr_styp string, m ast.Fn, name string) {
|
||||||
}
|
}
|
||||||
sb.write_string('${g.styp(param.typ)} a${i}')
|
sb.write_string('${g.styp(param.typ)} a${i}')
|
||||||
}
|
}
|
||||||
sb.writeln(') {')
|
sb.write_string(')')
|
||||||
|
if g.pref.parallel_cc {
|
||||||
|
g.extern_out.write_string(sb.bytestr())
|
||||||
|
g.extern_out.writeln(';')
|
||||||
|
}
|
||||||
|
sb.writeln(' {')
|
||||||
sb.writeln('\t${data_styp}* a0 = __CLOSURE_GET_DATA();')
|
sb.writeln('\t${data_styp}* a0 = __CLOSURE_GET_DATA();')
|
||||||
if m.return_type != ast.void_type {
|
if m.return_type != ast.void_type {
|
||||||
sb.write_string('\treturn ')
|
sb.write_string('\treturn ')
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue