Skip to content

Commit 1af6aca

Browse files
committed
Rebase
1 parent 3ca9f00 commit 1af6aca

File tree

1 file changed

+47
-71
lines changed

1 file changed

+47
-71
lines changed

src/sys/socket/mod.rs

Lines changed: 47 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -822,43 +822,41 @@ pub enum ControlMessageOwned {
822822
TlsGetRecordType(TlsGetRecordType),
823823

824824
#[cfg(any(
825-
target_os = "freebsd",
826825
apple_targets,
826+
linux_android
827+
target_os = "freebsd",
827828
target_os = "netbsd",
828829
target_os = "openbsd",
829-
target_os = "android",
830-
target_os = "linux",
831830
))]
832831
#[cfg(feature = "net")]
833832
IpTos(u8),
833+
834834
#[cfg(any(
835-
target_os = "freebsd",
836835
apple_targets,
836+
linux_android
837+
target_os = "freebsd",
837838
target_os = "netbsd",
838839
target_os = "openbsd",
839-
target_os = "android",
840-
target_os = "linux",
841840
))]
842841
#[cfg(feature = "net")]
843842
Ipv6TClass(u8),
844843

845844
#[cfg(any(
846-
target_os = "freebsd",
847845
apple_targets,
846+
linux_android
847+
target_os = "freebsd",
848848
target_os = "netbsd",
849849
target_os = "openbsd",
850-
target_os = "android",
851-
target_os = "linux",
852850
))]
853851
#[cfg(feature = "net")]
854852
IpTtl(u8),
853+
855854
#[cfg(any(
856-
target_os = "freebsd",
857855
apple_targets,
856+
linux_android
857+
target_os = "freebsd",
858858
target_os = "netbsd",
859859
target_os = "openbsd",
860-
target_os = "android",
861-
target_os = "linux",
862860
))]
863861
#[cfg(feature = "net")]
864862
Ipv6HopLimit(u8),
@@ -1063,22 +1061,18 @@ impl ControlMessageOwned {
10631061
let tos = unsafe { ptr::read_unaligned(p as *const u8) };
10641062
ControlMessageOwned::IpTos(tos.into())
10651063
},
1066-
#[cfg(any(
1067-
target_os = "android",
1068-
target_os = "linux",
1069-
))]
1064+
#[cfg(linux_android)]
10701065
#[cfg(feature = "net")]
10711066
(libc::IPPROTO_IP, libc::IP_TOS) => {
10721067
let tos = unsafe { ptr::read_unaligned(p as *const u8) };
10731068
ControlMessageOwned::IpTos(tos.into())
10741069
},
10751070
#[cfg(any(
1076-
target_os = "freebsd",
10771071
apple_targets,
1072+
linux_android
1073+
target_os = "freebsd",
10781074
target_os = "netbsd",
10791075
target_os = "openbsd",
1080-
target_os = "android",
1081-
target_os = "linux",
10821076
))]
10831077
#[cfg(feature = "net")]
10841078
(libc::IPPROTO_IPV6, libc::IPV6_TCLASS) => {
@@ -1096,22 +1090,18 @@ impl ControlMessageOwned {
10961090
let ttl = unsafe { ptr::read_unaligned(p as *const u8) };
10971091
ControlMessageOwned::IpTtl(ttl.into())
10981092
},
1099-
#[cfg(any(
1100-
target_os = "android",
1101-
target_os = "linux",
1102-
))]
1093+
#[cfg(linux_android)]
11031094
#[cfg(feature = "net")]
11041095
(libc::IPPROTO_IP, libc::IP_TTL) => {
11051096
let ttl = unsafe { ptr::read_unaligned(p as *const u8) };
11061097
ControlMessageOwned::IpTtl(ttl.into())
11071098
},
11081099
#[cfg(any(
1109-
target_os = "freebsd",
11101100
apple_targets,
1101+
linux_android
1102+
target_os = "freebsd",
11111103
target_os = "netbsd",
11121104
target_os = "openbsd",
1113-
target_os = "android",
1114-
target_os = "linux",
11151105
))]
11161106
#[cfg(feature = "net")]
11171107
(libc::IPPROTO_IPV6, libc::IPV6_HOPLIMIT) => {
@@ -1288,33 +1278,31 @@ pub enum ControlMessage<'a> {
12881278
TxTime(&'a u64),
12891279

12901280
#[cfg(any(
1291-
target_os = "freebsd",
12921281
apple_targets,
1282+
linux_android,
1283+
target_os = "freebsd",
12931284
target_os = "netbsd",
12941285
target_os = "openbsd",
1295-
target_os = "android",
1296-
target_os = "linux",
12971286
))]
12981287
#[cfg(feature = "net")]
12991288
IpTos(&'a libc::c_int),
1289+
13001290
#[cfg(any(
1301-
target_os = "freebsd",
13021291
apple_targets,
1292+
linux_android,
1293+
target_os = "freebsd",
13031294
target_os = "netbsd",
13041295
target_os = "openbsd",
1305-
target_os = "android",
1306-
target_os = "linux",
13071296
))]
13081297
#[cfg(feature = "net")]
13091298
Ipv6TClass(&'a libc::c_int),
13101299

13111300
#[cfg(any(
1312-
target_os = "freebsd",
13131301
apple_targets,
1302+
linux_android,
1303+
target_os = "freebsd",
13141304
target_os = "netbsd",
13151305
target_os = "openbsd",
1316-
target_os = "android",
1317-
target_os = "linux",
13181306
))]
13191307
#[cfg(feature = "net")]
13201308
IpTtl(&'a libc::c_int),
@@ -1423,36 +1411,33 @@ impl<'a> ControlMessage<'a> {
14231411
tx_time as *const _ as *const u8
14241412
},
14251413
#[cfg(any(
1426-
target_os = "freebsd",
14271414
apple_targets,
1415+
linux_android,
1416+
target_os = "freebsd",
14281417
target_os = "netbsd",
14291418
target_os = "openbsd",
1430-
target_os = "android",
1431-
target_os = "linux",
14321419
))]
14331420
#[cfg(feature = "net")]
14341421
ControlMessage::IpTos(tos) => {
14351422
tos as *const _ as *const u8
14361423
},
14371424
#[cfg(any(
1438-
target_os = "freebsd",
14391425
apple_targets,
1426+
linux_android,
1427+
target_os = "freebsd",
14401428
target_os = "netbsd",
14411429
target_os = "openbsd",
1442-
target_os = "android",
1443-
target_os = "linux",
14441430
))]
14451431
#[cfg(feature = "net")]
14461432
ControlMessage::Ipv6TClass(tclass) => {
14471433
tclass as *const _ as *const u8
14481434
},
14491435
#[cfg(any(
1450-
target_os = "freebsd",
14511436
apple_targets,
1437+
linux_android,
1438+
target_os = "freebsd",
14521439
target_os = "netbsd",
14531440
target_os = "openbsd",
1454-
target_os = "android",
1455-
target_os = "linux",
14561441
))]
14571442
#[cfg(feature = "net")]
14581443
ControlMessage::IpTtl(ttl) => {
@@ -1523,36 +1508,33 @@ impl<'a> ControlMessage<'a> {
15231508
mem::size_of_val(tx_time)
15241509
},
15251510
#[cfg(any(
1526-
target_os = "freebsd",
15271511
apple_targets,
1512+
linux_android,
1513+
target_os = "freebsd",
15281514
target_os = "netbsd",
15291515
target_os = "openbsd",
1530-
target_os = "android",
1531-
target_os = "linux",
15321516
))]
15331517
#[cfg(feature = "net")]
15341518
ControlMessage::IpTos(tos) => {
15351519
mem::size_of_val(tos)
15361520
},
15371521
#[cfg(any(
1538-
target_os = "freebsd",
15391522
apple_targets,
1523+
linux_android,
1524+
target_os = "freebsd",
15401525
target_os = "netbsd",
15411526
target_os = "openbsd",
1542-
target_os = "android",
1543-
target_os = "linux",
15441527
))]
15451528
#[cfg(feature = "net")]
15461529
ControlMessage::Ipv6TClass(tclass) => {
15471530
mem::size_of_val(tclass)
15481531
},
15491532
#[cfg(any(
1550-
target_os = "freebsd",
15511533
apple_targets,
1534+
linux_android,
1535+
target_os = "freebsd",
15521536
target_os = "netbsd",
15531537
target_os = "openbsd",
1554-
target_os = "android",
1555-
target_os = "linux",
15561538
))]
15571539
#[cfg(feature = "net")]
15581540
ControlMessage::IpTtl(ttl) => {
@@ -1593,32 +1575,29 @@ impl<'a> ControlMessage<'a> {
15931575
#[cfg(target_os = "linux")]
15941576
ControlMessage::TxTime(_) => libc::SOL_SOCKET,
15951577
#[cfg(any(
1596-
target_os = "freebsd",
15971578
apple_targets,
1579+
linux_android,
1580+
target_os = "freebsd",
15981581
target_os = "netbsd",
15991582
target_os = "openbsd",
1600-
target_os = "android",
1601-
target_os = "linux",
16021583
))]
16031584
#[cfg(feature = "net")]
16041585
ControlMessage::IpTos(_) => libc::IPPROTO_IP,
16051586
#[cfg(any(
1606-
target_os = "freebsd",
16071587
apple_targets,
1588+
linux_android,
1589+
target_os = "freebsd",
16081590
target_os = "netbsd",
16091591
target_os = "openbsd",
1610-
target_os = "android",
1611-
target_os = "linux",
16121592
))]
16131593
#[cfg(feature = "net")]
16141594
ControlMessage::Ipv6TClass(_) => libc::IPPROTO_IPV6,
16151595
#[cfg(any(
1616-
target_os = "freebsd",
16171596
apple_targets,
1597+
linux_android,
1598+
target_os = "freebsd",
16181599
target_os = "netbsd",
16191600
target_os = "openbsd",
1620-
target_os = "android",
1621-
target_os = "linux",
16221601
))]
16231602
#[cfg(feature = "net")]
16241603
ControlMessage::IpTtl(_) => libc::IPPROTO_IP,
@@ -1672,32 +1651,29 @@ impl<'a> ControlMessage<'a> {
16721651
libc::SCM_TXTIME
16731652
},
16741653
#[cfg(any(
1675-
target_os = "freebsd",
16761654
apple_targets,
1655+
linux_android,
1656+
target_os = "freebsd",
16771657
target_os = "netbsd",
16781658
target_os = "openbsd",
1679-
target_os = "android",
1680-
target_os = "linux",
16811659
))]
16821660
#[cfg(feature = "net")]
16831661
ControlMessage::IpTos(_) => libc::IP_TOS,
16841662
#[cfg(any(
1685-
target_os = "freebsd",
16861663
apple_targets,
1664+
linux_android,
1665+
target_os = "freebsd",
16871666
target_os = "netbsd",
16881667
target_os = "openbsd",
1689-
target_os = "android",
1690-
target_os = "linux",
16911668
))]
16921669
#[cfg(feature = "net")]
16931670
ControlMessage::Ipv6TClass(_) => libc::IPV6_TCLASS,
16941671
#[cfg(any(
1695-
target_os = "freebsd",
16961672
apple_targets,
1673+
linux_android,
1674+
target_os = "freebsd",
16971675
target_os = "netbsd",
16981676
target_os = "openbsd",
1699-
target_os = "android",
1700-
target_os = "linux",
17011677
))]
17021678
#[cfg(feature = "net")]
17031679
ControlMessage::IpTtl(_) => libc::IP_TTL,

0 commit comments

Comments
 (0)