-
Notifications
You must be signed in to change notification settings - Fork 460
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Regenerate windows sys bindings (#1132)
- Loading branch information
1 parent
6890f3f
commit 1ebdb6c
Showing
5 changed files
with
81 additions
and
119 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 |
---|---|---|
|
@@ -7,3 +7,4 @@ publish = false | |
[dependencies] | ||
windows-bindgen = "0.58" | ||
tempfile = "3" | ||
regex = "1" |
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
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,19 @@ | ||
//! Provides the `link!` macro used by the generated windows bindings. | ||
//! | ||
//! This is a simple wrapper around an `extern` block with a `#[link]` attribute. | ||
//! It's very roughly equivalent to the windows-targets crate. | ||
macro_rules! link_macro { | ||
($library:literal $abi:literal $($link_name:literal)? $(#[$doc:meta])? fn $($function:tt)*) => ( | ||
// Note: the windows-targets crate uses a pre-built Windows.lib import library which we don't | ||
// have in this repo. So instead we always link kernel32.lib and add the rest of the import | ||
// libraries below by using an empty extern block. This works because extern blocks are not | ||
// connected to the library given in the #[link] attribute. | ||
#[link(name = "kernel32")] | ||
extern $abi { | ||
$(#[link_name=$link_name])? | ||
pub fn $($function)*; | ||
} | ||
) | ||
} | ||
pub(crate) use link_macro as link; |