Skip to content

Commit a9d2a88

Browse files
committed
desktop: Switch from winapi to windows-sys
1 parent 3bd8004 commit a9d2a88

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

Cargo.lock

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

desktop/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ memmap2.workspace = true
5858
ashpd = "0.11.0"
5959

6060
[target.'cfg(windows)'.dependencies]
61-
winapi = { version = "0.3.9", features = ["wincon"] }
61+
windows-sys = { version = "0.59.0", features = ["Win32_System_Console"] }
6262

6363
[build-dependencies]
6464
embed-resource = "3"

desktop/src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ fn init() {
6363
// silently if the parent has no console.
6464
#[cfg(windows)]
6565
unsafe {
66-
use winapi::um::wincon::{AttachConsole, ATTACH_PARENT_PROCESS};
66+
use windows_sys::Win32::System::Console::{AttachConsole, ATTACH_PARENT_PROCESS};
6767
AttachConsole(ATTACH_PARENT_PROCESS);
6868
}
6969

@@ -144,7 +144,7 @@ fn shutdown() {
144144
// Without explicitly detaching the console cmd won't redraw it's prompt.
145145
#[cfg(windows)]
146146
unsafe {
147-
winapi::um::wincon::FreeConsole();
147+
windows_sys::Win32::System::Console::FreeConsole();
148148
}
149149
}
150150

0 commit comments

Comments
 (0)