Skip to content

Commit

Permalink
fix ~ expand cfg-gating of domainname for BSD-like platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
rivy committed May 27, 2023
1 parent cf75826 commit 3a9cea7
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions src/platform/unix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,14 @@ impl Debug for UTSName {
.field("release", &oss_from_cstr(&self.0.release))
.field("version", &oss_from_cstr(&self.0.version))
.field("machine", &oss_from_cstr(&self.0.machine));
#[cfg(not(target_vendor = "apple" /* or `target_os = "macos"` */))]
// BSD-like platforms are missing the domainname field
#[cfg(not(any(
target_os = "macos",
target_os = "dragonfly",
target_os = "freebsd",
target_os = "openbsd",
target_os = "netbsd"
)))]
{
debug_struct = debug_struct.field("domainname", &oss_from_cstr(&self.0.domainname));
}
Expand All @@ -141,7 +148,14 @@ impl PartialEq for UTSName {
other.0.version,
other.0.machine,
);
#[cfg(not(target_vendor = "apple" /* or `target_os = "macos"` */))]
// BSD-like platforms are missing the domainname field
#[cfg(not(any(
target_os = "macos",
target_os = "dragonfly",
target_os = "freebsd",
target_os = "openbsd",
target_os = "netbsd"
)))]
{
equal = equal && (self.0.domainname == other.0.domainname)
}
Expand Down

0 comments on commit 3a9cea7

Please sign in to comment.