X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=c-bindings-gen%2Fsrc%2Fmain.rs;h=9d6f9cfeadad7717594a5d878d19e2a0ac2a1af2;hb=a89709db0fdd79f00e3a6c9bede01ec2089255fb;hp=46ae0e75fc5580262901f91af19f68b16dfe728d;hpb=d25cffee0dfb879d827717d4d90a1b4d184eed0a;p=ldk-c-bindings diff --git a/c-bindings-gen/src/main.rs b/c-bindings-gen/src/main.rs index 46ae0e7..9d6f9cf 100644 --- a/c-bindings-gen/src/main.rs +++ b/c-bindings-gen/src/main.rs @@ -1853,7 +1853,8 @@ fn walk_ast<'a>(ast_storage: &'a FullLibraryAST, crate_types: &mut CrateTypes<'a syn::Item::Impl(i) => { if let &syn::Type::Path(ref p) = &*i.self_ty { if let Some(trait_path) = i.trait_.as_ref() { - if path_matches_nongeneric(&trait_path.1, &["core", "clone", "Clone"]) { + if path_matches_nongeneric(&trait_path.1, &["core", "clone", "Clone"]) || + path_matches_nongeneric(&trait_path.1, &["Clone"]) { if let Some(full_path) = import_resolver.maybe_resolve_path(&p.path, None) { crate_types.set_clonable("crate::".to_owned() + &full_path); } @@ -1904,6 +1905,9 @@ fn main() { writeln!(header_file, "#endif").unwrap(); writeln!(cpp_header_file, "#include \nnamespace LDK {{").unwrap(); + // Write a few manually-defined types into the C++ header file + write_cpp_wrapper(&mut cpp_header_file, "Str", true, None); + // First parse the full crate's ASTs, caching them so that we can hold references to the AST // objects in other datastructures: let mut lib_src = String::new();