This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +2
-18
lines changed Expand file tree Collapse file tree 2 files changed +2
-18
lines changed Original file line number Diff line number Diff line change @@ -3,17 +3,11 @@ use std::env;
33fn main ( ) {
44 println ! ( "cargo:rerun-if-changed=build.rs" ) ;
55 let target = env:: var ( "TARGET" ) . expect ( "TARGET was not set" ) ;
6- if target. contains ( "freebsd" ) {
7- if env:: var ( "RUST_STD_FREEBSD_12_ABI" ) . is_ok ( ) {
8- println ! ( "cargo:rustc-cfg=freebsd12" ) ;
9- } else if env:: var ( "RUST_STD_FREEBSD_13_ABI" ) . is_ok ( ) {
10- println ! ( "cargo:rustc-cfg=freebsd12" ) ;
11- println ! ( "cargo:rustc-cfg=freebsd13" ) ;
12- }
13- } else if target. contains ( "linux" )
6+ if target. contains ( "linux" )
147 || target. contains ( "netbsd" )
158 || target. contains ( "dragonfly" )
169 || target. contains ( "openbsd" )
10+ || target. contains ( "freebsd" )
1711 || target. contains ( "solaris" )
1812 || target. contains ( "illumos" )
1913 || target. contains ( "apple-darwin" )
Original file line number Diff line number Diff line change @@ -76,12 +76,7 @@ impl MetadataExt for Metadata {
7676 fn as_raw_stat ( & self ) -> & raw:: stat {
7777 // The methods below use libc::stat, so they work fine when libc is built with FreeBSD 12 ABI.
7878 // This method would just return nonsense.
79- #[ cfg( freebsd12) ]
8079 panic ! ( "as_raw_stat not supported with FreeBSD 12 ABI" ) ;
81- #[ cfg( not( freebsd12) ) ]
82- unsafe {
83- & * ( self . as_inner ( ) . as_inner ( ) as * const libc:: stat as * const raw:: stat )
84- }
8580 }
8681 fn st_dev ( & self ) -> u64 {
8782 self . as_inner ( ) . as_inner ( ) . st_dev as u64
@@ -143,12 +138,7 @@ impl MetadataExt for Metadata {
143138 fn st_flags ( & self ) -> u32 {
144139 self . as_inner ( ) . as_inner ( ) . st_flags as u32
145140 }
146- #[ cfg( freebsd12) ]
147141 fn st_lspare ( & self ) -> u32 {
148142 panic ! ( "st_lspare not supported with FreeBSD 12 ABI" ) ;
149143 }
150- #[ cfg( not( freebsd12) ) ]
151- fn st_lspare ( & self ) -> u32 {
152- self . as_inner ( ) . as_inner ( ) . st_lspare as u32
153- }
154144}
You can’t perform that action at this time.
0 commit comments