rust/tests/run-make/print-native-static-libs/bar.rs

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

26 lines
476 B
Rust
Raw Normal View History

#[no_mangle]
pub extern "C" fn my_bar_add(left: i32, right: i32) -> i32 {
// Obviously makes no sense but...
unsafe {
g_free(std::ptr::null_mut());
g_free2(std::ptr::null_mut());
}
left + right
}
#[link(name = "glib-2.0")]
extern "C" {
fn g_free(p: *mut ());
}
#[link(name = "glib-2.0")]
extern "C" {
fn g_free2(p: *mut ());
}
#[cfg(windows)]
#[link(name = "glib-2.0", kind = "raw-dylib")]
extern "C" {
fn g_free3(p: *mut ());
}