cbindgen/tests/rust/forward_declaration.rs
2020-11-25 17:55:58 +01:00

22 lines
305 B
Rust

#[repr(C)]
struct TypeInfo {
data: TypeData,
}
#[repr(C)]
enum TypeData {
Primitive,
Struct(StructInfo),
}
#[repr(C)]
struct StructInfo {
fields: *const *const TypeInfo, // requires forward declaration
num_fields: usize,
}
#[no_mangle]
pub extern "C" fn root(
x: TypeInfo,
) {}