From 2121a36bfeaad4ddd991c69aac8d0e09149ffbf0 Mon Sep 17 00:00:00 2001 From: Lars-Magnus Skog Date: Fri, 26 Apr 2019 21:34:24 +0200 Subject: [PATCH 1/2] Remove mangling for dc_strbuilder_cat() and dc_strdup() --- src/dc_strbuilder.rs | 1 - src/dc_tools.rs | 1 - 2 files changed, 2 deletions(-) diff --git a/src/dc_strbuilder.rs b/src/dc_strbuilder.rs index 4b3834d52..1ad2e7a62 100644 --- a/src/dc_strbuilder.rs +++ b/src/dc_strbuilder.rs @@ -33,7 +33,6 @@ pub unsafe extern "C" fn dc_strbuilder_init( (*strbuilder).free = (*strbuilder).allocated - 1i32; (*strbuilder).eos = (*strbuilder).buf; } -#[no_mangle] pub unsafe extern "C" fn dc_strbuilder_cat( mut strbuilder: *mut dc_strbuilder_t, mut text: *const libc::c_char, diff --git a/src/dc_tools.rs b/src/dc_tools.rs index 0289c7e4d..a7bb27a0a 100644 --- a/src/dc_tools.rs +++ b/src/dc_tools.rs @@ -19,7 +19,6 @@ pub unsafe extern "C" fn dc_exactly_one_bit_set(mut v: libc::c_int) -> libc::c_i } /* string tools */ /* dc_strdup() returns empty string if NULL is given, never returns NULL (exits on errors) */ -#[no_mangle] pub unsafe extern "C" fn dc_strdup(mut s: *const libc::c_char) -> *mut libc::c_char { let mut ret: *mut libc::c_char = 0 as *mut libc::c_char; if !s.is_null() { From e16ed512350e0415b3c6a1d79882e054c8d5da66 Mon Sep 17 00:00:00 2001 From: Lars-Magnus Skog Date: Fri, 26 Apr 2019 21:34:52 +0200 Subject: [PATCH 2/2] Move dylib iconv to apple specifics (not needed on linux) --- build.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.rs b/build.rs index a8eb6d80b..44b5c509a 100644 --- a/build.rs +++ b/build.rs @@ -15,7 +15,6 @@ fn main() { println!("cargo:rustc-link-search=/usr/local/lib"); println!("cargo:rustc-link-lib=static=etpan"); - println!("cargo:rustc-link-lib=dylib=iconv"); println!("cargo:rustc-link-lib=dylib=sasl2"); println!("cargo:rustc-link-lib=dylib=z"); @@ -24,6 +23,7 @@ fn main() { println!("cargo:rustc-link-lib=dylib=tools"); if std::env::var("TARGET").unwrap().contains("-apple") { + println!("cargo:rustc-link-lib=dylib=iconv"); println!("cargo:rustc-link-lib=framework=CoreFoundation"); println!("cargo:rustc-link-lib=framework=CoreServices"); println!("cargo:rustc-link-lib=framework=Security");