rust/tests/target/extern.rs

74 lines
1.2 KiB
Rust
Raw Normal View History

// rustfmt-normalize_comments: true
2015-09-21 20:02:45 +02:00
2017-08-08 17:16:35 +02:00
extern crate foo;
extern crate foo as bar;
2017-08-08 17:16:35 +02:00
extern crate chrono;
extern crate dotenv;
extern crate futures;
extern crate bar;
extern crate foo;
// #2315
extern crate proc_macro;
extern crate proc_macro2;
extern "C" {
2015-09-21 20:02:45 +02:00
fn c_func(x: *mut *mut libc::c_void);
2017-06-12 06:01:41 +02:00
fn c_func(
x: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX,
y: YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY,
);
2015-09-21 20:02:45 +02:00
#[test123]
fn foo() -> uint64_t;
pub fn bar();
}
extern "C" {
2017-06-12 06:01:41 +02:00
fn DMR_GetDevice(
pHDev: *mut HDEV,
searchMode: DeviceSearchMode,
pSearchString: *const c_char,
devNr: c_uint,
wildcard: c_char,
) -> TDMR_ERROR;
2015-09-21 20:02:45 +02:00
fn quux() -> (); // Post comment
pub type Foo;
type Bar;
2015-09-21 20:02:45 +02:00
}
extern "Rust" {
static ext: u32;
// Some comment.
pub static mut var: SomeType;
}
2015-10-10 22:53:20 +02:00
extern "C" {
2017-06-12 06:01:41 +02:00
fn syscall(
number: libc::c_long, // comment 1
// comm 2
... // sup?
) -> libc::c_long;
2015-10-10 22:53:20 +02:00
fn foo(x: *const c_char, ...) -> libc::c_long;
}
extern "C" {
2017-06-12 06:01:41 +02:00
pub fn freopen(
filename: *const c_char,
mode: *const c_char,
mode2: *const c_char,
mode3: *const c_char,
file: *mut FILE,
) -> *mut FILE;
}
extern "C" {}