@@ -3,8 +3,89 @@ use PT_FIRSTMACH;
3
3
pub type c_long = i64 ;
4
4
pub type c_ulong = u64 ;
5
5
pub type c_char = u8 ;
6
+ pub type greg_t = u64 ;
6
7
pub type __cpu_simple_lock_nv_t = :: c_uchar ;
7
8
9
+ s ! {
10
+ pub struct __fregset {
11
+ #[ cfg( libc_union) ]
12
+ pub __qregs: [ __c_anonymous__freg; 32 ] ,
13
+ pub __fpcr: u32 ,
14
+ pub __fpsr: u32 ,
15
+ }
16
+
17
+ pub struct mcontext_t {
18
+ pub __gregs: [ :: greg_t; 32 ] ,
19
+ pub __fregs: __fregset,
20
+ __spare: [ :: greg_t; 8 ] ,
21
+ }
22
+
23
+ pub struct ucontext_t {
24
+ pub uc_flags: :: c_uint,
25
+ pub uc_link: * mut ucontext_t,
26
+ pub uc_sigmask: :: sigset_t,
27
+ pub uc_stack: :: stack_t,
28
+ pub uc_mcontext: mcontext_t,
29
+ }
30
+ }
31
+
32
+ s_no_extra_traits ! {
33
+ #[ cfg( libc_union) ]
34
+ #[ repr( align( 16 ) ) ]
35
+ pub union __c_anonymous__freg {
36
+ pub __b8: [ u8 ; 16 ] ,
37
+ pub __h16: [ u16 ; 8 ] ,
38
+ pub __s32: [ u32 ; 4 ] ,
39
+ pub __d64: [ u64 ; 2 ] ,
40
+ pub __q128: [ u128 ; 1 ] ,
41
+ }
42
+ }
43
+
44
+ cfg_if ! {
45
+ if #[ cfg( feature = "extra_traits" ) ] {
46
+ #[ cfg( libc_union) ]
47
+ impl PartialEq for __c_anonymous__freg {
48
+ fn eq( & self , other: & __c_anonymous__freg) -> bool {
49
+ unsafe {
50
+ self . __b8 == other. __b8
51
+ || self . __h16 == other. __h16
52
+ || self . __s32 == other. __s32
53
+ || self . __d64 == other. __d64
54
+ || self . __q128 == other. __q128
55
+ }
56
+ }
57
+ }
58
+ #[ cfg( libc_union) ]
59
+ impl Eq for __c_anonymous__freg { }
60
+ #[ cfg( libc_union) ]
61
+ impl :: fmt:: Debug for __c_anonymous__freg {
62
+ fn fmt( & self , f: & mut :: fmt:: Formatter ) -> :: fmt:: Result {
63
+ unsafe {
64
+ f. debug_struct( "__c_anonymous__freg" )
65
+ . field( "__b8" , & self . __b8)
66
+ . field( "__h16" , & self . __h16)
67
+ . field( "__s32" , & self . __s32)
68
+ . field( "__d64" , & self . __d64)
69
+ . field( "__q128" , & self . __q128)
70
+ . finish( )
71
+ }
72
+ }
73
+ }
74
+ #[ cfg( libc_union) ]
75
+ impl :: hash:: Hash for __c_anonymous__freg {
76
+ fn hash<H : :: hash:: Hasher >( & self , state: & mut H ) {
77
+ unsafe {
78
+ self . __b8. hash( state) ;
79
+ self . __h16. hash( state) ;
80
+ self . __s32. hash( state) ;
81
+ self . __d64. hash( state) ;
82
+ self . __q128. hash( state) ;
83
+ }
84
+ }
85
+ }
86
+ }
87
+ }
88
+
8
89
// should be pub(crate), but that requires Rust 1.18.0
9
90
cfg_if ! {
10
91
if #[ cfg( libc_const_size_of) ] {
0 commit comments