@@ -882,6 +882,35 @@ s! {
882
882
pub ipi6_addr: :: in6_addr,
883
883
pub ipi6_ifindex: :: c_uint,
884
884
}
885
+
886
+ #[ cfg_attr(
887
+ any(
888
+ target_pointer_width = "32" ,
889
+ target_arch = "x86_64"
890
+ ) ,
891
+ repr( align( 4 ) ) ) ]
892
+ #[ cfg_attr(
893
+ not( any(
894
+ target_pointer_width = "32" ,
895
+ target_arch = "x86_64"
896
+ ) ) ,
897
+ repr( align( 8 ) ) ) ]
898
+ pub struct pthread_mutexattr_t {
899
+ size: [ u8 ; :: __SIZEOF_PTHREAD_MUTEXATTR_T] ,
900
+ }
901
+
902
+ #[ cfg_attr( target_pointer_width = "32" ,
903
+ repr( align( 4 ) ) ) ]
904
+ #[ cfg_attr( target_pointer_width = "64" ,
905
+ repr( align( 8 ) ) ) ]
906
+ pub struct pthread_rwlockattr_t {
907
+ size: [ u8 ; :: __SIZEOF_PTHREAD_RWLOCKATTR_T] ,
908
+ }
909
+
910
+ #[ repr( align( 4 ) ) ]
911
+ pub struct pthread_condattr_t {
912
+ size: [ u8 ; :: __SIZEOF_PTHREAD_CONDATTR_T] ,
913
+ }
885
914
}
886
915
887
916
s_no_extra_traits ! {
@@ -979,6 +1008,42 @@ s_no_extra_traits! {
979
1008
pub sigev_notify_attributes: * mut pthread_attr_t,
980
1009
pub __pad: [ :: c_char; 56 - 3 * 8 /* 8 == sizeof(long) */ ] ,
981
1010
}
1011
+
1012
+ #[ cfg_attr( all( target_pointer_width = "32" ,
1013
+ any( target_arch = "arm" ,
1014
+ target_arch = "x86_64" ) ) ,
1015
+ repr( align( 4 ) ) ) ]
1016
+ #[ cfg_attr( any( target_pointer_width = "64" ,
1017
+ not( any( target_arch = "arm" ,
1018
+ target_arch = "x86_64" ) ) ) ,
1019
+ repr( align( 8 ) ) ) ]
1020
+ pub struct pthread_mutex_t {
1021
+ size: [ u8 ; :: __SIZEOF_PTHREAD_MUTEX_T] ,
1022
+ }
1023
+
1024
+ #[ cfg_attr( all( target_pointer_width = "32" ,
1025
+ any( target_arch = "arm" ,
1026
+ target_arch = "x86_64" ) ) ,
1027
+ repr( align( 4 ) ) ) ]
1028
+ #[ cfg_attr( any( target_pointer_width = "64" ,
1029
+ not( any( target_arch = "arm" ,
1030
+ target_arch = "x86_64" ) ) ) ,
1031
+ repr( align( 8 ) ) ) ]
1032
+ pub struct pthread_rwlock_t {
1033
+ size: [ u8 ; :: __SIZEOF_PTHREAD_RWLOCK_T] ,
1034
+ }
1035
+
1036
+ #[ cfg_attr( target_pointer_width = "32" ,
1037
+ repr( align( 4 ) ) ) ]
1038
+ #[ cfg_attr( target_pointer_width = "64" ,
1039
+ repr( align( 8 ) ) ) ]
1040
+ #[ cfg_attr( target_arch = "x86" ,
1041
+ repr( align( 4 ) ) ) ]
1042
+ #[ cfg_attr( not( target_arch = "x86" ) ,
1043
+ repr( align( 8 ) ) ) ]
1044
+ pub struct pthread_cond_t {
1045
+ size: [ u8 ; :: __SIZEOF_PTHREAD_COND_T] ,
1046
+ }
982
1047
}
983
1048
984
1049
cfg_if ! {
@@ -1306,6 +1371,72 @@ cfg_if! {
1306
1371
self . sigev_notify_attributes. hash( state) ;
1307
1372
}
1308
1373
}
1374
+
1375
+ impl PartialEq for pthread_cond_t {
1376
+ fn eq( & self , other: & pthread_cond_t) -> bool {
1377
+ self . size
1378
+ . iter( )
1379
+ . zip( other. size. iter( ) )
1380
+ . all( |( a, b) | a == b)
1381
+ }
1382
+ }
1383
+ impl Eq for pthread_cond_t { }
1384
+ impl :: fmt:: Debug for pthread_cond_t {
1385
+ fn fmt( & self , f: & mut :: fmt:: Formatter ) -> :: fmt:: Result {
1386
+ f. debug_struct( "pthread_cond_t" )
1387
+ // FIXME: .field("size", &self.size)
1388
+ . finish( )
1389
+ }
1390
+ }
1391
+ impl :: hash:: Hash for pthread_cond_t {
1392
+ fn hash<H : :: hash:: Hasher >( & self , state: & mut H ) {
1393
+ self . size. hash( state) ;
1394
+ }
1395
+ }
1396
+
1397
+ impl PartialEq for pthread_mutex_t {
1398
+ fn eq( & self , other: & pthread_mutex_t) -> bool {
1399
+ self . size
1400
+ . iter( )
1401
+ . zip( other. size. iter( ) )
1402
+ . all( |( a, b) | a == b)
1403
+ }
1404
+ }
1405
+ impl Eq for pthread_mutex_t { }
1406
+ impl :: fmt:: Debug for pthread_mutex_t {
1407
+ fn fmt( & self , f: & mut :: fmt:: Formatter ) -> :: fmt:: Result {
1408
+ f. debug_struct( "pthread_mutex_t" )
1409
+ // FIXME: .field("size", &self.size)
1410
+ . finish( )
1411
+ }
1412
+ }
1413
+ impl :: hash:: Hash for pthread_mutex_t {
1414
+ fn hash<H : :: hash:: Hasher >( & self , state: & mut H ) {
1415
+ self . size. hash( state) ;
1416
+ }
1417
+ }
1418
+
1419
+ impl PartialEq for pthread_rwlock_t {
1420
+ fn eq( & self , other: & pthread_rwlock_t) -> bool {
1421
+ self . size
1422
+ . iter( )
1423
+ . zip( other. size. iter( ) )
1424
+ . all( |( a, b) | a == b)
1425
+ }
1426
+ }
1427
+ impl Eq for pthread_rwlock_t { }
1428
+ impl :: fmt:: Debug for pthread_rwlock_t {
1429
+ fn fmt( & self , f: & mut :: fmt:: Formatter ) -> :: fmt:: Result {
1430
+ f. debug_struct( "pthread_rwlock_t" )
1431
+ // FIXME: .field("size", &self.size)
1432
+ . finish( )
1433
+ }
1434
+ }
1435
+ impl :: hash:: Hash for pthread_rwlock_t {
1436
+ fn hash<H : :: hash:: Hasher >( & self , state: & mut H ) {
1437
+ self . size. hash( state) ;
1438
+ }
1439
+ }
1309
1440
}
1310
1441
}
1311
1442
@@ -2315,17 +2446,15 @@ pub const RTLD_NOW: ::c_int = 0x2;
2315
2446
2316
2447
pub const TCP_MD5SIG : :: c_int = 14 ;
2317
2448
2318
- align_const ! {
2319
- pub const PTHREAD_MUTEX_INITIALIZER : pthread_mutex_t = pthread_mutex_t {
2320
- size: [ 0 ; __SIZEOF_PTHREAD_MUTEX_T] ,
2321
- } ;
2322
- pub const PTHREAD_COND_INITIALIZER : pthread_cond_t = pthread_cond_t {
2323
- size: [ 0 ; __SIZEOF_PTHREAD_COND_T] ,
2324
- } ;
2325
- pub const PTHREAD_RWLOCK_INITIALIZER : pthread_rwlock_t = pthread_rwlock_t {
2326
- size: [ 0 ; __SIZEOF_PTHREAD_RWLOCK_T] ,
2327
- } ;
2328
- }
2449
+ pub const PTHREAD_MUTEX_INITIALIZER : pthread_mutex_t = pthread_mutex_t {
2450
+ size : [ 0 ; __SIZEOF_PTHREAD_MUTEX_T] ,
2451
+ } ;
2452
+ pub const PTHREAD_COND_INITIALIZER : pthread_cond_t = pthread_cond_t {
2453
+ size : [ 0 ; __SIZEOF_PTHREAD_COND_T] ,
2454
+ } ;
2455
+ pub const PTHREAD_RWLOCK_INITIALIZER : pthread_rwlock_t = pthread_rwlock_t {
2456
+ size : [ 0 ; __SIZEOF_PTHREAD_RWLOCK_T] ,
2457
+ } ;
2329
2458
pub const PTHREAD_MUTEX_NORMAL : :: c_int = 0 ;
2330
2459
pub const PTHREAD_MUTEX_RECURSIVE : :: c_int = 1 ;
2331
2460
pub const PTHREAD_MUTEX_ERRORCHECK : :: c_int = 2 ;
@@ -4362,17 +4491,6 @@ cfg_if! {
4362
4491
}
4363
4492
}
4364
4493
4365
- cfg_if ! {
4366
- if #[ cfg( libc_align) ] {
4367
- #[ macro_use]
4368
- mod align;
4369
- } else {
4370
- #[ macro_use]
4371
- mod no_align;
4372
- }
4373
- }
4374
- expand_align ! ( ) ;
4375
-
4376
4494
cfg_if ! {
4377
4495
if #[ cfg( libc_core_cvoid) ] {
4378
4496
pub use :: ffi:: c_void;
0 commit comments