File tree Expand file tree Collapse file tree 2 files changed +21
-29
lines changed Expand file tree Collapse file tree 2 files changed +21
-29
lines changed Original file line number Diff line number Diff line change 277
277
#![ feature( allow_internal_unstable) ]
278
278
#![ feature( asm_experimental_arch) ]
279
279
#![ feature( autodiff) ]
280
+ #![ feature( cfg_match) ]
280
281
#![ feature( cfg_sanitizer_cfi) ]
281
282
#![ feature( cfg_target_thread_local) ]
282
283
#![ feature( cfi_encoding) ]
Original file line number Diff line number Diff line change 1
- #[ cfg( any(
2
- target_os = "linux" ,
3
- target_os = "android" ,
4
- target_os = "dragonfly" ,
5
- target_os = "freebsd" ,
6
- target_os = "openbsd" ,
7
- target_os = "netbsd" ,
8
- target_os = "solaris" ,
9
- target_os = "illumos" ,
10
- target_os = "haiku" ,
11
- target_os = "nto" ,
12
- target_os = "cygwin"
13
- ) ) ]
14
- use libc:: MSG_NOSIGNAL ;
1
+ cfg_match ! {
2
+ any(
3
+ target_os = "linux" ,
4
+ target_os = "android" ,
5
+ target_os = "dragonfly" ,
6
+ target_os = "freebsd" ,
7
+ target_os = "openbsd" ,
8
+ target_os = "netbsd" ,
9
+ target_os = "solaris" ,
10
+ target_os = "illumos" ,
11
+ target_os = "haiku" ,
12
+ target_os = "nto" ,
13
+ target_os = "cygwin"
14
+ ) => {
15
+ use libc:: MSG_NOSIGNAL ;
16
+ }
17
+ _ => {
18
+ const MSG_NOSIGNAL : core:: ffi:: c_int = 0x0 ;
19
+ }
20
+ }
15
21
16
22
use super :: { SocketAddr , sockaddr_un} ;
17
23
#[ cfg( any( doc, target_os = "android" , target_os = "linux" ) ) ]
@@ -40,21 +46,6 @@ use crate::sys_common::{AsInner, FromInner};
40
46
use crate :: time:: Duration ;
41
47
use crate :: { cmp, fmt} ;
42
48
43
- #[ cfg( not( any(
44
- target_os = "linux" ,
45
- target_os = "android" ,
46
- target_os = "dragonfly" ,
47
- target_os = "freebsd" ,
48
- target_os = "openbsd" ,
49
- target_os = "netbsd" ,
50
- target_os = "solaris" ,
51
- target_os = "illumos" ,
52
- target_os = "haiku" ,
53
- target_os = "nto" ,
54
- target_os = "cygwin"
55
- ) ) ) ]
56
- const MSG_NOSIGNAL : core:: ffi:: c_int = 0x0 ;
57
-
58
49
/// A Unix stream socket.
59
50
///
60
51
/// # Examples
You can’t perform that action at this time.
0 commit comments