Skip to content

Commit e96819c

Browse files
committed
Add cygwin support
1 parent 05c0c41 commit e96819c

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

Cargo.toml

+2-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ r-efi = { version = "5.1", default-features = false }
4747
libc = { version = "0.2.154", default-features = false }
4848

4949
# getrandom
50-
[target.'cfg(any(target_os = "dragonfly", target_os = "freebsd", target_os = "hurd", target_os = "illumos", all(target_os = "horizon", target_arch = "arm")))'.dependencies]
50+
[target.'cfg(any(target_os = "dragonfly", target_os = "freebsd", target_os = "hurd", target_os = "illumos", target_os = "cygwin", all(target_os = "horizon", target_arch = "arm")))'.dependencies]
5151
libc = { version = "0.2.154", default-features = false }
5252

5353
# netbsd
@@ -91,6 +91,7 @@ check-cfg = [
9191
'cfg(getrandom_test_linux_fallback)',
9292
'cfg(getrandom_test_linux_without_fallback)',
9393
'cfg(getrandom_test_netbsd_fallback)',
94+
'cfg(target_os, values("cygwin"))'
9495
]
9596

9697
[package.metadata.docs.rs]

src/backends.rs

+1
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ cfg_if! {
104104
target_os = "freebsd",
105105
target_os = "hurd",
106106
target_os = "illumos",
107+
target_os = "cygwin",
107108
// Check for target_arch = "arm" to only include the 3DS. Does not
108109
// include the Nintendo Switch (which is target_arch = "aarch64").
109110
all(target_os = "horizon", target_arch = "arm"),

src/util_libc.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use crate::Error;
22
use core::mem::MaybeUninit;
33

44
cfg_if! {
5-
if #[cfg(any(target_os = "netbsd", target_os = "openbsd", target_os = "android"))] {
5+
if #[cfg(any(target_os = "netbsd", target_os = "openbsd", target_os = "android", target_os = "cygwin"))] {
66
use libc::__errno as errno_location;
77
} else if #[cfg(any(target_os = "linux", target_os = "emscripten", target_os = "hurd", target_os = "redox", target_os = "dragonfly"))] {
88
use libc::__errno_location as errno_location;

0 commit comments

Comments
 (0)