diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:11:38 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:13:23 +0000 |
commit | 20431706a863f92cb37dc512fef6e48d192aaf2c (patch) | |
tree | 2867f13f5fd5437ba628c67d7f87309ccadcd286 /src/test/ui/abi/x86stdcall2.rs | |
parent | Releasing progress-linux version 1.65.0+dfsg1-2~progress7.99u1. (diff) | |
download | rustc-20431706a863f92cb37dc512fef6e48d192aaf2c.tar.xz rustc-20431706a863f92cb37dc512fef6e48d192aaf2c.zip |
Merging upstream version 1.66.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/ui/abi/x86stdcall2.rs')
-rw-r--r-- | src/test/ui/abi/x86stdcall2.rs | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/src/test/ui/abi/x86stdcall2.rs b/src/test/ui/abi/x86stdcall2.rs index 563e3aba6..4d508ecb2 100644 --- a/src/test/ui/abi/x86stdcall2.rs +++ b/src/test/ui/abi/x86stdcall2.rs @@ -1,4 +1,5 @@ // run-pass +// only-windows #![allow(non_camel_case_types)] pub type HANDLE = usize; @@ -7,20 +8,16 @@ pub type SIZE_T = u32; pub type LPVOID = usize; pub type BOOL = u8; -#[cfg(windows)] mod kernel32 { - use super::{HANDLE, DWORD, SIZE_T, LPVOID, BOOL}; + use super::{BOOL, DWORD, HANDLE, LPVOID, SIZE_T}; extern "system" { pub fn GetProcessHeap() -> HANDLE; - pub fn HeapAlloc(hHeap: HANDLE, dwFlags: DWORD, dwBytes: SIZE_T) - -> LPVOID; + pub fn HeapAlloc(hHeap: HANDLE, dwFlags: DWORD, dwBytes: SIZE_T) -> LPVOID; pub fn HeapFree(hHeap: HANDLE, dwFlags: DWORD, lpMem: LPVOID) -> BOOL; } } - -#[cfg(windows)] pub fn main() { let heap = unsafe { kernel32::GetProcessHeap() }; let mem = unsafe { kernel32::HeapAlloc(heap, 0, 100) }; @@ -28,6 +25,3 @@ pub fn main() { let res = unsafe { kernel32::HeapFree(heap, 0, mem) }; assert!(res != 0); } - -#[cfg(not(windows))] -pub fn main() { } |