rust/src/test/run-pass/x86stdcall.rs

23 lines
488 B
Rust
Raw Normal View History

// GetLastError doesn't seem to work with stack switching
// xfail-test
#[cfg(target_os = "win32")]
native "stdcall" mod kernel32 {
2011-07-27 07:19:39 -05:00
fn SetLastError(err: uint);
fn GetLastError() -> uint;
}
#[cfg(target_os = "win32")]
fn main() {
let expected = 1234u;
2011-07-27 07:19:39 -05:00
kernel32::SetLastError(expected);
let actual = kernel32::GetLastError();
log_full(core::error, actual);
2011-07-27 07:19:39 -05:00
assert (expected == actual);
}
#[cfg(target_os = "macos")]
#[cfg(target_os = "linux")]
fn main() { }