1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#[allow(unused_macros)]
macro_rules! cfg_apple {
($($item:item)*) => {
$(
#[cfg(apple)]
#[cfg_attr(docsrs, doc(cfg(apple)))]
$item
)*
}
}
#[allow(unused_macros)]
macro_rules! only_cfg_apple {
($($item:item)*) => {
$(
#[cfg(apple)]
$item
)*
}
}
#[allow(unused_macros)]
macro_rules! only_cfg_not_apple {
($($item:item)*) => {
$(
#[cfg(not(apple))]
$item
)*
}
}
#[allow(unused_macros)]
macro_rules! cfg_bsd_multicast {
($($item:item)*) => {
$(
// DragonFly is included here so the public multicast surface
// exists on that target — but DragonFly's kernel does not
// expose multicast group enumeration via sysctl
// (`NET_RT_IFMALIST` doesn't exist; the kernel's
// `NET_RT_MAXID = 4` confirms there are only 4 selectors,
// none of them multicast). The DragonFly impl in
// `bsd_like.rs::interface_multiaddr_table` returns
// `Err(ErrorKind::Unsupported)` — see the doc comment there.
#[cfg(any(
target_vendor = "apple",
target_os = "freebsd",
target_os = "dragonfly",
))]
#[cfg_attr(
docsrs,
doc(cfg(any(
target_vendor = "apple",
target_os = "freebsd",
target_os = "dragonfly",
)))
)]
$item
)*
};
}
macro_rules! cfg_multicast {
($($item:item)*) => {
$(
#[cfg(any(
target_vendor = "apple",
target_os = "freebsd",
target_os = "dragonfly",
target_os = "linux",
windows
))]
#[cfg_attr(
docsrs,
doc(cfg(any(
target_vendor = "apple",
target_os = "freebsd",
target_os = "dragonfly",
target_os = "linux",
windows
)))
)]
$item
)*
}
}