Skip to content

Commit 15a8e62

Browse files
committed
auto merge of #10363 : astrieanna/rust/fix-x86stdcall, r=huonw
* moved `extern` inside module * changed `extern "stdcall"` to `extern "system"` * changed `cfg(target_os="win32")` to `cfg(windows)` * only run on Windows && x86, (not x86_64) * updated copyright dates
2 parents 5e3123b + 69768f7 commit 15a8e62

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

src/test/run-pass/x86stdcall.rs

+9-8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
1+
// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
22
// file at the top-level directory of this distribution and at
33
// http://rust-lang.org/COPYRIGHT.
44
//
@@ -9,22 +9,23 @@
99
// except according to those terms.
1010

1111
// GetLastError doesn't seem to work with stack switching
12-
// xfail-test
1312

14-
#[cfg(target_os = "win32")]
15-
extern "stdcall" mod kernel32 {
16-
fn SetLastError(err: uint);
17-
fn GetLastError() -> uint;
13+
#[cfg(windows)]
14+
mod kernel32 {
15+
extern "system" {
16+
pub fn SetLastError(err: uint);
17+
pub fn GetLastError() -> uint;
18+
}
1819
}
1920

2021

21-
#[cfg(target_os = "win32")]
22+
#[cfg(windows)]
2223
pub fn main() {
2324
unsafe {
2425
let expected = 1234u;
2526
kernel32::SetLastError(expected);
2627
let actual = kernel32::GetLastError();
27-
log(error, actual);
28+
info!("actual = {}", actual);
2829
assert_eq!(expected, actual);
2930
}
3031
}

0 commit comments

Comments
 (0)