MCPcopy Create free account
hub / github.com/clementgallet/libTAS / DebugCheckVersionAndDataLayout

Method DebugCheckVersionAndDataLayout

src/external/imgui/imgui.cpp:9313–9324  ·  view source on GitHub ↗

Helper function to verify ABI compatibility between caller code and compiled version of Dear ImGui. Verify that the type sizes are matching between the calling file's compilation unit and imgui.cpp's compilation unit If this triggers you have an issue: - Most commonly: mismatched headers and compiled code version. - Or: mismatched configuration #define, compilation settings, packing pragma etc. Th

Source from the content-addressed store, hash-verified

9311// which is way it is required you put them in your imconfig file (and not just before including imgui.h).
9312// Otherwise it is possible that different compilation units would see different structure layout
9313bool ImGui::DebugCheckVersionAndDataLayout(const char* version, size_t sz_io, size_t sz_style, size_t sz_vec2, size_t sz_vec4, size_t sz_vert, size_t sz_idx)
9314{
9315 bool error = false;
9316 if (strcmp(version, IMGUI_VERSION) != 0) { error = true; IM_ASSERT(strcmp(version, IMGUI_VERSION) == 0 && "Mismatched version string!"); }
9317 if (sz_io != sizeof(ImGuiIO)) { error = true; IM_ASSERT(sz_io == sizeof(ImGuiIO) && "Mismatched struct layout!"); }
9318 if (sz_style != sizeof(ImGuiStyle)) { error = true; IM_ASSERT(sz_style == sizeof(ImGuiStyle) && "Mismatched struct layout!"); }
9319 if (sz_vec2 != sizeof(ImVec2)) { error = true; IM_ASSERT(sz_vec2 == sizeof(ImVec2) && "Mismatched struct layout!"); }
9320 if (sz_vec4 != sizeof(ImVec4)) { error = true; IM_ASSERT(sz_vec4 == sizeof(ImVec4) && "Mismatched struct layout!"); }
9321 if (sz_vert != sizeof(ImDrawVert)) { error = true; IM_ASSERT(sz_vert == sizeof(ImDrawVert) && "Mismatched struct layout!"); }
9322 if (sz_idx != sizeof(ImDrawIdx)) { error = true; IM_ASSERT(sz_idx == sizeof(ImDrawIdx) && "Mismatched struct layout!"); }
9323 return !error;
9324}
9325
9326// Until 1.89 (IMGUI_VERSION_NUM < 18814) it was legal to use SetCursorPos() to extend the boundary of a parent (e.g. window or table cell)
9327// This is causing issues and ambiguity and we need to retire that.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected