]> git.lizzy.rs Git - rust.git/blob - src/test/ui/rfcs/rfc-1014-2.rs
Merge commit '4236289b75ee55c78538c749512cdbeea5e1c332' into update-rustfmt
[rust.git] / src / test / ui / rfcs / rfc-1014-2.rs
1 // run-pass
2 #![allow(dead_code)]
3
4 #![feature(rustc_private)]
5
6 extern crate libc;
7
8 type DWORD = u32;
9 type HANDLE = *mut u8;
10 type BOOL = i32;
11
12 #[cfg(windows)]
13 extern "system" {
14     fn SetStdHandle(nStdHandle: DWORD, nHandle: HANDLE) -> BOOL;
15 }
16
17 #[cfg(windows)]
18 fn close_stdout() {
19     const STD_OUTPUT_HANDLE: DWORD = -11i32 as DWORD;
20     unsafe { SetStdHandle(STD_OUTPUT_HANDLE, 0 as HANDLE); }
21 }
22
23 #[cfg(windows)]
24 fn main() {
25     close_stdout();
26     println!("hello");
27     println!("world");
28 }
29
30 #[cfg(not(windows))]
31 fn main() {}