rust/tests/ui/foreign/foreign2.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

51 lines
858 B
Rust
Raw Normal View History

//@ run-pass
//@ pretty-expanded FIXME #23616
2024-04-18 21:30:07 +00:00
#![allow(dead_code)]
#![feature(rustc_private)]
2014-02-26 17:58:41 +00:00
mod bar {
2020-09-01 21:12:52 +00:00
extern "C" {}
}
2011-02-23 19:06:37 +00:00
mod zed {
2020-09-01 21:12:52 +00:00
extern "C" {}
}
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;
}
}
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;
}
}
mod baz {
2020-09-01 21:12:52 +00:00
extern "C" {}
}
2011-02-23 19:06:37 +00:00
2020-09-01 21:12:52 +00:00
pub fn main() {}