2018-08-30 12:18:55 +00:00
|
|
|
//@ run-pass
|
2015-03-22 20:13:15 +00:00
|
|
|
//@ pretty-expanded FIXME #23616
|
2015-03-06 02:33:58 +00:00
|
|
|
|
2024-04-18 21:30:07 +00:00
|
|
|
#![allow(dead_code)]
|
|
|
|
#![feature(rustc_private)]
|
2014-02-26 17:58:41 +00:00
|
|
|
|
2013-03-05 22:42:58 +00:00
|
|
|
mod bar {
|
2020-09-01 21:12:52 +00:00
|
|
|
extern "C" {}
|
2013-03-05 22:42:58 +00:00
|
|
|
}
|
2011-02-23 19:06:37 +00:00
|
|
|
|
2013-03-05 22:42:58 +00:00
|
|
|
mod zed {
|
2020-09-01 21:12:52 +00:00
|
|
|
extern "C" {}
|
2013-03-05 22:42:58 +00:00
|
|
|
}
|
2011-02-23 19:06:37 +00:00
|
|
|
|
2024-04-18 21:30:07 +00:00
|
|
|
#[cfg(not(windows))]
|
2014-02-26 17:58:41 +00:00
|
|
|
mod mlibc {
|
2024-04-18 21:30:07 +00:00
|
|
|
extern crate libc;
|
2024-04-18 21:39:35 +00:00
|
|
|
use self::libc::{c_int, c_void, size_t, ssize_t};
|
2013-08-17 15:37:42 +00:00
|
|
|
|
2020-09-01 21:12:52 +00:00
|
|
|
extern "C" {
|
2014-06-25 19:47:34 +00:00
|
|
|
pub fn write(fd: c_int, buf: *const c_void, count: size_t) -> ssize_t;
|
2013-03-05 22:42:58 +00:00
|
|
|
}
|
2011-02-07 17:46:28 +00:00
|
|
|
}
|
|
|
|
|
2024-04-18 21:30:07 +00:00
|
|
|
#[cfg(windows)]
|
|
|
|
mod mlibc {
|
|
|
|
#![allow(non_snake_case)]
|
|
|
|
|
|
|
|
use std::ffi::c_void;
|
|
|
|
|
|
|
|
pub type BOOL = i32;
|
|
|
|
pub type HANDLE = *mut c_void;
|
|
|
|
|
|
|
|
#[link(name = "ntdll")]
|
|
|
|
extern "system" {
|
|
|
|
pub fn WriteFile(
|
|
|
|
hfile: HANDLE,
|
|
|
|
lpbuffer: *const u8,
|
|
|
|
nnumberofbytestowrite: u32,
|
|
|
|
lpnumberofbyteswritten: *mut u32,
|
|
|
|
lpoverlapped: *mut c_void,
|
|
|
|
) -> BOOL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-03-05 22:42:58 +00:00
|
|
|
mod baz {
|
2020-09-01 21:12:52 +00:00
|
|
|
extern "C" {}
|
2013-03-05 22:42:58 +00:00
|
|
|
}
|
2011-02-23 19:06:37 +00:00
|
|
|
|
2020-09-01 21:12:52 +00:00
|
|
|
pub fn main() {}
|