Skip to content

Commit

Permalink
Add support for QNX Neutrino 7.1
Browse files Browse the repository at this point in the history
  • Loading branch information
flba-eb committed Mar 31, 2024
1 parent 4ab23c3 commit 3ee052d
Show file tree
Hide file tree
Showing 17 changed files with 543 additions and 104 deletions.
3 changes: 2 additions & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@ fn main() {
solaris: { target_os = "solaris" },
watchos: { target_os = "watchos" },
tvos: { target_os = "tvos" },
nto_qnx: { target_os = "nto"},


// cfg aliases we would like to use
apple_targets: { any(ios, macos, watchos, tvos) },
bsd: { any(freebsd, dragonfly, netbsd, openbsd, apple_targets) },
bsd: { any(freebsd, dragonfly, netbsd, openbsd, apple_targets, nto_qnx) },
linux_android: { any(android, linux) },
freebsdlike: { any(dragonfly, freebsd) },
netbsdlike: { any(netbsd, openbsd) },
Expand Down
15 changes: 13 additions & 2 deletions src/dir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ impl Entry {
target_os = "emscripten",
target_os = "fuchsia",
target_os = "haiku",
target_os = "nto",
target_os = "hurd",
solarish,
linux_android,
Expand All @@ -250,7 +251,12 @@ impl Entry {
/// notably, some Linux filesystems don't implement this. The caller should use `stat` or
/// `fstat` if this returns `None`.
pub fn file_type(&self) -> Option<Type> {
#[cfg(not(any(solarish, target_os = "aix", target_os = "haiku")))]
#[cfg(not(any(
solarish,
target_os = "aix",
target_os = "haiku",
target_os = "nto",
)))]
match self.0.d_type {
libc::DT_FIFO => Some(Type::Fifo),
libc::DT_CHR => Some(Type::CharacterDevice),
Expand All @@ -263,7 +269,12 @@ impl Entry {
}

// illumos, Solaris, and Haiku systems do not have the d_type member at all:
#[cfg(any(solarish, target_os = "aix", target_os = "haiku"))]
#[cfg(any(
solarish,
target_os = "aix",
target_os = "haiku",
target_os = "nto",
))]
None
}
}
Loading

0 comments on commit 3ee052d

Please sign in to comment.