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

24 lines
507 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(error, actual);
2011-07-27 07:19:39 -05:00
assert (expected == actual);
}
#[cfg(target_os = "macos")]
#[cfg(target_os = "linux")]
2011-12-30 02:18:55 -06:00
#[cfg(target_os = "freebsd")]
fn main() { }