-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
zstd does #include within extern "C" scopes. This breaks trying to build a clang module. #4187
Comments
Alternatively, just have one file with all #include and then prepend that at the top of the concatenated files. |
Is the issue specific to the amalgamated single-file library ? |
Yes, from what I see one concatenated header will start an extern "C" scope, and then do #include of other zstd files. So end up with #include nested inside of these scopes. I've commented out the includes here. This is from the top of zstd.h. I've just commented out the includes. But zstd.h, zstddeclib.cpp, and zstd.cpp all have similar patterns.
|
The amalgamated single file libraries are supposed to be |
Hey @alecazam, can you share the contents of your |
Update: I was unable to repro the build failure with the info provided.
Apple clang version 15.0.0 (clang-1500.3.9.4) @alecazam can you share your repro steps? |
Describe the bug
#include should never be inside of scopes or namepsaces. But zstd seems to extern "C" and then include various headers within them. This then causes clang module building to fail. I will trying moving all of these outside of these scopes, but in general this is bad practice for code used in so many applications..
import of C++ module 'std_stdint_h' appears within extern "C" language linkage specification
To Reproduce
Steps to reproduce the behavior:
Expected behavior
All headers should just be included first and outside of any scoping. Then any concatenation should just work. extern "C" should only wrap function calls and structs for naming reasons.
Screenshots and charts
None
Desktop (please complete the following information):
Additional context
None
The text was updated successfully, but these errors were encountered: