mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 07:14:28 +00:00
15 lines
238 B
Rust
15 lines
238 B
Rust
use std::ffi::c_int;
|
|
|
|
#[link(name = "foo", kind = "static")]
|
|
extern "C" {
|
|
fn should_return_one() -> c_int;
|
|
}
|
|
|
|
fn main() {
|
|
let result = unsafe { should_return_one() };
|
|
|
|
if result != 1 {
|
|
std::process::exit(255);
|
|
}
|
|
}
|