mirror of
https://github.com/cimgui/cimgui.git
synced 2025-08-10 11:58:30 +01:00
script param "constructors" to add the _Construct version of constructors issue #278
This commit is contained in:
@@ -2421,6 +2421,12 @@ local function func_implementation(FP)
|
||||
table.insert(outtab,"{\n")
|
||||
table.insert(outtab," return IM_NEW("..def.stname..")"..def.call_args..";\n")
|
||||
table.insert(outtab,"}\n")
|
||||
if FP.CONSTRUCTORS_GENERATION then
|
||||
table.insert(outtab,"CIMGUI_API void "..def.ov_cimguiname.."_Construct("..def.stname.."* self"..(empty and "" or ","..def.args:sub(2,-2))..")\n")
|
||||
table.insert(outtab,"{\n")
|
||||
table.insert(outtab," IM_PLACEMENT_NEW(self)"..def.stname..def.call_args..";\n")
|
||||
table.insert(outtab,"}\n")
|
||||
end
|
||||
elseif def.destructor then
|
||||
local args = "("..def.stname.."* self)"
|
||||
local fname = def.stname.."_destroy"
|
||||
@@ -2491,6 +2497,9 @@ local function func_header_generate_funcs(FP)
|
||||
if def.constructor then
|
||||
assert(def.stname ~= "","constructor without struct")
|
||||
table.insert(outtab,"CIMGUI_API "..def.stname.."* "..def.ov_cimguiname ..(empty and "(void)" or def.args)..";"..addcoment.."\n")
|
||||
if FP.CONSTRUCTORS_GENERATION then
|
||||
table.insert(outtab,"CIMGUI_API void "..def.ov_cimguiname.."_Construct("..def.stname.."* self"..(empty and "" or ","..def.args:sub(2,-2))..")\n")
|
||||
end
|
||||
elseif def.destructor then
|
||||
table.insert(outtab,"CIMGUI_API void "..def.ov_cimguiname..def.args..";"..addcoment.."\n")
|
||||
else --not constructor
|
||||
|
Reference in New Issue
Block a user