Skip to content

Commit d533842

Browse files
committed
Allow name-mangling for the mbedtls_free and mbedtls_calloc functions
According to the discussion in rust-lang/rust-bindgen#1221 (comment), the \u{1} is a hint to LLVM to avoid name-mangling but this might be required on some platforms to link against the right name, e.g. on macOS.
1 parent f9fefe0 commit d533842

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

mbedtls/src/alloc.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ use core::mem::ManuallyDrop;
1515
use mbedtls_sys::types::raw_types::c_void;
1616

1717
extern "C" {
18-
#[link_name = concat!("\u{1}forward_mbedtls_free_", env!("RUST_MBEDTLS_METADATA_HASH"))]
18+
#[link_name = concat!("forward_mbedtls_free_", env!("RUST_MBEDTLS_METADATA_HASH"))]
1919
pub(crate) fn mbedtls_free(n: *mut mbedtls_sys::types::raw_types::c_void);
20-
#[link_name = concat!("\u{1}forward_mbedtls_calloc_", env!("RUST_MBEDTLS_METADATA_HASH"))]
20+
#[link_name = concat!("forward_mbedtls_calloc_", env!("RUST_MBEDTLS_METADATA_HASH"))]
2121
pub(crate) fn mbedtls_calloc(n: mbedtls_sys::types::size_t, size: mbedtls_sys::types::size_t) -> *mut mbedtls_sys::types::raw_types::c_void;
2222
}
2323

0 commit comments

Comments
 (0)