More efficient and GC-safe conversions in API generator
This commit is contained in:
parent
ed9ede5cb3
commit
031774f54f
3 changed files with 61 additions and 13 deletions
|
|
@ -272,8 +272,12 @@ macro invokeVarArgs(procIdent, objIdent;
|
|||
invocation = newNimNode(nnkCall).add(ident("procCall"), invocation)
|
||||
|
||||
if hasReturnValue:
|
||||
let resultVariant = genSym(nskLet, "ret")
|
||||
branchBody.add(
|
||||
newNimNode(nnkLetSection).add(
|
||||
newIdentDefs(resultVariant, ident("Variant"), newCall("toVariant", invocation))))
|
||||
let theCall = newNimNode(nnkBracketExpr).add(newNimNode(nnkDotExpr).add(
|
||||
newCall("toVariant", invocation), ident("godotVariant")))
|
||||
resultVariant, ident("godotVariant")))
|
||||
branchBody.add(getAst(initGodotVariantCall(ident("result"), theCall)))
|
||||
else:
|
||||
branchBody.add(invocation)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue