rust/tests/source/extern.rs

61 lines
1.3 KiB
Rust
Raw Normal View History

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