@@ -18,7 +18,7 @@ use std::os::unix::io::{FromRawFd, IntoRawFd};
18
18
#[ cfg( windows) ]
19
19
use std:: os:: windows:: io:: { FromRawSocket , IntoRawSocket } ;
20
20
use std:: time:: Duration ;
21
- #[ cfg( windows) ]
21
+ #[ cfg( all ( windows, feature = "all" ) ) ]
22
22
use windows_sys:: Win32 :: Networking :: WinSock :: {
23
23
IP6T_SO_ORIGINAL_DST , SOCKET_ERROR , SOL_IP , SO_ORIGINAL_DST ,
24
24
} ;
@@ -30,8 +30,8 @@ use crate::{Domain, Protocol, SockAddr, TcpKeepalive, Type};
30
30
#[ cfg( not( target_os = "redox" ) ) ]
31
31
use crate :: { MaybeUninitSlice , MsgHdr , RecvFlags } ;
32
32
33
- #[ cfg( windows) ]
34
- #[ cfg_attr( docsrs, doc( cfg( windows) ) ) ]
33
+ #[ cfg( all ( windows, feature = "all" ) ) ]
34
+ #[ cfg_attr( docsrs, doc( cfg( all ( windows, feature = "all" ) ) ) ) ]
35
35
/// Helper macro to execute a system call that returns an `io::Result`.
36
36
macro_rules! syscall {
37
37
( $fn: ident ( $( $arg: expr) ,* $( , ) * ) , $err_test: path, $err_value: expr) => { {
@@ -47,17 +47,7 @@ macro_rules! syscall {
47
47
48
48
#[ cfg( all(
49
49
feature = "all" ,
50
- any(
51
- target_os = "android" ,
52
- target_os = "dragonfly" ,
53
- target_os = "freebsd" ,
54
- target_os = "fuchsia" ,
55
- target_os = "hurd" ,
56
- target_os = "illumos" ,
57
- target_os = "linux" ,
58
- target_os = "netbsd" ,
59
- target_os = "openbsd" ,
60
- )
50
+ any( target_os = "android" , target_os = "fuchsia" , target_os = "linux" , )
61
51
) ) ]
62
52
/// Helper macro to execute a system call that returns an `io::Result`.
63
53
macro_rules! syscall {
@@ -2257,33 +2247,13 @@ impl Socket {
2257
2247
/// redirected using `iptables` `REDIRECT` or `TPROXY`.
2258
2248
#[ cfg( all(
2259
2249
feature = "all" ,
2260
- any(
2261
- target_os = "android" ,
2262
- target_os = "dragonfly" ,
2263
- target_os = "freebsd" ,
2264
- target_os = "fuchsia" ,
2265
- target_os = "hurd" ,
2266
- target_os = "illumos" ,
2267
- target_os = "linux" ,
2268
- target_os = "netbsd" ,
2269
- target_os = "openbsd" ,
2270
- )
2250
+ any( target_os = "android" , target_os = "fuchsia" , target_os = "linux" , )
2271
2251
) ) ]
2272
2252
#[ cfg_attr(
2273
2253
docsrs,
2274
2254
doc( cfg( all(
2275
2255
feature = "all" ,
2276
- any(
2277
- target_os = "android" ,
2278
- target_os = "dragonfly" ,
2279
- target_os = "freebsd" ,
2280
- target_os = "fuchsia" ,
2281
- target_os = "hurd" ,
2282
- target_os = "illumos" ,
2283
- target_os = "linux" ,
2284
- target_os = "netbsd" ,
2285
- target_os = "openbsd" ,
2286
- )
2256
+ any( target_os = "android" , target_os = "fuchsia" , target_os = "linux" , )
2287
2257
) ) )
2288
2258
) ]
2289
2259
pub fn original_dst ( & self ) -> io:: Result < SockAddr > {
@@ -2308,33 +2278,13 @@ impl Socket {
2308
2278
/// redirected using `ip6tables` `REDIRECT` or `TPROXY`.
2309
2279
#[ cfg( all(
2310
2280
feature = "all" ,
2311
- any(
2312
- target_os = "android" ,
2313
- target_os = "dragonfly" ,
2314
- target_os = "freebsd" ,
2315
- target_os = "fuchsia" ,
2316
- target_os = "hurd" ,
2317
- target_os = "illumos" ,
2318
- target_os = "linux" ,
2319
- target_os = "netbsd" ,
2320
- target_os = "openbsd" ,
2321
- )
2281
+ any( target_os = "android" , target_os = "fuchsia" , target_os = "linux" , )
2322
2282
) ) ]
2323
2283
#[ cfg_attr(
2324
2284
docsrs,
2325
2285
doc( cfg( all(
2326
2286
feature = "all" ,
2327
- any(
2328
- target_os = "android" ,
2329
- target_os = "dragonfly" ,
2330
- target_os = "freebsd" ,
2331
- target_os = "fuchsia" ,
2332
- target_os = "hurd" ,
2333
- target_os = "illumos" ,
2334
- target_os = "linux" ,
2335
- target_os = "netbsd" ,
2336
- target_os = "openbsd" ,
2337
- )
2287
+ any( target_os = "android" , target_os = "fuchsia" , target_os = "linux" , )
2338
2288
) ) )
2339
2289
) ]
2340
2290
pub fn original_dst_ipv6 ( & self ) -> io:: Result < SockAddr > {
@@ -2361,8 +2311,8 @@ impl Socket {
2361
2311
/// created by your proxy in order for any OS level firewall rules to be
2362
2312
/// applied. Read more in the Windows bind and connect redirection
2363
2313
/// [documentation](https://learn.microsoft.com/en-us/windows-hardware/drivers/network/using-bind-or-connect-redirection).
2364
- #[ cfg( windows) ]
2365
- #[ cfg_attr( docsrs, doc( cfg( windows) ) ) ]
2314
+ #[ cfg( all ( windows, feature = "all" ) ) ]
2315
+ #[ cfg_attr( docsrs, doc( cfg( all ( windows, feature = "all" ) ) ) ) ]
2366
2316
pub fn original_dst ( & self ) -> io:: Result < SockAddr > {
2367
2317
unsafe {
2368
2318
SockAddr :: try_init ( |storage, len| {
@@ -2390,8 +2340,8 @@ impl Socket {
2390
2340
/// created by your proxy in order for any OS level firewall rules to be
2391
2341
/// applied. Read more in the Windows bind and connect redirection
2392
2342
/// [documentation](https://learn.microsoft.com/en-us/windows-hardware/drivers/network/using-bind-or-connect-redirection).
2393
- #[ cfg( windows) ]
2394
- #[ cfg_attr( docsrs, doc( cfg( windows) ) ) ]
2343
+ #[ cfg( all ( windows, feature = "all" ) ) ]
2344
+ #[ cfg_attr( docsrs, doc( cfg( all ( windows, feature = "all" ) ) ) ) ]
2395
2345
pub fn original_dst_ipv6 ( & self ) -> io:: Result < SockAddr > {
2396
2346
unsafe {
2397
2347
SockAddr :: try_init ( |storage, len| {
0 commit comments