File tree 2 files changed +13
-17
lines changed
2 files changed +13
-17
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,6 @@ fn main() {
11
11
let align_cargo_feature = env:: var ( "CARGO_FEATURE_ALIGN" ) . is_ok ( ) ;
12
12
let const_extern_fn_cargo_feature = env:: var ( "CARGO_FEATURE_CONST_EXTERN_FN" ) . is_ok ( ) ;
13
13
let libc_ci = env:: var ( "LIBC_CI" ) . is_ok ( ) ;
14
- let target = env:: var ( "TARGET" ) . unwrap ( ) ;
15
14
16
15
if env:: var ( "CARGO_FEATURE_USE_STD" ) . is_ok ( ) {
17
16
println ! (
@@ -84,12 +83,6 @@ fn main() {
84
83
}
85
84
println ! ( "cargo:rustc-cfg=libc_const_extern_fn" ) ;
86
85
}
87
-
88
- // For unknown reason, libiconv can't be linked by adding #[link(name = iconv)] to
89
- // a macOS-specific struct, so we do the linking here.
90
- if target. contains ( "-apple-" ) {
91
- println ! ( "cargo:rustc-link-lib=iconv" ) ;
92
- }
93
86
}
94
87
95
88
fn rustc_minor_nightly ( ) -> Option < ( u32 , bool ) > {
Original file line number Diff line number Diff line change @@ -3826,16 +3826,6 @@ extern "C" {
3826
3826
) ]
3827
3827
pub fn getfsstat ( mntbufp : * mut statfs , bufsize : :: c_int , flags : :: c_int ) -> :: c_int ;
3828
3828
3829
- pub fn iconv_open ( tocode : * const :: c_char , fromcode : * const :: c_char ) -> iconv_t ;
3830
- pub fn iconv (
3831
- cd : iconv_t ,
3832
- inbuf : * mut * mut :: c_char ,
3833
- inbytesleft : * mut :: size_t ,
3834
- outbuf : * mut * mut :: c_char ,
3835
- outbytesleft : * mut :: size_t ,
3836
- ) -> :: size_t ;
3837
- pub fn iconv_close ( cd : iconv_t ) -> :: c_int ;
3838
-
3839
3829
// Copy-on-write functions.
3840
3830
// According to the man page `flags` is an `int` but in the header
3841
3831
// this is a `uint32_t`.
@@ -3855,6 +3845,19 @@ extern "C" {
3855
3845
) -> :: c_int ;
3856
3846
}
3857
3847
3848
+ #[ link( name = "iconv" ) ]
3849
+ extern "C" {
3850
+ pub fn iconv_open ( tocode : * const :: c_char , fromcode : * const :: c_char ) -> iconv_t ;
3851
+ pub fn iconv (
3852
+ cd : iconv_t ,
3853
+ inbuf : * mut * mut :: c_char ,
3854
+ inbytesleft : * mut :: size_t ,
3855
+ outbuf : * mut * mut :: c_char ,
3856
+ outbytesleft : * mut :: size_t ,
3857
+ ) -> :: size_t ;
3858
+ pub fn iconv_close ( cd : iconv_t ) -> :: c_int ;
3859
+ }
3860
+
3858
3861
cfg_if ! {
3859
3862
if #[ cfg( any( target_arch = "arm" , target_arch = "x86" ) ) ] {
3860
3863
mod b32;
You can’t perform that action at this time.
0 commit comments