Compare commits

...

2 Commits

Author SHA1 Message Date
sonoro1234
899049782b nonPOD_used 2 2025-11-19 10:28:26 +01:00
sonoro1234
305d1040fb add nonPOD_used to structs_and_enums.json 2025-11-18 17:18:01 +01:00
5 changed files with 22 additions and 4 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.
* 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
@@ -91,6 +91,7 @@ Notes:
* size : the number of array elements (when it is an array)
* 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 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
* 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 = {}
for k,v in pairs(typeargs) do
local k2 = k:gsub("const ","")
all_type_nP[k2] = true
all_type_nP[k2] = nonPOD[k2]--true
end
for k,v in pairs(typeargs_ret) do
local k2 = k:gsub("const ","")
all_type_nP[k2] = true
all_type_nP[k2] = nonPOD[k2]--true
end
FP.nP_used = all_type_nP
--M.prtable("FP.nP_used",FP.nP_used)
FP.structs_and_enums_table.nonPOD_used = FP.nP_used
FP.nP_args = typeargs
FP.nP_ret = typeargs_ret
--genConversions(FP)

View File

@@ -437,6 +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.typenames = parser1.typenames
structs_and_enums_table.templates_done = parser1.templates_done
--structs_and_enums_table.nonPOD_used = parser1.nP_used
save_data("./output/structs_and_enums.lua",serializeTableF(structs_and_enums_table))
save_data("./output/typedefs_dict.lua",serializeTableF(parser1.typedefs_dict))

View File

@@ -5656,6 +5656,14 @@
"ImVec4": true,
"ImVector": true
},
"nonPOD_used": {
"ImColor": true,
"ImRect": true,
"ImTextureRef": true,
"ImVec2": true,
"ImVec2i": true,
"ImVec4": true
},
"structs": {
"ImBitVector": [
{

View File

@@ -4532,6 +4532,13 @@ local t={
ImVec2ih=true,
ImVec4=true,
ImVector=true},
nonPOD_used={
ImColor=true,
ImRect=true,
ImTextureRef=true,
ImVec2=true,
ImVec2i=true,
ImVec4=true},
structs={
ImBitVector={
[1]={