add preprocesor ifndef for including only once in cimgui_impl.h

This commit is contained in:
sonoro1234
2025-06-25 18:44:25 +02:00
parent 094a55523a
commit 92b0239554
2 changed files with 5 additions and 2 deletions

View File

@@ -1,3 +1,5 @@
#ifndef CIMGUI_IMPL_DEFINED
#define CIMGUI_IMPL_DEFINED
#ifdef CIMGUI_USE_GLFW
#ifdef CIMGUI_DEFINE_ENUMS_AND_STRUCTS
@@ -196,3 +198,4 @@ CIMGUI_API int ImGui_ImplVulkanH_GetMinImageCountFromPresentMode(VkPresentModeKH
CIMGUI_API ImGui_ImplVulkanH_Window* ImGui_ImplVulkanH_Window_ImGui_ImplVulkanH_Window(void);
#endif
#endif //CIMGUI_IMPL_DEFINED

View File

@@ -460,7 +460,7 @@ if #implementations > 0 then
parser2 = cpp2ffi.Parser()
local config = dofile(CONFIG_GENERATOR_PATH) --"./config_generator.lua"
local impl_str = ""
local impl_str = "#ifndef CIMGUI_IMPL_DEFINED\n#define CIMGUI_IMPL_DEFINED\n"
local impl_str_cpp = {}
for i,impl in ipairs(implementations) do
print("------------implementation:",impl)
@@ -502,7 +502,7 @@ if #implementations > 0 then
end
impl_str = impl_str.. table.concat(outtab)..cfuncsstr .. "\n#endif\n"
end
impl_str = impl_str .. "#endif //CIMGUI_IMPL_DEFINED\n"
parser2:do_parse()
save_data("./output/cimgui_impl.h",impl_str)