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() {
7
7
let target_vendor =
8
8
env:: var ( "CARGO_CFG_TARGET_VENDOR" ) . expect ( "CARGO_CFG_TARGET_VENDOR was not set" ) ;
9
9
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
+ }
11
13
if target_os == "linux"
12
14
|| target_os == "android"
13
15
|| target_os == "netbsd"
Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ mod imp {
62
62
unsafe { getrandom ( buf. as_mut_ptr ( ) . cast ( ) , buf. len ( ) , libc:: GRND_NONBLOCK ) }
63
63
}
64
64
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 ) ) ]
66
66
fn getrandom ( buf : & mut [ u8 ] ) -> libc:: ssize_t {
67
67
unsafe { libc:: getrandom ( buf. as_mut_ptr ( ) . cast ( ) , buf. len ( ) , 0 ) }
68
68
}
@@ -72,7 +72,8 @@ mod imp {
72
72
target_os = "android" ,
73
73
target_os = "espidf" ,
74
74
target_os = "horizon" ,
75
- target_os = "freebsd"
75
+ target_os = "freebsd" ,
76
+ netbsd10
76
77
) ) ) ]
77
78
fn getrandom_fill_bytes ( _buf : & mut [ u8 ] ) -> bool {
78
79
false
@@ -83,7 +84,8 @@ mod imp {
83
84
target_os = "android" ,
84
85
target_os = "espidf" ,
85
86
target_os = "horizon" ,
86
- target_os = "freebsd"
87
+ target_os = "freebsd" ,
88
+ netbsd10
87
89
) ) ]
88
90
fn getrandom_fill_bytes ( v : & mut [ u8 ] ) -> bool {
89
91
use crate :: sync:: atomic:: { AtomicBool , Ordering } ;
@@ -230,7 +232,7 @@ mod imp {
230
232
}
231
233
232
234
// 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 ) ) ) ]
234
236
mod imp {
235
237
use crate :: ptr;
236
238
You can’t perform that action at this time.
0 commit comments