Skip to content

Commit 7dba56f

Browse files
authored
Merge pull request #2503 from Eijebong/winapi
Bump winapi to 0.3
2 parents 7589ebd + 64f6372 commit 7dba56f

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

Cargo.lock

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,5 +58,4 @@ lazy_static = "1.0.0"
5858
libc = "0.2.11"
5959

6060
[target.'cfg(windows)'.dependencies]
61-
kernel32-sys = "0.2.2"
62-
winapi = "0.2.7"
61+
winapi = { version = "0.3" }

src/utils.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -382,13 +382,12 @@ pub fn isatty() -> bool {
382382
}
383383
#[cfg(windows)]
384384
pub fn isatty() -> bool {
385-
extern crate kernel32;
386385
extern crate winapi;
387386

388387
unsafe {
389-
let handle = kernel32::GetStdHandle(winapi::winbase::STD_OUTPUT_HANDLE);
388+
let handle = winapi::um::processenv::GetStdHandle(winapi::um::winbase::STD_OUTPUT_HANDLE);
390389
let mut out = 0;
391-
kernel32::GetConsoleMode(handle, &mut out) != 0
390+
winapi::um::consoleapi::GetConsoleMode(handle, &mut out) != 0
392391
}
393392
}
394393

0 commit comments

Comments
 (0)