File tree Expand file tree Collapse file tree 3 files changed +5
-13
lines changed
Expand file tree Collapse file tree 3 files changed +5
-13
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,9 @@ pub struct ShimSig<'tcx, const ARGS: usize> {
1919/// ```rust,ignore
2020/// shim_sig!(extern "C" fn (*const T, i32) -> usize)
2121/// ```
22+ ///
23+ /// In type position, `winapi::` can be used as a shorthand for the full path used by
24+ /// `windows_ty_layout`.
2225#[ macro_export]
2326macro_rules! shim_sig {
2427 ( extern $abi: literal fn ( $( $arg: ty) ,* $( , ) ?) -> $ret: ty) => {
Original file line number Diff line number Diff line change @@ -137,21 +137,10 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
137137 ) -> InterpResult < ' tcx , EmulateItemResult > {
138138 let this = self . eval_context_mut ( ) ;
139139
140- // According to
141- // https://github.com/rust-lang/rust/blob/fb00adbdb69266f10df95a4527b767b0ad35ea48/compiler/rustc_target/src/spec/mod.rs#L2766-L2768,
142- // x86-32 Windows uses a different calling convention than other Windows targets
143- // for the "system" ABI.
144- // TODO: Use this in shim-sig instead of 'system'? Or is that good enough for ExternAbi?
145- // let sys_conv = if this.tcx.sess.target.arch == Arch::X86 {
146- // CanonAbi::X86(X86Call::Stdcall)
147- // } else {
148- // CanonAbi::C
149- // };
150-
151140 // See `fn emulate_foreign_item_inner` in `shims/foreign_items.rs` for the general pattern.
152141
153142 // Windows API stubs.
154- // HANDLE = isize
143+ // HANDLE = *mut c_void (formerly: isize)
155144 // NTSTATUS = LONG = i32
156145 // DWORD = ULONG = u32
157146 // BOOL = i32
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ fn main() {
1212 #[ cfg( not( target_os = "solaris" ) ) ]
1313 getrandom_01:: getrandom ( & mut data) . unwrap ( ) ;
1414
15- // TODO: getrandom 0.2 uses the wrong return type for BCrypteGenRandom
15+ // On Windows, getrandom 0.2 uses the wrong return type for BCryptGenRandom
1616 #[ cfg( not( target_os = "windows" ) ) ]
1717 getrandom_02:: getrandom ( & mut data) . unwrap ( ) ;
1818
You can’t perform that action at this time.
0 commit comments