Skip to content

Commit 283196a

Browse files
committed
fix(deps): use windows-sys instead of winapi
1 parent 0de8cf4 commit 283196a

File tree

5 files changed

+16
-16
lines changed

5 files changed

+16
-16
lines changed

Cargo.lock

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

crates/turborepo-lib/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ uds_windows = "1.0.2"
155155
async-io = "1.12.0"
156156

157157
[target.'cfg(target_os = "windows")'.dev-dependencies]
158-
winapi = "0.3.9"
158+
windows-sys = { version = "0.59", features = ["Win32_System_Threading"] }
159159

160160
[build-dependencies]
161161
capnpc = "0.18.0"

crates/turborepo-lib/src/process/child.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1092,9 +1092,9 @@ mod test {
10921092
if let Some(pid) = child.pid() {
10931093
unsafe {
10941094
println!("killing");
1095-
winapi::um::processthreadsapi::TerminateProcess(
1096-
winapi::um::processthreadsapi::OpenProcess(
1097-
winapi::um::winnt::PROCESS_TERMINATE,
1095+
windows_sys::Win32::System::Threading::TerminateProcess(
1096+
windows_sys::Win32::System::Threading::OpenProcess(
1097+
windows_sys::Win32::System::Threading::PROCESS_TERMINATE,
10981098
0,
10991099
pid,
11001100
),

crates/turborepo-ui/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ turbopath = { workspace = true }
4242
turborepo-ci = { workspace = true }
4343
turborepo-vt100 = { workspace = true }
4444
which = { workspace = true }
45-
winapi = "0.3.9"
4645

4746
[target."cfg(windows)".dependencies]
4847
clipboard-win = "5.3.1"
48+
windows-sys = { version = "0.59", features = ["Win32_System_Console"] }

crates/turborepo-ui/src/tui/input.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -136,19 +136,19 @@ fn ctrl_c() -> Option<Event> {
136136

137137
#[cfg(windows)]
138138
fn ctrl_c() -> Option<Event> {
139-
use winapi::{
140-
shared::minwindef::{BOOL, DWORD, TRUE},
141-
um::wincon,
139+
use windows_sys::Win32::{
140+
Foundation::{BOOL, TRUE},
141+
System::Console::GenerateConsoleCtrlEvent,
142142
};
143143
// First parameter corresponds to what event to generate, 0 is a Ctrl-C
144-
let ctrl_c_event: DWORD = 0x0;
144+
let ctrl_c_event = 0x0;
145145
// Second parameter corresponds to which process group to send the event to.
146146
// If 0 is passed the event gets sent to every process connected to the current
147147
// Console.
148-
let process_group_id: DWORD = 0x0;
148+
let process_group_id = 0x0;
149149
let success: BOOL = unsafe {
150150
// See docs https://learn.microsoft.com/en-us/windows/console/generateconsolectrlevent
151-
wincon::GenerateConsoleCtrlEvent(ctrl_c_event, process_group_id)
151+
GenerateConsoleCtrlEvent(ctrl_c_event, process_group_id)
152152
};
153153
if success == TRUE {
154154
None

0 commit comments

Comments
 (0)