From 8911a5a9921ec6f8e10b32d592dc43b80d053549 Mon Sep 17 00:00:00 2001 From: sonoro1234 Date: Tue, 13 Nov 2018 18:17:59 +0100 Subject: [PATCH] avoid ImNewDummy issue #80 for MSVC --- cimgui.h | 1 - generator/generator.lua | 7 +++++-- generator/output/cimgui.h | 1 - 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/cimgui.h b/cimgui.h index 32f0273..f2d2d8b 100644 --- a/cimgui.h +++ b/cimgui.h @@ -588,7 +588,6 @@ typedef struct ImVector_TextRange {int Size;int Capacity;TextRange* Data;} ImVec typedef struct ImVector_ImVec4 {int Size;int Capacity;ImVec4* Data;} ImVector_ImVec4; typedef struct ImVector_ImDrawIdx {int Size;int Capacity;ImDrawIdx* Data;} ImVector_ImDrawIdx; typedef struct ImVector_ImVec2 {int Size;int Capacity;ImVec2* Data;} ImVector_ImVec2; -struct ImNewDummy {}; struct ImGuiOnceUponAFrame { int RefFrame; diff --git a/generator/generator.lua b/generator/generator.lua index ea25f18..961a8bd 100644 --- a/generator/generator.lua +++ b/generator/generator.lua @@ -1093,7 +1093,10 @@ local function gen_structs_and_enums(cdefs,templates) local desired_linelen = (linelen==0) and 0 or math.max(math.ceil(linelen/10)*10,40) local spaces_to_add = 0 --desired_linelen - linelen local linecom = line..string.rep(" ",spaces_to_add)..comment - + + -- ImNewDummy drop for MSVC + if line:match"ImNewDummy" then break end + if line:match(namespace_re) then in_namespace = true end @@ -1105,7 +1108,7 @@ local function gen_structs_and_enums(cdefs,templates) break end end - + -- ImVector special treatment if structnames[#structnames] == "ImVector" then if line:match(struct_closing_re) then diff --git a/generator/output/cimgui.h b/generator/output/cimgui.h index 32f0273..f2d2d8b 100644 --- a/generator/output/cimgui.h +++ b/generator/output/cimgui.h @@ -588,7 +588,6 @@ typedef struct ImVector_TextRange {int Size;int Capacity;TextRange* Data;} ImVec typedef struct ImVector_ImVec4 {int Size;int Capacity;ImVec4* Data;} ImVector_ImVec4; typedef struct ImVector_ImDrawIdx {int Size;int Capacity;ImDrawIdx* Data;} ImVector_ImDrawIdx; typedef struct ImVector_ImVec2 {int Size;int Capacity;ImVec2* Data;} ImVector_ImVec2; -struct ImNewDummy {}; struct ImGuiOnceUponAFrame { int RefFrame;