rust/tests/run-make/raw-dylib-link-ordinal/lib.rs

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

20 lines
443 B
Rust
Raw Normal View History

#[link(name = "exporter", kind = "raw-dylib")]
extern {
#[link_ordinal(13)]
fn imported_function();
#[link_ordinal(5)]
static mut imported_variable: i32;
#[link_ordinal(9)]
fn print_imported_variable();
}
pub fn library_function() {
unsafe {
imported_function();
imported_variable = 42;
print_imported_variable();
imported_variable = -42;
print_imported_variable();
}
}