File: struct_literal_order.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 (28 lines) | stat: -rw-r--r-- 553 bytes parent folder | download | duplicates (14)
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
#[repr(C)]
struct ABC {
    pub a: f32,
    pub b: u32,
    pub c: u32,
}

#[repr(C)]
struct BAC {
    pub b: u32,
    pub a: f32,
    pub c: i32,
}

impl ABC {
    pub const abc: ABC = ABC { a: 1.0, b: 2, c: 3 };
    pub const bac: ABC = ABC { b: 2, a: 1.0, c: 3 };
    pub const cba: ABC = ABC { c: 3, b: 2, a: 1.0 };
}

impl BAC {
    pub const abc: BAC = BAC { a: 2.0, b: 1, c: 3 };
    pub const bac: BAC = BAC { b: 1, a: 2.0, c: 3 };
    pub const cba: BAC = BAC { c: 3, b: 1, a: 2.0 };
}

#[no_mangle]
pub extern "C" fn root(a1: ABC, a2: BAC) {}