You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While conditional compilation works fine withinextern "C" blocks, annotating an entire extern "C" block with #[cfg()] is valid in Rust, but doesn't work in cbindgen.
For example, for the following Rust project:
# Cargo.toml
[package]
name = "extern_block_conditional"version = "0.1.0"authors = ["cbindgen"]
[lib]
name = "extern_block_conditional"crate-type = ["lib", "dylib"]
features = [ "myfeature" ]
While conditional compilation works fine within
extern "C"
blocks, annotating an entireextern "C"
block with#[cfg()]
is valid in Rust, but doesn't work in cbindgen.For example, for the following Rust project:
I would expect the following C output:
But in fact, writing this as a test case in this project, the output I see is:
cc @katef
The text was updated successfully, but these errors were encountered: