From e73261542cc601408596fb404c57d54f8cbc6bf7 Mon Sep 17 00:00:00 2001 From: Danilo Bargen Date: Sun, 28 Oct 2018 22:09:56 +0100 Subject: [PATCH] OS detection: Treat BSDs as "osx" (#58) Since macOS is also a BSD under the hood, this will probably yield better results. --- src/main.rs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 929f0b1..a5408ff 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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 }