Immediate-Mode-UI / Immediate-Mode-UI/Nuklear
Some examples can break due to dependency on headers coming from different files
- Dominant language
- C
- Stars
- 11.4k
- Forks
- 686
- Avg merge
- 4d 1h
- Merged PRs (30d)
- 3
Description
Many demo examples make an assumption that they can use symbols coming from a different file, due to indirect header inclusion. For example, `Nuklear/demo/common/overview.c` uses libm math symbols, but never includes `` or any similar header:
https://github.com/Immediate-Mode-UI/Nuklear/blob/fcd64f85e54b9d35eee13347748d70fa4d2e134e/demo/common/overview.c#L1-L3
https://github.com/Immediate-Mode-UI/Nuklear/blob/fcd64f85e54b9d35eee13347748d70fa4d2e134e/demo/common/overview.c#L754-L759
This breaks, if I try to provide my own `NK_SIN`/`NK_COS`/`STBTT_sqrt`/etc in one of the demo files, and then remove the math header there. This has happened to me when working on updated sdl3_renderer. In newer version of SDL3, `` does not pull `` any more, and provides its own version of math symbols.
### Note that `Nuklear/demo/common/overview.c` and `` is just an example here. More demos are affected by this issue due to all kinds of headers.
Contributor guide
Research direction
Start with Nuklear/demo/common/overview.c, especially the includes near lines 1-3 and math usage around lines 754-759. Inspect the other demo files for symbols supplied only through indirect header inclusion, then build the affected demos with headers such as SDL3/SDL.h no longer providing math declarations. Done means each demo includes the headers for the symbols it directly uses and still builds.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100