-
Notifications
You must be signed in to change notification settings - Fork 670
/
merge-extern-blocks.rs
92 lines (91 loc) · 2.67 KB
/
merge-extern-blocks.rs
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#![allow(
dead_code,
non_snake_case,
non_camel_case_types,
non_upper_case_globals
)]
#[allow(non_snake_case, non_camel_case_types, non_upper_case_globals)]
pub mod root {
#[allow(unused_imports)]
use self::super::root;
#[repr(C)]
#[derive(Debug, Default, Copy, Clone)]
pub struct Point {
pub x: ::std::os::raw::c_int,
}
#[test]
fn bindgen_test_layout_Point() {
const UNINIT: ::std::mem::MaybeUninit<Point> =
::std::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::std::mem::size_of::<Point>(),
4usize,
concat!("Size of: ", stringify!(Point))
);
assert_eq!(
::std::mem::align_of::<Point>(),
4usize,
concat!("Alignment of ", stringify!(Point))
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).x) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(Point),
"::",
stringify!(x)
)
);
}
pub mod ns {
#[allow(unused_imports)]
use self::super::super::root;
#[repr(C)]
#[derive(Debug, Default, Copy, Clone)]
pub struct Point {
pub x: ::std::os::raw::c_int,
}
#[test]
fn bindgen_test_layout_Point() {
const UNINIT: ::std::mem::MaybeUninit<Point> =
::std::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::std::mem::size_of::<Point>(),
4usize,
concat!("Size of: ", stringify!(Point))
);
assert_eq!(
::std::mem::align_of::<Point>(),
4usize,
concat!("Alignment of ", stringify!(Point))
);
assert_eq!(
unsafe {
::std::ptr::addr_of!((*ptr).x) as usize - ptr as usize
},
0usize,
concat!(
"Offset of field: ",
stringify!(Point),
"::",
stringify!(x)
)
);
}
extern "C" {
#[link_name = "\u{1}_ZN2ns3fooEv"]
pub fn foo() -> ::std::os::raw::c_int;
#[link_name = "\u{1}_ZN2ns3barEv"]
pub fn bar() -> ::std::os::raw::c_int;
}
}
extern "C" {
#[link_name = "\u{1}_Z3foov"]
pub fn foo() -> ::std::os::raw::c_int;
#[link_name = "\u{1}_Z3barv"]
pub fn bar() -> ::std::os::raw::c_int;
}
}