Skip to content

Commit 4824149

Browse files
committed
Convert Windows to use check_shim_sig instead of check_shim_sig_lenient
1 parent 50936be commit 4824149

File tree

4 files changed

+490
-119
lines changed

4 files changed

+490
-119
lines changed

src/shims/sig.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ pub struct ShimSig<'tcx, const ARGS: usize> {
1717

1818
/// Construct a `ShimSig` with convenient syntax:
1919
/// ```rust,ignore
20-
/// shim_sig!(this, extern "C" fn (*const T, i32) -> usize)
20+
/// shim_sig!(extern "C" fn (*const T, i32) -> usize)
2121
/// ```
2222
#[macro_export]
2323
macro_rules! shim_sig {
24-
(extern $abi:literal fn($($arg:ty),*) -> $ret:ty) => {
24+
(extern $abi:literal fn($($arg:ty),* $(,)?) -> $ret:ty) => {
2525
|this| $crate::shims::sig::ShimSig {
2626
abi: std::str::FromStr::from_str($abi).expect("incorrect abi specified"),
2727
args: [$(shim_sig_arg!(this, $arg)),*],
@@ -53,6 +53,8 @@ macro_rules! shim_sig_arg {
5353
"*const _" => $this.machine.layouts.const_raw_ptr.ty,
5454
"*mut _" => $this.machine.layouts.mut_raw_ptr.ty,
5555
ty if let Some(libc_ty) = ty.strip_prefix("libc::") => $this.libc_ty_layout(libc_ty).ty,
56+
ty if let Some(win_ty) = ty.strip_prefix("winapi::") =>
57+
$this.windows_ty_layout(win_ty).ty,
5658
ty => panic!("unsupported signature type {ty:?}"),
5759
}
5860
}};

0 commit comments

Comments
 (0)