Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move from winapi to windows-sys #81

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ version = "1.0.90"
features = ["derive"]
optional = true

[target.'cfg(target_os="windows")'.dependencies.winapi]
version = "0.3.4"
features = ["consoleapi", "errhandlingapi", "fileapi", "handleapi", "processenv"]
[target.'cfg(target_os="windows")'.dependencies.windows-sys]
version = "0.59"
features = ["Win32_System_Console", "Win32_Storage_FileSystem", "Win32_Security"]

[dev-dependencies]
doc-comment = "0.3"
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@
#![warn(unused_extern_crates, unused_qualifications)]

#[cfg(target_os="windows")]
extern crate winapi;
extern crate windows_sys;
#[cfg(test)]
#[macro_use]
extern crate doc_comment;
Expand Down
8 changes: 3 additions & 5 deletions src/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,9 @@ pub fn enable_ansi_support() -> Result<(), u32> {
use std::iter::once;
use std::os::windows::ffi::OsStrExt;
use std::ptr::null_mut;
use winapi::um::consoleapi::{GetConsoleMode, SetConsoleMode};
use winapi::um::errhandlingapi::GetLastError;
use winapi::um::fileapi::{CreateFileW, OPEN_EXISTING};
use winapi::um::handleapi::INVALID_HANDLE_VALUE;
use winapi::um::winnt::{FILE_SHARE_WRITE, GENERIC_READ, GENERIC_WRITE};
use windows_sys::Win32::System::Console::{GetConsoleMode, SetConsoleMode};
use windows_sys::Win32::Foundation::{GetLastError, INVALID_HANDLE_VALUE, GENERIC_READ, GENERIC_WRITE};
use windows_sys::Win32::Storage::FileSystem::{CreateFileW, OPEN_EXISTING, FILE_SHARE_WRITE};

const ENABLE_VIRTUAL_TERMINAL_PROCESSING: u32 = 0x0004;

Expand Down