Files
rust/tests/ui/foreign/foreign2.rs

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

50 lines
825 B
Rust
Raw Normal View History

//@ run-pass
2024-04-18 17:30:07 -04:00
#![allow(dead_code)]
#![feature(rustc_private)]
2014-02-26 12:58:41 -05:00
mod bar {
2020-09-01 17:12:52 -04:00
extern "C" {}
}
2011-02-23 14:06:37 -05:00
mod zed {
2020-09-01 17:12:52 -04:00
extern "C" {}
}
2011-02-23 14:06:37 -05:00
2024-04-18 17:30:07 -04:00
#[cfg(not(windows))]
2014-02-26 12:58:41 -05:00
mod mlibc {
2024-04-18 17:30:07 -04:00
extern crate libc;
2024-04-18 17:39:35 -04:00
use self::libc::{c_int, c_void, size_t, ssize_t};
2013-08-17 08:37:42 -07:00
2020-09-01 17:12:52 -04:00
extern "C" {
2014-06-25 12:47:34 -07:00
pub fn write(fd: c_int, buf: *const c_void, count: size_t) -> ssize_t;
}
}
2024-04-18 17:30:07 -04: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 17:12:52 -04:00
extern "C" {}
}
2011-02-23 14:06:37 -05:00
2020-09-01 17:12:52 -04:00
pub fn main() {}