Skip to content

Fix missing self-contained header includes#238

Merged
yanyiwu merged 1 commit into
yanyiwu:masterfrom
frankslin:codex/self-contained-headers
Jun 22, 2026
Merged

Fix missing self-contained header includes#238
yanyiwu merged 1 commit into
yanyiwu:masterfrom
frankslin:codex/self-contained-headers

Conversation

@frankslin

Copy link
Copy Markdown
Contributor

Some stricter build environments require every public header to be self-contained. In other words, including and compiling any public header on its own must not depend on another header having happened to be included first.

SegmentTagged.hpp previously worked under the common include paths used in this repository, but it did not declare DictTrie when compiled in isolation. Similarly, HMMSegment.hpp indirectly depended on DictTrie.hpp for MIN_DOUBLE.

These implicit include dependencies can become real build failures when using stricter header parsing, modular builds, PCH/IWYU workflows, or simply a different include order. Add the missing direct includes so the affected headers are self-contained.

Some stricter build environments require every public header to be
self-contained. In other words, including and compiling any public header
on its own must not depend on another header having happened to be included
first.

`SegmentTagged.hpp` previously worked under the common include paths used in
this repository, but it did not declare `DictTrie` when compiled in isolation.
Similarly, `HMMSegment.hpp` indirectly depended on `DictTrie.hpp` for
`MIN_DOUBLE`.

These implicit include dependencies can become real build failures when using
stricter header parsing, modular builds, PCH/IWYU workflows, or simply a
different include order. Add the missing direct includes so the affected
headers are self-contained.
@yanyiwu yanyiwu merged commit 8f171de into yanyiwu:master Jun 22, 2026
33 checks passed
@frankslin frankslin deleted the codex/self-contained-headers branch June 22, 2026 13:33
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

Successfully merging this pull request may close these issues.

2 participants