1
0
Fork 0
mirror of https://github.com/ocornut/imgui.git synced 2026-01-09 23:54:20 +00:00

Amend 149587b config/build infos change to be resilient to IM_ASSERT() macros using stringification inside a list.

This commit is contained in:
ocornut 2025-11-03 14:31:14 +01:00
parent a3546b52f8
commit f1becf7e4b

View file

@ -8194,7 +8194,7 @@ void ImGui::ShowAboutWindow(bool* p_open)
// - 16 is > strlen("((void)(_EXPR))") which we suggested in our imconfig.h template as a possible way to disable. // - 16 is > strlen("((void)(_EXPR))") which we suggested in our imconfig.h template as a possible way to disable.
int assert_runs_expression = 0; int assert_runs_expression = 0;
IM_ASSERT(++assert_runs_expression); IM_ASSERT(++assert_runs_expression);
int assert_expand_len = (int)strlen(IM_STRINGIFY(IM_ASSERT(true))); int assert_expand_len = (int)strlen(IM_STRINGIFY((IM_ASSERT(true))));
bool assert_maybe_disabled = (!assert_runs_expression || assert_expand_len <= 16); bool assert_maybe_disabled = (!assert_runs_expression || assert_expand_len <= 16);
ImGui::Text("IM_ASSERT: runs expression: %s. expand size: %s%s", ImGui::Text("IM_ASSERT: runs expression: %s. expand size: %s%s",
assert_runs_expression ? "OK" : "KO", (assert_expand_len > 16) ? "OK" : "KO", assert_maybe_disabled ? " (MAYBE DISABLED?!)" : ""); assert_runs_expression ? "OK" : "KO", (assert_expand_len > 16) ? "OK" : "KO", assert_maybe_disabled ? " (MAYBE DISABLED?!)" : "");