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
defines
source (x.rs):
#[repr(C)] pub struct Foo { a: i32, #[cfg(feature = "feat")] b: i32, } impl Foo { pub const ZEROED: Self = Self { a: 0, #[cfg(feature = "feat")] b: 0, }; }
cbindgen.toml:
[export] include=["Foo"] [defines] "feature = feat" = "FEAT"
command:
cbindgen --config cbindgen.toml x.rs
actual result:
#include <cstdarg> #include <cstdint> #include <cstdlib> #include <ostream> #include <new> struct Foo { int32_t a; #if defined(FEAT) int32_t b #endif ; }; constexpr static const Foo Foo_ZEROED = Foo{ /* .a = */ 0, /* .b = */ 0 };
expected result:
#include <cstdarg> #include <cstdint> #include <cstdlib> #include <ostream> #include <new> struct Foo { int32_t a; #if defined(FEAT) int32_t b #endif ; }; constexpr static const Foo Foo_ZEROED = Foo{ /* .a = */ 0, #if defined(FEAT) /* .b = */ 0 #endif };
The text was updated successfully, but these errors were encountered:
maybe related to #937
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
source (x.rs):
cbindgen.toml:
command:
actual result:
expected result:
The text was updated successfully, but these errors were encountered: