diff options
author | Stephan Dilly <dilly.stephan@gmail.com> | 2020-12-22 15:52:33 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-22 15:52:33 +0100 |
commit | 5080b822f1e8f75292a7c1bca6b485682fa0ec9d (patch) | |
tree | 8d89cc41f560bdaae52697e41b5b547b4ecfa496 /src/clipboard.rs | |
parent | c19567e59b8b9baa5829325cfb4f30da95026c52 (diff) |
Freebsd fix compilation (#462)
Diffstat (limited to 'src/clipboard.rs')
-rw-r--r-- | src/clipboard.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/clipboard.rs b/src/clipboard.rs index 8b56e3e9..a0492e61 100644 --- a/src/clipboard.rs +++ b/src/clipboard.rs @@ -1,5 +1,6 @@ use anyhow::{anyhow, Result}; -#[cfg(target_os = "linux")] +#[cfg(target_family = "unix")] +#[cfg(not(target_os = "macos"))] use std::ffi::OsStr; use std::io::Write; use std::process::{Command, Stdio}; @@ -27,7 +28,7 @@ fn execute_copy_command(command: Command, text: &str) -> Result<()> { Ok(()) } -#[cfg(target_os = "linux")] +#[cfg(all(target_family = "unix", not(target_os = "macos")))] fn gen_command( path: impl AsRef<OsStr>, xclip_syntax: bool, @@ -42,7 +43,7 @@ fn gen_command( c } -#[cfg(target_os = "linux")] +#[cfg(all(target_family = "unix", not(target_os = "macos")))] pub fn copy_string(string: &str) -> Result<()> { use std::path::PathBuf; use which::which; |