nonPOD_used 2

This commit is contained in:
sonoro1234
2025-11-19 10:28:26 +01:00
parent 305d1040fb
commit 899049782b
3 changed files with 7 additions and 5 deletions

View File

@@ -17,9 +17,9 @@ Notes:
* All naming is algorithmic except for those names that were coded in cimgui_overloads table (https://github.com/cimgui/cimgui/blob/master/generator/generator.lua#L60). In the official version this table is empty. * All naming is algorithmic except for those names that were coded in cimgui_overloads table (https://github.com/cimgui/cimgui/blob/master/generator/generator.lua#L60). In the official version this table is empty.
* Current overloaded function names can be found in (https://github.com/cimgui/cimgui/blob/master/generator/output/overloads.txt) * Current overloaded function names can be found in (https://github.com/cimgui/cimgui/blob/master/generator/output/overloads.txt)
#changes # changes
* 10/11/2025: Functions returning and taking as argument no POD structs is now doing a conversion internally to allow ARM64 compilation. * 10/11/2025: Functions returning and taking as argument no POD structs is now doing a conversion internally to allow ARM64 compilation. In structs_and_enums.json under key nonPOD_used we get a collection where keys are types non usable from C that appear as returns or args to funtions. value can be true or "inherited" when type comes from cimgui and appears in a cimgui extension (cimplot ...). The C names have suffix _c.
# compilation # compilation
@@ -91,6 +91,7 @@ Notes:
* size : the number of array elements (when it is an array) * size : the number of array elements (when it is an array)
* bitfield : the bitfield width (in case it is a bitfield) * bitfield : the bitfield width (in case it is a bitfield)
* under key locations we get the locations collection in which each key is the enum tagname or the struct name and the value is the name of the header file and line number this comes from. * under key locations we get the locations collection in which each key is the enum tagname or the struct name and the value is the name of the header file and line number this comes from.
* under key nonPOD_used we get a collection where keys are types non usable from C that appear as returns or args to funtions. value can be true or "inherited" when type comes from cimgui and appears in a cimgui extension (cimplot ...). The C names have suffix _c.
# usage # usage
* use whatever method is in ImGui c++ namespace in the original [imgui.h](https://github.com/ocornut/imgui/blob/master/imgui.h) by prepending `ig` * use whatever method is in ImGui c++ namespace in the original [imgui.h](https://github.com/ocornut/imgui/blob/master/imgui.h) by prepending `ig`

View File

@@ -1256,14 +1256,15 @@ local function get_nonPODused(FP)
local all_type_nP = {} local all_type_nP = {}
for k,v in pairs(typeargs) do for k,v in pairs(typeargs) do
local k2 = k:gsub("const ","") local k2 = k:gsub("const ","")
all_type_nP[k2] = true all_type_nP[k2] = nonPOD[k2]--true
end end
for k,v in pairs(typeargs_ret) do for k,v in pairs(typeargs_ret) do
local k2 = k:gsub("const ","") local k2 = k:gsub("const ","")
all_type_nP[k2] = true all_type_nP[k2] = nonPOD[k2]--true
end end
FP.nP_used = all_type_nP FP.nP_used = all_type_nP
--M.prtable("FP.nP_used",FP.nP_used) --M.prtable("FP.nP_used",FP.nP_used)
FP.structs_and_enums_table.nonPOD_used = FP.nP_used
FP.nP_args = typeargs FP.nP_args = typeargs
FP.nP_ret = typeargs_ret FP.nP_ret = typeargs_ret
--genConversions(FP) --genConversions(FP)

View File

@@ -437,7 +437,7 @@ local structs_and_enums_table = parser1.structs_and_enums_table
structs_and_enums_table.templated_structs = parser1.templated_structs structs_and_enums_table.templated_structs = parser1.templated_structs
structs_and_enums_table.typenames = parser1.typenames structs_and_enums_table.typenames = parser1.typenames
structs_and_enums_table.templates_done = parser1.templates_done structs_and_enums_table.templates_done = parser1.templates_done
structs_and_enums_table.nonPOD_used = parser1.nP_used --structs_and_enums_table.nonPOD_used = parser1.nP_used
save_data("./output/structs_and_enums.lua",serializeTableF(structs_and_enums_table)) save_data("./output/structs_and_enums.lua",serializeTableF(structs_and_enums_table))
save_data("./output/typedefs_dict.lua",serializeTableF(parser1.typedefs_dict)) save_data("./output/typedefs_dict.lua",serializeTableF(parser1.typedefs_dict))