2014-08-01 23:25:41 -05:00
|
|
|
#![crate_type = "lib"]
|
|
|
|
|
|
|
|
#[repr(C)]
|
|
|
|
pub struct TestStruct<T> {
|
|
|
|
pub x: u8,
|
2020-09-01 16:12:52 -05:00
|
|
|
pub y: T,
|
2014-08-01 23:25:41 -05:00
|
|
|
}
|
|
|
|
|
2020-09-01 16:12:52 -05:00
|
|
|
pub extern "C" fn foo<T>(ts: TestStruct<T>) -> T {
|
|
|
|
ts.y
|
|
|
|
}
|
2014-08-01 23:25:41 -05:00
|
|
|
|
2016-12-05 18:31:05 -06:00
|
|
|
#[link(name = "test", kind = "static")]
|
2020-09-01 16:12:52 -05:00
|
|
|
extern "C" {
|
2014-08-01 23:25:41 -05:00
|
|
|
pub fn call(c: extern "C" fn(TestStruct<i32>) -> i32) -> i32;
|
|
|
|
}
|