mirror of
https://github.com/topjohnwu/cxx.git
synced 2024-11-24 04:20:02 +00:00
Support opaque types that are not structs
This commit is contained in:
parent
199d73509b
commit
8861bee797
@ -40,7 +40,8 @@ pub(super) fn gen(namespace: Vec<String>, apis: &[Api], types: &Types, header: b
|
|||||||
for api in apis {
|
for api in apis {
|
||||||
match api {
|
match api {
|
||||||
Api::Struct(strct) => write_struct_decl(out, &strct.ident),
|
Api::Struct(strct) => write_struct_decl(out, &strct.ident),
|
||||||
Api::CxxType(ety) | Api::RustType(ety) => write_struct_decl(out, &ety.ident),
|
Api::CxxType(ety) => write_struct_using(out, &ety.ident),
|
||||||
|
Api::RustType(ety) => write_struct_decl(out, &ety.ident),
|
||||||
_ => {}
|
_ => {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -167,6 +168,10 @@ fn write_struct_decl(out: &mut OutFile, ident: &Ident) {
|
|||||||
writeln!(out, "struct {};", ident);
|
writeln!(out, "struct {};", ident);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn write_struct_using(out: &mut OutFile, ident: &Ident) {
|
||||||
|
writeln!(out, "using {} = {};", ident, ident);
|
||||||
|
}
|
||||||
|
|
||||||
fn write_cxx_function_shim(out: &mut OutFile, efn: &ExternFn, types: &Types) {
|
fn write_cxx_function_shim(out: &mut OutFile, efn: &ExternFn, types: &Types) {
|
||||||
let indirect_return = efn
|
let indirect_return = efn
|
||||||
.ret
|
.ret
|
||||||
|
Loading…
Reference in New Issue
Block a user