Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IM_ASSERT redefined to SDL_assert makes imgui.cpp not compilable #5376

Closed
WSSDude opened this issue Jun 5, 2022 · 1 comment
Closed

IM_ASSERT redefined to SDL_assert makes imgui.cpp not compilable #5376

WSSDude opened this issue Jun 5, 2022 · 1 comment

Comments

@WSSDude
Copy link

WSSDude commented Jun 5, 2022

Version/Branch of Dear ImGui:

Version: 1.88 WIP
Branch: docking

Back-end/Renderer/Compiler/OS

Back-ends: Custom
Compiler: Clang (VS22 package version)
Operating System: Windows 11

My Issue/Question:

https://github.com/ocornut/imgui/blob/docking/imgui.cpp#L15661
This line is making imgui.cpp not compiling when replacing IM_ASSERT macro with SDL_assert macro in imconfig.h due to usage of sizeof on bitfield member in release mode.

In release mode, macro resolves to SDL_disabled_assert which in turn resolves to an expression where condition is passed into sizeof operator. They had some reasonings for having it this way in comments right above.

Solution to this issue seems to be simple on ImGui side - make that line read IM_ASSERT(ref_node_for_rect->IsVisible == 1); instead or similar to make it an explicit condition.

@ocornut
Copy link
Owner

ocornut commented Jun 5, 2022

Merged fix, thank you!

@ocornut ocornut closed this as completed Jun 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants