Skip to content

fix: include system headers outside extern "C" - #1125

Open
ameliabarnabyhub wants to merge 1 commit into
Cyan4973:devfrom
ameliabarnabyhub:fix/extern-c-system-headers-1122
Open

fix: include system headers outside extern "C"#1125
ameliabarnabyhub wants to merge 1 commit into
Cyan4973:devfrom
ameliabarnabyhub:fix/extern-c-system-headers-1122

Conversation

@ameliabarnabyhub

Copy link
Copy Markdown

Fixes #1122

Summary

  • System headers must not be included inside an extern "C" region (can force C linkage onto C++ declarations, e.g. arm_neon.h on aarch64 GCC 17).
  • Add XXH_EXTERNC_PAUSE / XXH_EXTERNC_RESUME helpers and wrap all system #includes so they are processed outside extern "C".

Test plan

  • C++ compile that previously failed with arm_neon.h conflicting C vs C++ linkage now succeeds.
  • Existing xxHash C and C++ builds / tests still pass.

Signed-off-by: ameliabarnabyhub <ameliabarnabyhub@users.noreply.github.com>
@ameliabarnabyhub ameliabarnabyhub changed the title fix: include system headers outside extern C fix: include system headers outside extern "C" Aug 16, 2026
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.

<xxhash.h> includes system headers inside extern "C" block

1 participant