From e48d428b167e33f1bd56e446ebe75866ce146dac Mon Sep 17 00:00:00 2001 From: sonoro1234 Date: Sat, 8 Aug 2026 10:47:26 +0200 Subject: [PATCH] cpp2ffi: opaque returns assign to static obj --- generator/cpp2ffi.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/generator/cpp2ffi.lua b/generator/cpp2ffi.lua index acbf855..6b66b46 100644 --- a/generator/cpp2ffi.lua +++ b/generator/cpp2ffi.lua @@ -3946,6 +3946,7 @@ local function ImGui_f_implementation(def) insert(outtab," return str.c_str();\n") elseif def.nonUDT == "opaque" then insert(outtab," static auto opq = "..ptret..namespace..def.funcname..def.call_args..";\n") + insert(outtab," opq = "..ptret..namespace..def.funcname..def.call_args..";\n") insert(outtab," return &opq;\n") end table.insert(outtab,"}\n") @@ -4001,6 +4002,7 @@ local function struct_f_implementation(def) insert(outtab," return str.c_str();\n") elseif def.nonUDT == "opaque" then insert(outtab," static auto opq = "..ptret.."self->"..def.funcname..def.call_args..";\n") + insert(outtab," opq = "..ptret.."self->"..def.funcname..def.call_args..";\n") insert(outtab," return &opq;\n") end table.insert(outtab,"}\n")