Skip to content

Commit

Permalink
Merge pull request #40 from uutils/fix.cfg-bsdlike
Browse files Browse the repository at this point in the history
fix ~ expand cfg-gating of `domainname` for BSD-like platforms
  • Loading branch information
sylvestre authored May 27, 2023
2 parents cf75826 + 3a9cea7 commit 82edd5c
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 82edd5c

Please sign in to comment.