2018-10-01 23:37:51 +02:00
|
|
|
#[repr(C)]
|
|
|
|
struct Foo {
|
|
|
|
a: i32,
|
|
|
|
b: u32,
|
|
|
|
}
|
|
|
|
|
2019-03-06 19:33:56 +01:00
|
|
|
struct Bar {
|
|
|
|
a: i32,
|
|
|
|
b: u32,
|
|
|
|
}
|
|
|
|
|
2018-10-01 23:37:51 +02:00
|
|
|
impl Foo {
|
2019-04-16 10:25:23 +01:00
|
|
|
pub const FOO: Foo = Foo { a: 42, b: 47, };
|
|
|
|
pub const FOO2: Self = Foo { a: 42, b: 47, };
|
|
|
|
pub const FOO3: Self = Self { a: 42, b: 47, };
|
|
|
|
pub const BAZ: Bar = Bar { a: 42, b: 47, };
|
2018-10-01 23:37:51 +02:00
|
|
|
}
|
|
|
|
|
2019-04-16 10:25:23 +01:00
|
|
|
pub const BAR: Foo = Foo { a: 42, b: 1337, };
|
|
|
|
pub const BAZZ: Bar = Bar { a: 42, b: 1337, };
|
2018-10-01 23:37:51 +02:00
|
|
|
|
|
|
|
#[no_mangle]
|
2019-03-06 19:33:56 +01:00
|
|
|
pub extern "C" fn root(x: Foo, bar: Bar) { }
|