Debian Codegraph @

test cases/rust/27 objects/lib1-dylib.rs

raw
1 extern "C" {
2 fn from_lib1();
3 }
4
5 #[no_mangle]
6 extern "C" fn from_lib2()
7 {
8 println!("hello world from rust");
9 }
10
11 #[no_mangle]
12 pub extern "C" fn c_func()
13 {
14 unsafe { from_lib1(); }
15 }
16
17 /// ```
18 /// #[cfg(not(nodep))] use lib12::rust_func;
19 /// #[cfg(nodep)] use lib12_nodep::rust_func;
20 /// rust_func();
21 /// ```
22 pub fn rust_func()
23 {
24 unsafe { from_lib1(); }
25 }