Add experimental raw-dylib feature to std · model-checking/verify-rust-std@6b7a259

@@ -3,6 +3,18 @@

33

//! This is a simple wrapper around an `extern` block with a `#[link]` attribute.

44

//! It's very roughly equivalent to the windows-targets crate.

556+

#[cfg(feature = "windows_raw_dylib")]

7+

pub macro link {

8+

($library:literal $abi:literal $($link_name:literal)? $(#[$doc:meta])? fn $($function:tt)*) => (

9+

#[cfg_attr(not(target_arch = "x86"), link(name = $library, kind = "raw-dylib", modifiers = "+verbatim"))]

10+

#[cfg_attr(target_arch = "x86", link(name = $library, kind = "raw-dylib", modifiers = "+verbatim", import_name_type = "undecorated"))]

11+

extern $abi {

12+

$(#[link_name=$link_name])?

13+

pub fn $($function)*;

14+

}

15+

)

16+

}

17+

#[cfg(not(feature = "windows_raw_dylib"))]

618

pub macro link {

719

($library:literal $abi:literal $($link_name:literal)? $(#[$doc:meta])? fn $($function:tt)*) => (

820

// Note: the windows-targets crate uses a pre-built Windows.lib import library which we don't

@@ -17,6 +29,7 @@ pub macro link {

1729

)

1830

}

193132+

#[cfg(not(feature = "windows_raw_dylib"))]

2033

#[link(name = "advapi32")]

2134

#[link(name = "ntdll")]

2235

#[link(name = "userenv")]