-
Notifications
You must be signed in to change notification settings - Fork 777
Closed
Labels
A-macrosbugrust-for-linuxIssues relevant to the Rust for Linux projectIssues relevant to the Rust for Linux project
Description
--clang-macro-fallback does not work if -include is passed as a C flag.
For instance, given a header that would benefit from --clang-macro-fallback, such as:
#define F(n) n
#define N F(4)Then
bindgen x.h --clang-macro-fallbackgenerates the expected
pub const N: u32 = 4;However, if we pass an -include flag, even with an empty C header, it does not anymore:
bindgen x.h --clang-macro-fallback -- -include empty.hThis was reduced from trying to use the --clang-macro-fallback feature in the Linux kernel (mailing list post including a kernel patch to test/debug the feature), where we use a couple -include flags.
A possible workaround is to #include manually the headers at the top of the input file, and remove the -include flags.
Cc @jbaublitz
Metadata
Metadata
Assignees
Labels
A-macrosbugrust-for-linuxIssues relevant to the Rust for Linux projectIssues relevant to the Rust for Linux project