File tree 1 file changed +9
-0
lines changed
library/std/src/sys/pal/windows/c
1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change
1
+ //! Provides the `link!` macro used by the generated windows bindings.
2
+ //!
3
+ //! This is a simple wrapper around an `extern` block with a `#[link]` attribute.
4
+ //! It's very roughly equivalent to the windows-targets crate.
5
+
1
6
pub macro link {
2
7
( $library: literal $abi: literal $( $link_name: literal) ? $( #[ $doc: meta] ) ? fn $( $function: tt) * ) => (
8
+ // Note: the windows-targets crate uses a pre-built Windows.lib import library which we don't
9
+ // have in this repo. So instead we always link kernel32.lib and add the rest of the import
10
+ // libraries below by using an empty extern block. This works because extern blocks are not
11
+ // connected to the library given in the #[link] attribute.
3
12
#[ link( name = "kernel32" ) ]
4
13
extern $abi {
5
14
$( #[ link_name=$link_name] ) ?
You can’t perform that action at this time.
0 commit comments