We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I stumbled upon a weird case... it's unlikely to appear in real code but rust supports it, so cbindgen should support it too.
rust
example.rs
#[allow(unexpected_cfgs)] #[no_mangle] pub extern "C" fn foobar(a1: u32, #[cfg(feature = "baz")] a2: u32) -> u32 { #[cfg(feature = "baz")] { a1 + a2 } #[cfg(not(feature = "baz"))] { a1 } }
cbindgen.toml
language = "C" [defines] "feature = baz" = "FEATURE_BAZ"
BAD example.h (generated)
#include <stdarg.h> #include <stdbool.h> #include <stdint.h> #include <stdlib.h> uint32_t foobar(uint32_t a1, uint32_t a2);
What would be the preferred way to handle this case?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I stumbled upon a weird case... it's unlikely to appear in real code but
rust
supports it, so cbindgen should support it too.example.rs
cbindgen.toml
BAD example.h (generated)
What would be the preferred way to handle this case?
The text was updated successfully, but these errors were encountered: