42 lines
554 B
Rust
42 lines
554 B
Rust
#[cfg(all(unix, x11))]
|
|
#[repr(u32)]
|
|
enum FooType {
|
|
A,
|
|
B,
|
|
C,
|
|
}
|
|
|
|
#[cfg(all(unix, x11))]
|
|
#[repr(C)]
|
|
struct FooHandle {
|
|
ty: FooType,
|
|
x: i32,
|
|
y: f32,
|
|
}
|
|
|
|
#[cfg(any(windows, target_pointer_width="32"))]
|
|
#[repr(u32)]
|
|
enum BarType {
|
|
A,
|
|
B,
|
|
C,
|
|
}
|
|
|
|
#[cfg(any(windows, target_pointer_width="32"))]
|
|
#[repr(C)]
|
|
struct BarHandle {
|
|
ty: BarType,
|
|
x: i32,
|
|
y: f32,
|
|
}
|
|
|
|
#[cfg(all(unix, x11))]
|
|
#[no_mangle]
|
|
extern "C" fn root(a: FooHandle)
|
|
{ }
|
|
|
|
#[cfg(any(windows, target_pointer_width="32"))]
|
|
#[no_mangle]
|
|
extern "C" fn root(a: BarHandle)
|
|
{ }
|