Skip to content

Wrapping code that depends on __cplusplus #391

Answered by Gnimuc
maleadt asked this question in Q&A
Discussion options

You must be logged in to vote

That code snippet is dropped by C's preprocessor, so Clang's ASTUnit can't see it. As a result, we have no choice but to add C++ support in Clang.Generators, which needs a lot of refactoring work.

Maybe it's possible to have a define for a single header file?

As long as the header is a top-level independent header and can be parsed successfully(either being parsed standalone or using -isystem tricks), you can create a separate context with dedicated compilation flags.

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@maleadt
Comment options

maleadt Oct 26, 2022
Maintainer Author

@maleadt
Comment options

maleadt Oct 26, 2022
Maintainer Author

Answer selected by maleadt
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants