Fix platforms specific stuff

This commit is contained in:
Sag0Sag0 2019-06-18 17:24:40 +10:00 committed by Pierre Peltier
parent 79ebe268f2
commit cb1de67261

View file

@ -6,12 +6,14 @@ use crate::meta::Meta;
use crate::sort;
use std::{fs, io};
use std::path::PathBuf;
#[cfg(not(target_os = "windows"))]
use std::os::unix::io::AsRawFd;
use super::libc;
#[cfg(target_os = "windows")]
use terminal_size::terminal_size;
use super::libc;
pub struct Core {
flags: Flags,
icons: Icons,
@ -25,6 +27,7 @@ impl Core {
// Determine color output availability (and initialize color output (for Windows 10))
#[cfg(not(target_os = "windows"))]
let tty_available = unsafe { libc::isatty(io::stdout().as_raw_fd()) == 1 };
#[cfg(not(target_os = "windows"))]
let console_color_ok = true;