Make it work on Windows

This commit is contained in:
Kirill Pimenov 2017-12-30 15:50:55 +01:00
parent 1dfd444c9b
commit 80559a91bb
3 changed files with 5 additions and 6 deletions

1
Cargo.lock generated
View File

@ -80,7 +80,6 @@ dependencies = [
"ctrlc 3.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
"diff 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
"ignore 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.34 (registry+https://github.com/rust-lang/crates.io-index)",
"num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)",

View File

@ -46,8 +46,7 @@ ctrlc = "3.0"
libc = "0.2"
[target.'cfg(windows)'.dependencies]
kernel32-sys = "0.2"
winapi = "0.3"
winapi = { version = "0.3", features = ["handleapi", "consoleapi", "processenv"] }
[dev-dependencies]
diff = "0.1"

View File

@ -6,11 +6,12 @@
// notice may not be copied, modified, or distributed except
// according to those terms.
extern crate kernel32;
extern crate winapi;
use self::kernel32::{GetStdHandle, GetConsoleMode, SetConsoleMode};
use self::winapi::{STD_OUTPUT_HANDLE, INVALID_HANDLE_VALUE};
use self::winapi::um::processenv::GetStdHandle;
use self::winapi::um::consoleapi::{GetConsoleMode, SetConsoleMode};
use self::winapi::um::winbase::STD_OUTPUT_HANDLE;
use self::winapi::um::handleapi::INVALID_HANDLE_VALUE;
const ENABLE_VIRTUAL_TERMINAL_PROCESSING: u32 = 0x0004;