File tree Expand file tree Collapse file tree 2 files changed +13
-17
lines changed Expand file tree Collapse file tree 2 files changed +13
-17
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,6 @@ fn main() {
1111 let align_cargo_feature = env:: var ( "CARGO_FEATURE_ALIGN" ) . is_ok ( ) ;
1212 let const_extern_fn_cargo_feature = env:: var ( "CARGO_FEATURE_CONST_EXTERN_FN" ) . is_ok ( ) ;
1313 let libc_ci = env:: var ( "LIBC_CI" ) . is_ok ( ) ;
14- let target = env:: var ( "TARGET" ) . unwrap ( ) ;
1514
1615 if env:: var ( "CARGO_FEATURE_USE_STD" ) . is_ok ( ) {
1716 println ! (
@@ -84,12 +83,6 @@ fn main() {
8483 }
8584 println ! ( "cargo:rustc-cfg=libc_const_extern_fn" ) ;
8685 }
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- }
9386}
9487
9588fn rustc_minor_nightly ( ) -> Option < ( u32 , bool ) > {
Original file line number Diff line number Diff line change @@ -3826,16 +3826,6 @@ extern "C" {
38263826 ) ]
38273827 pub fn getfsstat ( mntbufp : * mut statfs , bufsize : :: c_int , flags : :: c_int ) -> :: c_int ;
38283828
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-
38393829 // Copy-on-write functions.
38403830 // According to the man page `flags` is an `int` but in the header
38413831 // this is a `uint32_t`.
@@ -3855,6 +3845,19 @@ extern "C" {
38553845 ) -> :: c_int ;
38563846}
38573847
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+
38583861cfg_if ! {
38593862 if #[ cfg( any( target_arch = "arm" , target_arch = "x86" ) ) ] {
38603863 mod b32;
You can’t perform that action at this time.
0 commit comments