File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
std/src/sys/pal/windows/c Expand file tree Collapse file tree 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+
16pub macro link {
27 ( $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.
312 #[ link( name = "kernel32" ) ]
413 extern $abi {
514 $( #[ link_name=$link_name] ) ?
You can’t perform that action at this time.
0 commit comments