keep function locations

keep locations
This commit is contained in:
Victor Bombi
2020-06-05 12:26:27 +02:00
parent 61784f32f9
commit 19e41cf8e9
2 changed files with 50 additions and 15 deletions

View File

@@ -428,6 +428,20 @@ gdefines = get_defines{"IMGUI_VERSION","FLT_MAX"}
local function parseImGuiHeader(header,names)
--prepare parser
local parser = cpp2ffi.Parser()
parser.separate_locations = function(self,cdefs)
local imguicdefs = {}
local othercdefs = {}
for i,cdef in ipairs(cdefs) do
if cdef[2]=="imgui" then
table.insert(imguicdefs,cdef[1])
else
table.insert(othercdefs,cdef[1])
end
end
return {{"imgui",imguicdefs},{"internal",othercdefs}}
end
parser.getCname = function(stname,funcname,namespace)
local pre = (stname == "") and (namespace and (namespace=="ImGui" and "ig" or namespace.."_") or "ig") or stname.."_"
return pre..funcname