From 58142a695d50460e439f85be3f0bc010936520e6 Mon Sep 17 00:00:00 2001 From: Pino Toscano Date: Wed, 10 Jul 2024 05:32:22 +0200 Subject: [PATCH] feat: add GNU/Hurd support Handle it like most of the other Unix platforms (e.g. Linux, BSDs, etc). --- Cargo.toml | 2 +- src/lib.rs | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 04a84e6..8a3e811 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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] diff --git a/src/lib.rs b/src/lib.rs index 1d26579..257b1fa 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -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; @@ -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"); @@ -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;