Emilio Cobos Álvarez
Emilio Cobos Álvarez
You can make it not repr(C) and cbindgen should do the right thing.
> Shouldn't that make everything within `bindings.rs` visible to cbindgen? Maybe... Do you have a link to a repro I could look at? That's much easier, because otherwise it depends...
Right, so the issue is that cbindgen most likely doesn't see across that `include!()`. `parse.expand` in the cbindgen config would do what you want... In order to make it work...
Though the nested invocations of `include!(concat!(env!(...))` sure makes it a bit more annoying than just handling `bitflags!` :)
Huh, is that a new warning? We greened up clang tests not that long ago... But yeah, this looks like an issue with the generated code, potentially. But since that...
Which version of cbindgen are you running as a dependency? I think https://github.com/eqrion/cbindgen/pull/747 should've fixed this.
If you can put together a test-case I can look into it.
Yeah, that's right. That's what we do in Firefox fwiw: * https://searchfox.org/mozilla-central/rev/168c45a7acc44e9904cfd4eebcb9eb080e05699c/config/moz.build#99-104 * https://searchfox.org/mozilla-central/rev/168c45a7acc44e9904cfd4eebcb9eb080e05699c/build/RunCbindgen.py#43-63
But we could read a `CARGOFLAGS` environment variable or something to pass extra flags if needed. You can make sure no cargo operations happen if you do something like `CARGO=/bin/false...
I can't repro, can you provide a test-case with all the options that you're giving to cbindgen? For me, this: ```rust #[repr(C)] pub enum Foo { A(B) } #[no_mangle] pub...