Source code

Revision control

Copy as Markdown

Other Tools

---
source: macro/src/lib.rs
expression: "rustfmt_code(&gen_bridge(parse_quote! {\n mod ffi\n {\n #[diplomat :: opaque] #[cfg(feature = \"foo\")] struct Foo {}\n #[cfg(feature = \"foo\")] impl Foo\n { pub fn bar(s : u8) { unimplemented! () } }\n }\n }).to_token_stream().to_string())"
---
mod ffi {
#[cfg(feature = "foo")]
struct Foo {}
#[cfg(feature = "foo")]
impl Foo {
pub fn bar(s: u8) {
unimplemented!()
}
}
use diplomat_runtime::*;
#[no_mangle]
#[cfg(feature = "foo")]
extern "C" fn Foo_bar(s: u8) {
Foo::bar(s)
}
#[no_mangle]
#[cfg(feature = "foo")]
extern "C" fn Foo_destroy(this: Box<Foo>) {}
}