Skip to content

Commit

Permalink
Auto merge of #3385 - devnexen:ifreq_apple_fix, r=JohnTitor
Browse files Browse the repository at this point in the history
ifreq for apple follow-up fix case when in non libc_union case
  • Loading branch information
bors committed Oct 13, 2023
2 parents 0dbadb4 + 280f366 commit a8b74d9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/unix/bsd/apple/mod.rs
Expand Up @@ -1464,6 +1464,8 @@ s_no_extra_traits! {
pub ifr_name: [::c_char; ::IFNAMSIZ],
#[cfg(libc_union)]
pub ifr_ifru: __c_anonymous_ifr_ifru,
#[cfg(not(libc_union))]
pub ifr_ifru: ::sockaddr,
}
}

Expand Down Expand Up @@ -2977,6 +2979,7 @@ cfg_if! {
impl PartialEq for ifreq {
fn eq(&self, other: &ifreq) -> bool {
self.ifr_name == other.ifr_name
&& self.ifr_ifru == other.ifr_ifru
}
}

Expand All @@ -2986,14 +2989,14 @@ cfg_if! {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("ifreq")
.field("ifr_name", &self.ifr_name)
.field("ifr_ifru", &self.ifr_ifru)
.finish()
}
}

impl ::hash::Hash for ifreq {
fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
self.ifr_name.hash(state);
#[cfg(libc_union)]
self.ifr_ifru.hash(state);
}
}
Expand Down

0 comments on commit a8b74d9

Please sign in to comment.