OS detection: Treat BSDs as "osx" (#58)

Since macOS is also a BSD under the hood, this will probably yield
better results.
This commit is contained in:
Danilo Bargen 2018-10-28 22:09:56 +01:00 committed by GitHub
commit e73261542c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -199,12 +199,21 @@ fn get_os() -> OsType {
OsType::Linux
}
#[cfg(target_os = "macos")]
#[cfg(any(target_os = "macos",
target_os = "freebsd",
target_os = "netbsd",
target_os = "openbsd",
target_os = "dragonfly"))]
fn get_os() -> OsType {
OsType::OsX
}
#[cfg(not(any(target_os = "linux", target_os = "macos")))]
#[cfg(not(any(target_os = "linux",
target_os = "macos",
target_os = "freebsd",
target_os = "netbsd",
target_os = "openbsd",
target_os = "dragonfly")))]
fn get_os() -> OsType {
OsType::Other
}