File tree Expand file tree Collapse file tree 2 files changed +9
-5
lines changed
Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,9 @@ fn main() {
77 let target_vendor =
88 env:: var ( "CARGO_CFG_TARGET_VENDOR" ) . expect ( "CARGO_CFG_TARGET_VENDOR was not set" ) ;
99 let target_env = env:: var ( "CARGO_CFG_TARGET_ENV" ) . expect ( "CARGO_CFG_TARGET_ENV was not set" ) ;
10-
10+ if target_os == "netbsd" && env:: var ( "RUSTC_STD_NETBSD10" ) . is_ok ( ) {
11+ println ! ( "cargo:rustc-cfg=netbsd10" ) ;
12+ }
1113 if target_os == "linux"
1214 || target_os == "android"
1315 || target_os == "netbsd"
Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ mod imp {
6262 unsafe { getrandom ( buf. as_mut_ptr ( ) . cast ( ) , buf. len ( ) , libc:: GRND_NONBLOCK ) }
6363 }
6464
65- #[ cfg( any( target_os = "espidf" , target_os = "horizon" , target_os = "freebsd" ) ) ]
65+ #[ cfg( any( target_os = "espidf" , target_os = "horizon" , target_os = "freebsd" , netbsd10 ) ) ]
6666 fn getrandom ( buf : & mut [ u8 ] ) -> libc:: ssize_t {
6767 unsafe { libc:: getrandom ( buf. as_mut_ptr ( ) . cast ( ) , buf. len ( ) , 0 ) }
6868 }
@@ -72,7 +72,8 @@ mod imp {
7272 target_os = "android" ,
7373 target_os = "espidf" ,
7474 target_os = "horizon" ,
75- target_os = "freebsd"
75+ target_os = "freebsd" ,
76+ netbsd10
7677 ) ) ) ]
7778 fn getrandom_fill_bytes ( _buf : & mut [ u8 ] ) -> bool {
7879 false
@@ -83,7 +84,8 @@ mod imp {
8384 target_os = "android" ,
8485 target_os = "espidf" ,
8586 target_os = "horizon" ,
86- target_os = "freebsd"
87+ target_os = "freebsd" ,
88+ netbsd10
8789 ) ) ]
8890 fn getrandom_fill_bytes ( v : & mut [ u8 ] ) -> bool {
8991 use crate :: sync:: atomic:: { AtomicBool , Ordering } ;
@@ -230,7 +232,7 @@ mod imp {
230232}
231233
232234// FIXME: once the 10.x release becomes the minimum, this can be dropped for simplification.
233- #[ cfg( target_os = "netbsd" ) ]
235+ #[ cfg( all ( target_os = "netbsd" , not ( netbsd10 ) ) ) ]
234236mod imp {
235237 use crate :: ptr;
236238
You can’t perform that action at this time.
0 commit comments