@@ -573,32 +573,6 @@ s! {
573
573
__val: [ :: c_int; 2 ] ,
574
574
}
575
575
576
- // x32 compatibility
577
- // See https://sourceware.org/bugzilla/show_bug.cgi?id=21279
578
- pub struct mq_attr {
579
- #[ cfg( all( target_arch = "x86_64" , target_pointer_width = "32" ) ) ]
580
- pub mq_flags: i64 ,
581
- #[ cfg( all( target_arch = "x86_64" , target_pointer_width = "32" ) ) ]
582
- pub mq_maxmsg: i64 ,
583
- #[ cfg( all( target_arch = "x86_64" , target_pointer_width = "32" ) ) ]
584
- pub mq_msgsize: i64 ,
585
- #[ cfg( all( target_arch = "x86_64" , target_pointer_width = "32" ) ) ]
586
- pub mq_curmsgs: i64 ,
587
- #[ cfg( all( target_arch = "x86_64" , target_pointer_width = "32" ) ) ]
588
- pad: [ i64 ; 4 ] ,
589
-
590
- #[ cfg( not( all( target_arch = "x86_64" , target_pointer_width = "32" ) ) ) ]
591
- pub mq_flags: :: c_long,
592
- #[ cfg( not( all( target_arch = "x86_64" , target_pointer_width = "32" ) ) ) ]
593
- pub mq_maxmsg: :: c_long,
594
- #[ cfg( not( all( target_arch = "x86_64" , target_pointer_width = "32" ) ) ) ]
595
- pub mq_msgsize: :: c_long,
596
- #[ cfg( not( all( target_arch = "x86_64" , target_pointer_width = "32" ) ) ) ]
597
- pub mq_curmsgs: :: c_long,
598
- #[ cfg( not( all( target_arch = "x86_64" , target_pointer_width = "32" ) ) ) ]
599
- pad: [ :: c_long; 4 ] ,
600
- }
601
-
602
576
pub struct cpu_set_t {
603
577
#[ cfg( all( target_pointer_width = "32" ,
604
578
not( target_arch = "x86_64" ) ) ) ]
@@ -971,6 +945,32 @@ s_no_extra_traits! {
971
945
pub d_type: :: c_uchar,
972
946
pub d_name: [ :: c_char; 256 ] ,
973
947
}
948
+
949
+ // x32 compatibility
950
+ // See https://sourceware.org/bugzilla/show_bug.cgi?id=21279
951
+ pub struct mq_attr {
952
+ #[ cfg( all( target_arch = "x86_64" , target_pointer_width = "32" ) ) ]
953
+ pub mq_flags: i64 ,
954
+ #[ cfg( all( target_arch = "x86_64" , target_pointer_width = "32" ) ) ]
955
+ pub mq_maxmsg: i64 ,
956
+ #[ cfg( all( target_arch = "x86_64" , target_pointer_width = "32" ) ) ]
957
+ pub mq_msgsize: i64 ,
958
+ #[ cfg( all( target_arch = "x86_64" , target_pointer_width = "32" ) ) ]
959
+ pub mq_curmsgs: i64 ,
960
+ #[ cfg( all( target_arch = "x86_64" , target_pointer_width = "32" ) ) ]
961
+ pad: [ i64 ; 4 ] ,
962
+
963
+ #[ cfg( not( all( target_arch = "x86_64" , target_pointer_width = "32" ) ) ) ]
964
+ pub mq_flags: :: c_long,
965
+ #[ cfg( not( all( target_arch = "x86_64" , target_pointer_width = "32" ) ) ) ]
966
+ pub mq_maxmsg: :: c_long,
967
+ #[ cfg( not( all( target_arch = "x86_64" , target_pointer_width = "32" ) ) ) ]
968
+ pub mq_msgsize: :: c_long,
969
+ #[ cfg( not( all( target_arch = "x86_64" , target_pointer_width = "32" ) ) ) ]
970
+ pub mq_curmsgs: :: c_long,
971
+ #[ cfg( not( all( target_arch = "x86_64" , target_pointer_width = "32" ) ) ) ]
972
+ pad: [ :: c_long; 4 ] ,
973
+ }
974
974
}
975
975
976
976
cfg_if ! {
@@ -1211,6 +1211,34 @@ cfg_if! {
1211
1211
self . d_name. hash( state) ;
1212
1212
}
1213
1213
}
1214
+
1215
+ impl PartialEq for mq_attr {
1216
+ fn eq( & self , other: & mq_attr) -> bool {
1217
+ self . mq_flags == other. mq_flags &&
1218
+ self . mq_maxmsg == other. mq_maxmsg &&
1219
+ self . mq_msgsize == other. mq_msgsize &&
1220
+ self . mq_curmsgs == other. mq_curmsgs
1221
+ }
1222
+ }
1223
+ impl Eq for mq_attr { }
1224
+ impl :: fmt:: Debug for mq_attr {
1225
+ fn fmt( & self , f: & mut :: fmt:: Formatter ) -> :: fmt:: Result {
1226
+ f. debug_struct( "mq_attr" )
1227
+ . field( "mq_flags" , & self . mq_flags)
1228
+ . field( "mq_maxmsg" , & self . mq_maxmsg)
1229
+ . field( "mq_msgsize" , & self . mq_msgsize)
1230
+ . field( "mq_curmsgs" , & self . mq_curmsgs)
1231
+ . finish( )
1232
+ }
1233
+ }
1234
+ impl :: hash:: Hash for mq_attr {
1235
+ fn hash<H : :: hash:: Hasher >( & self , state: & mut H ) {
1236
+ self . mq_flags. hash( state) ;
1237
+ self . mq_maxmsg. hash( state) ;
1238
+ self . mq_msgsize. hash( state) ;
1239
+ self . mq_curmsgs. hash( state) ;
1240
+ }
1241
+ }
1214
1242
}
1215
1243
}
1216
1244
0 commit comments