MCPcopy Create free account
hub / github.com/ZeroMemoryEx/Chaos-Rootkit / DebugCheckVersionAndDataLayout

Method DebugCheckVersionAndDataLayout

ring3-gui/libs/imgui/imgui.cpp:9001–9012  ·  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

8999// which is way it is required you put them in your imconfig file (and not just before including imgui.h).
9000// Otherwise it is possible that different compilation units would see different structure layout
9001bool 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)
9002{
9003 bool error = false;
9004 if (strcmp(version, IMGUI_VERSION) != 0) { error = true; IM_ASSERT(strcmp(version, IMGUI_VERSION) == 0 && "Mismatched version string!"); }
9005 if (sz_io != sizeof(ImGuiIO)) { error = true; IM_ASSERT(sz_io == sizeof(ImGuiIO) && "Mismatched struct layout!"); }
9006 if (sz_style != sizeof(ImGuiStyle)) { error = true; IM_ASSERT(sz_style == sizeof(ImGuiStyle) && "Mismatched struct layout!"); }
9007 if (sz_vec2 != sizeof(ImVec2)) { error = true; IM_ASSERT(sz_vec2 == sizeof(ImVec2) && "Mismatched struct layout!"); }
9008 if (sz_vec4 != sizeof(ImVec4)) { error = true; IM_ASSERT(sz_vec4 == sizeof(ImVec4) && "Mismatched struct layout!"); }
9009 if (sz_vert != sizeof(ImDrawVert)) { error = true; IM_ASSERT(sz_vert == sizeof(ImDrawVert) && "Mismatched struct layout!"); }
9010 if (sz_idx != sizeof(ImDrawIdx)) { error = true; IM_ASSERT(sz_idx == sizeof(ImDrawIdx) && "Mismatched struct layout!"); }
9011 return !error;
9012}
9013
9014// 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)
9015// 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