-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace windows-sys with windows-bindgen
sys-locale only uses 3 definitions from Windows, which makes the windows-sys dependency not worthwhile
- Loading branch information
1 parent
e746508
commit df58bb2
Showing
7 changed files
with
51 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
/target | ||
/*/target | ||
Cargo.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[package] | ||
name = "gen-windows-bindings" | ||
version = "0.1.0" | ||
edition = "2021" | ||
publish = false | ||
|
||
[dependencies] | ||
windows-bindgen = "0.51" | ||
|
||
# Prevent this from interfering with workspaces | ||
[workspace] | ||
members = ["."] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--out ../src/windows_sys.rs | ||
// We use `std` for now until the versioning of `windows-targets` has had more time to settle. | ||
// After that, replace it with the `sys` feature instead. | ||
--config flatten std minimal | ||
|
||
--filter | ||
Windows.Win32.Foundation.TRUE | ||
Windows.Win32.Globalization.GetUserPreferredUILanguages | ||
Windows.Win32.Globalization.MUI_LANGUAGE_NAME |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
fn main() { | ||
windows_bindgen::bindgen(&["--etc", "./bindings.config"]).unwrap(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// Bindings generated by `windows-bindgen` 0.51.1 | ||
|
||
#![allow( | ||
non_snake_case, | ||
non_upper_case_globals, | ||
non_camel_case_types, | ||
dead_code, | ||
clippy::all | ||
)] | ||
#[link(name = "kernel32")] | ||
extern "system" { | ||
pub fn GetUserPreferredUILanguages( | ||
dwflags: u32, | ||
pulnumlanguages: *mut u32, | ||
pwszlanguagesbuffer: PWSTR, | ||
pcchlanguagesbuffer: *mut u32, | ||
) -> BOOL; | ||
} | ||
pub type BOOL = i32; | ||
pub const MUI_LANGUAGE_NAME: u32 = 8u32; | ||
pub type PWSTR = *mut u16; | ||
pub const TRUE: BOOL = 1i32; |