From: Matt Corallo Date: Mon, 16 Oct 2023 01:35:28 +0000 (+0000) Subject: Drop `#[no_mangle]` from `*_write_void` to make cbindgen not export X-Git-Tag: v0.0.118.0^2~5 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=ed96ce032ac607694f7716a73c28a75eb056953a;p=ldk-c-bindings Drop `#[no_mangle]` from `*_write_void` to make cbindgen not export cbindgen recently switched to exporting all `#[no_mangle]` and `extern "C"` functions. Our `*_write_void` methods are internal-only but we'd marked them `#[no_mangle]`, which resulted in them spuriously appearing in `lightning.h`. --- diff --git a/c-bindings-gen/src/main.rs b/c-bindings-gen/src/main.rs index 22eabf7..6853534 100644 --- a/c-bindings-gen/src/main.rs +++ b/c-bindings-gen/src/main.rs @@ -95,7 +95,6 @@ fn maybe_convert_trait_impl(w: &mut W, trait_path: &syn::Path writeln!(w, "}}").unwrap(); if has_inner { - writeln!(w, "#[no_mangle]").unwrap(); writeln!(w, "pub(crate) extern \"C\" fn {}_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {{", for_obj).unwrap(); writeln!(w, "\tcrate::c_types::serialize_obj(unsafe {{ &*(obj as *const native{}) }})", for_obj).unwrap(); writeln!(w, "}}").unwrap();