File: alias.rs

package info (click to toggle)
rust-cbindgen 0.24.3-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,532 kB
  • sloc: ansic: 15; makefile: 11
file content (32 lines) | stat: -rw-r--r-- 369 bytes parent folder | download | duplicates (16)
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
26
27
28
29
30
31
32
#[repr(C)]
struct Dep {
    a: i32,
    b: f32,
}

#[repr(C)]
struct Foo<X> {
    a: X,
    b: X,
    c: Dep,
}

#[repr(u32)]
enum Status {
    Ok,
    Err,
}

type IntFoo = Foo<i32>;
type DoubleFoo = Foo<f64>;

type Unit = i32;
type SpecialStatus = Status;

#[no_mangle]
pub extern "C" fn root(
    x: IntFoo,
    y: DoubleFoo,
    z: Unit,
    w: SpecialStatus
) { }