Skip to content

Commit

Permalink
feat: add GNU/Hurd support
Browse files Browse the repository at this point in the history
Handle it like most of the other Unix platforms (e.g. Linux, BSDs, etc).
  • Loading branch information
pinotree committed Jul 10, 2024
1 parent 3cf72fd commit 58142a6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ name = "open"
[target.'cfg(all(unix, not(macos)))'.dependencies]
pathdiff = "0.2.0"

[target.'cfg(any(target_os = "linux", target_os = "android", target_os = "freebsd", target_os = "dragonfly", target_os = "netbsd", target_os = "openbsd", target_os = "illumos", target_os = "solaris", target_os = "aix" ))'.dependencies]
[target.'cfg(any(target_os = "linux", target_os = "android", target_os = "freebsd", target_os = "dragonfly", target_os = "netbsd", target_os = "openbsd", target_os = "illumos", target_os = "solaris", target_os = "aix", target_os = "hurd"))'.dependencies]
is-wsl = "0.4.0"

[target."cfg(unix)".dependencies]
Expand Down
9 changes: 6 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ use redox as os;
target_os = "openbsd",
target_os = "illumos",
target_os = "solaris",
target_os = "aix"
target_os = "aix",
target_os = "hurd"
))]
use unix as os;

Expand All @@ -112,7 +113,8 @@ use unix as os;
target_os = "windows",
target_os = "haiku",
target_os = "redox",
target_os = "aix"
target_os = "aix",
target_os = "hurd"
)))]
compile_error!("open is not supported on this platform");

Expand Down Expand Up @@ -376,6 +378,7 @@ mod redox;
target_os = "openbsd",
target_os = "illumos",
target_os = "solaris",
target_os = "aix"
target_os = "aix",
target_os = "hurd"
))]
mod unix;

0 comments on commit 58142a6

Please sign in to comment.