Open jrmuizel opened 5 years ago
#[repr(C)] enum Foo { A([f32; 20]) } #[no_mangle] pub extern "C" fn root(a: Foo) {}
with
[enum] derive_helper_methods = true
gives
#include <cstdint> #include <cstdlib> struct Foo { enum class Tag { A, }; struct A_Body { float _0[20]; }; Tag tag; union { A_Body a; }; static Foo A(float const& a0[20]) { Foo result; result.a._0 = a0; result.tag = Tag::A; return result; } bool IsA() const { return tag == Tag::A; } }; extern "C" { void root(Foo a); } // extern "C"
which fails to build with:
/tmp/out.cc:18:31: error: 'a0' declared as array of references of type 'const float &' static Foo A(float const& a0[20]) {
This is needed for generating bindings for FiliterOp: https://github.com/servo/webrender/blob/2b64aec136ad778204116080d51743e152580b60/webrender_api/src/display_item.rs#L614
I have WIP up at https://github.com/jrmuizel/cbindgen/tree/more-ref
with
gives
which fails to build with:
This is needed for generating bindings for FiliterOp: https://github.com/servo/webrender/blob/2b64aec136ad778204116080d51743e152580b60/webrender_api/src/display_item.rs#L614