Skip to content

Conversation

@kentonv
Copy link
Member

@kentonv kentonv commented Nov 3, 2025

This isn't supposepd to work. In particular, expanding the include inside a namespace block puts all the symbols into the wrong namespace. However, the fact that this is a C header (wrapped in extern "C" {) coincidentally causes the misplaced symbols to end up linking correctly (because it disables complex C++ symbol names, effectively stripping the namespace prefixes). So it ended up working by accident, but we shouldn't rely on that.

This isn't supposepd to work. In particular, expanding the include _inside_ a namespace block puts all the symbols into the wrong namespace. However, the fact that this is a C header (wrapped in `extern "C" {`) coincidentally causes the misplaced symbols to end up linking correctly (because it disables complex C++ symbol names, effectively stripping the namespace prefixes). So it ended up working by accident, but we shouldn't rely on that.
@kentonv kentonv requested a review from danlapid November 3, 2025 23:54
@kentonv kentonv requested review from a team as code owners November 3, 2025 23:54
@kentonv
Copy link
Member Author

kentonv commented Nov 4, 2025

Added a second tiny drive-by to this because otherwise I was just going to send another PR to the same person.

@codspeed-hq

This comment was marked as outdated.

@danlapid
Copy link
Collaborator

danlapid commented Nov 4, 2025

Thanks!

@jasnell jasnell merged commit 0a7538d into main Nov 5, 2025
21 checks passed
@jasnell jasnell deleted the kenton/fix-include branch November 5, 2025 00:24
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.

4 participants