summaryrefslogtreecommitdiff
path: root/test cases/rust/27 objects/lib1-dylib.rs
blob: b5080e8f576e5e5b46fc3b43a1383e7281301fe9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
extern "C" {
    fn from_lib1();
}

#[no_mangle]
extern "C" fn from_lib2()
{
    println!("hello world from rust");
}

#[no_mangle]
pub extern "C" fn c_func()
{
    unsafe { from_lib1(); }
}

/// ```
/// #[cfg(not(nodep))] use lib12::rust_func;
/// #[cfg(nodep)] use lib12_nodep::rust_func;
/// rust_func();
/// ```
pub fn rust_func()
{
    unsafe { from_lib1(); }
}