cpp2ffi: dont generate comments

This commit is contained in:
Victor Bombi
2020-09-25 09:59:59 +02:00
parent 7685bab86f
commit 31b598af72
2 changed files with 11 additions and 4 deletions

View File

@@ -345,13 +345,20 @@ local function parseItems(txt,dumpit,loca,linenumdict)
end
else
--item,inercoms = clean_comments(item)
local itemold = item
item = item:gsub("extern __attribute__%(%(dllexport%)%) ","")
local comments = table.concat(outercomms,"\n") --..inercoms
if comments=="" then comments=nil end
outercomms = {}
if linenumdict then
local itemfirstline = item:match("[^\n]+")
local itemfirstline = itemold:match("[^\n]+")
loca = linenumdict[itemfirstline]
if not loca then
print(itemold)
error"no entry in linenumdict"
end
else
error"no linenumdict"
end
table.insert(itemarr,{re_name=re_name,item=item,locat=loca})--,comments=comments})
items[re_name] = items[re_name] or {}

View File

@@ -10,10 +10,10 @@ local INTERNAL_GENERATION = script_args[2]:match("internal") and true or false
local FREETYPE_GENERATION = script_args[2]:match("freetype") and true or false
local CPRE,CTEST
if COMPILER == "gcc" or COMPILER == "clang" then
CPRE = COMPILER..[[ -E -C -DIMGUI_DISABLE_OBSOLETE_FUNCTIONS -DIMGUI_API="" -DIMGUI_IMPL_API="" ]]
CPRE = COMPILER..[[ -E -DIMGUI_DISABLE_OBSOLETE_FUNCTIONS -DIMGUI_API="" -DIMGUI_IMPL_API="" ]]
CTEST = COMPILER.." --version"
elseif COMPILER == "cl" then
CPRE = COMPILER..[[ /E /C /DIMGUI_DISABLE_OBSOLETE_FUNCTIONS /DIMGUI_API="" /DIMGUI_IMPL_API="" ]]
CPRE = COMPILER..[[ /E /DIMGUI_DISABLE_OBSOLETE_FUNCTIONS /DIMGUI_API="" /DIMGUI_IMPL_API="" ]]
CTEST = COMPILER
else
print("Working without compiler ")
@@ -494,7 +494,7 @@ if #implementations > 0 then
pipe:close()
end
parser2.separate_locations = function(self, cdefs)
parser2.separate_locationsNO = function(self, cdefs)
local sepcdefs = {}
for i,impl in ipairs(implementations) do
sepcdefs[i] = {[[imgui_impl_]].. impl,{}}