@@ -6,6 +6,72 @@ pub type time_t = i64;
66pub type suseconds_t = i32 ;
77pub type register_t = i32 ;
88
9+ cfg_if ! {
10+ if #[ cfg( libc_align) ] {
11+ s_no_extra_traits! {
12+ #[ repr( align( 16 ) ) ]
13+ pub struct mcontext_t {
14+ pub mc_vers: :: c_int,
15+ pub mc_flags: :: c_int,
16+ pub mc_onstack: :: c_int,
17+ pub mc_len: :: c_int,
18+ pub mc_avec: [ u64 ; 64 ] ,
19+ pub mc_av: [ u32 ; 2 ] ,
20+ pub mc_frame: [ :: register_t; 42 ] ,
21+ pub mc_fpreg: [ u64 ; 33 ] ,
22+ pub mc_vsxfpreg: [ u64 ; 32 ] ,
23+ }
24+ }
25+ }
26+ }
27+
28+ cfg_if ! {
29+ if #[ cfg( all( libc_align, feature = "extra_traits" ) ) ] {
30+ impl PartialEq for mcontext_t {
31+ fn eq( & self , other: & mcontext_t) -> bool {
32+ self . mc_vers == other. mc_vers &&
33+ self . mc_flags == other. mc_flags &&
34+ self . mc_onstack == other. mc_onstack &&
35+ self . mc_len == other. mc_len &&
36+ self . mc_avec == other. mc_avec &&
37+ self . mc_av == other. mc_av &&
38+ self . mc_frame == other. mc_frame &&
39+ self . mc_fpreg == other. mc_fpreg &&
40+ self . mc_vsxfpreg == other. mc_vsxfpreg
41+ }
42+ }
43+ impl Eq for mcontext_t { }
44+ impl :: fmt:: Debug for mcontext_t {
45+ fn fmt( & self , f: & mut :: fmt:: Formatter ) -> :: fmt:: Result {
46+ f. debug_struct( "mcontext_t" )
47+ . field( "mc_vers" , & self . mc_vers)
48+ . field( "mc_flags" , & self . mc_flags)
49+ . field( "mc_onstack" , & self . mc_onstack)
50+ . field( "mc_len" , & self . mc_len)
51+ . field( "mc_avec" , & self . mc_avec)
52+ . field( "mc_av" , & self . mc_av)
53+ . field( "mc_frame" , & self . mc_frame)
54+ . field( "mc_fpreg" , & self . mc_fpreg)
55+ . field( "mc_vsxfpreg" , & self . mc_vsxfpreg)
56+ . finish( )
57+ }
58+ }
59+ impl :: hash:: Hash for mcontext_t {
60+ fn hash<H : :: hash:: Hasher >( & self , state: & mut H ) {
61+ self . mc_vers. hash( state) ;
62+ self . mc_flags. hash( state) ;
63+ self . mc_onstack. hash( state) ;
64+ self . mc_len. hash( state) ;
65+ self . mc_avec. hash( state) ;
66+ self . mc_av. hash( state) ;
67+ self . mc_frame. hash( state) ;
68+ self . mc_fpreg. hash( state) ;
69+ self . mc_vsxfpreg. hash( state) ;
70+ }
71+ }
72+ }
73+ }
74+
975// should be pub(crate), but that requires Rust 1.18.0
1076cfg_if ! {
1177 if #[ cfg( libc_const_size_of) ] {
0 commit comments