Skip to content

Commit b380ff7

Browse files
DrTobeTaowyoo
authored andcommitted
Allow name-mangling for the mbedtls_free, mbedtls_calloc and mbedtls_ssl_flush_output 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 0a79c87 commit b380ff7

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
@@ -16,9 +16,9 @@ use core::ptr::NonNull;
1616
use mbedtls_sys::types::raw_types::c_void;
1717

1818
extern "C" {
19-
#[link_name = concat!("\u{1}forward_mbedtls_free_", env!("RUST_MBEDTLS_METADATA_HASH"))]
19+
#[link_name = concat!("forward_mbedtls_free_", env!("RUST_MBEDTLS_METADATA_HASH"))]
2020
pub(crate) fn mbedtls_free(n: *mut mbedtls_sys::types::raw_types::c_void);
21-
#[link_name = concat!("\u{1}forward_mbedtls_calloc_", env!("RUST_MBEDTLS_METADATA_HASH"))]
21+
#[link_name = concat!("forward_mbedtls_calloc_", env!("RUST_MBEDTLS_METADATA_HASH"))]
2222
pub(crate) fn mbedtls_calloc(
2323
n: mbedtls_sys::types::size_t,
2424
size: mbedtls_sys::types::size_t,

0 commit comments

Comments
 (0)