@@ -1143,15 +1143,6 @@ s! {
1143
1143
pub nativeattr: attribute_set_t,
1144
1144
}
1145
1145
1146
- #[ cfg_attr( libc_packedN, repr( packed( 4 ) ) ) ]
1147
- pub struct ifconf {
1148
- pub ifc_len: :: c_int,
1149
- #[ cfg( libc_union) ]
1150
- pub ifc_ifcu: __c_anonymous_ifc_ifcu,
1151
- #[ cfg( not( libc_union) ) ]
1152
- pub ifc_ifcu: * mut ifreq,
1153
- }
1154
-
1155
1146
#[ cfg_attr( libc_align, repr( align( 8 ) ) ) ]
1156
1147
pub struct tcp_connection_info {
1157
1148
pub tcpi_state: u8 ,
@@ -1202,6 +1193,15 @@ s! {
1202
1193
}
1203
1194
1204
1195
s_no_extra_traits ! {
1196
+ #[ cfg_attr( libc_packedN, repr( packed( 4 ) ) ) ]
1197
+ pub struct ifconf {
1198
+ pub ifc_len: :: c_int,
1199
+ #[ cfg( libc_union) ]
1200
+ pub ifc_ifcu: __c_anonymous_ifc_ifcu,
1201
+ #[ cfg( not( libc_union) ) ]
1202
+ pub ifc_ifcu: * mut ifreq,
1203
+ }
1204
+
1205
1205
#[ cfg_attr( libc_packedN, repr( packed( 4 ) ) ) ]
1206
1206
pub struct kevent {
1207
1207
pub ident: :: uintptr_t,
@@ -1617,6 +1617,32 @@ cfg_if! {
1617
1617
1618
1618
cfg_if ! {
1619
1619
if #[ cfg( feature = "extra_traits" ) ] {
1620
+ impl PartialEq for ifconf
1621
+ where
1622
+ Self : Copy
1623
+ {
1624
+ fn eq( & self , other: & Self ) -> bool {
1625
+ let len_ptr1 = core:: ptr:: addr_of!( self . ifc_len) ;
1626
+ let len_ptr2 = core:: ptr:: addr_of!( other. ifc_len) ;
1627
+ let ifcu_ptr1 = core:: ptr:: addr_of!( self . ifc_ifcu) ;
1628
+ let ifcu_ptr2 = core:: ptr:: addr_of!( other. ifc_ifcu) ;
1629
+
1630
+ // SAFETY: `ifconf` implements `Copy` so the reads are valid
1631
+ let len1 = unsafe { len_ptr1. read_unaligned( ) } ;
1632
+ let len2 = unsafe { len_ptr2. read_unaligned( ) } ;
1633
+ let ifcu1 = unsafe { ifcu_ptr1. read_unaligned( ) } ;
1634
+ let ifcu2 = unsafe { ifcu_ptr2. read_unaligned( ) } ;
1635
+
1636
+ len1 == len2 && ifcu1 == ifcu2
1637
+ }
1638
+ }
1639
+ impl Eq for ifconf { }
1640
+ impl :: fmt:: Debug for ifconf {
1641
+ fn fmt( & self , f: & mut :: fmt:: Formatter ) -> :: fmt:: Result {
1642
+ f. debug_struct( "ifconf" ) . finish_non_exhaustive( )
1643
+ }
1644
+ }
1645
+
1620
1646
impl PartialEq for kevent {
1621
1647
fn eq( & self , other: & kevent) -> bool {
1622
1648
self . ident == other. ident
@@ -1627,6 +1653,7 @@ cfg_if! {
1627
1653
&& self . udata == other. udata
1628
1654
}
1629
1655
}
1656
+
1630
1657
impl Eq for kevent { }
1631
1658
impl :: fmt:: Debug for kevent {
1632
1659
fn fmt( & self , f: & mut :: fmt:: Formatter ) -> :: fmt:: Result {
0 commit comments