@@ -520,14 +520,30 @@ s! {
520
520
pub ifa_data: * mut :: c_void
521
521
}
522
522
523
+ #[ cfg_attr( all( feature = "align" ,
524
+ target_pointer_width = "32" ,
525
+ any( target_arch = "mips" ,
526
+ target_arch = "arm" ,
527
+ target_arch = "powerpc" ,
528
+ target_arch = "x86_64" ) ) ,
529
+ repr( align( 4 ) ) ) ]
530
+ #[ cfg_attr( all( feature = "align" ,
531
+ any( target_pointer_width = "64" ,
532
+ not( any( target_arch = "mips" ,
533
+ target_arch = "arm" ,
534
+ target_arch = "powerpc" ,
535
+ target_arch = "x86_64" ) ) ) ) ,
536
+ repr( align( 8 ) ) ) ]
523
537
pub struct pthread_mutex_t {
524
- #[ cfg( any( target_arch = "mips" ,
525
- target_arch = "arm" ,
526
- target_arch = "powerpc" ,
527
- all( target_arch = "x86_64" ,
528
- target_pointer_width = "32" ) ) ) ]
538
+ #[ cfg( all( not( feature = "align" ) ,
539
+ any( target_arch = "mips" ,
540
+ target_arch = "arm" ,
541
+ target_arch = "powerpc" ,
542
+ all( target_arch = "x86_64" ,
543
+ target_pointer_width = "32" ) ) ) ) ]
529
544
__align: [ :: c_long; 0 ] ,
530
- #[ cfg( not( any( target_arch = "mips" ,
545
+ #[ cfg( not( any( feature = "align" ,
546
+ target_arch = "mips" ,
531
547
target_arch = "arm" ,
532
548
target_arch = "powerpc" ,
533
549
all( target_arch = "x86_64" ,
@@ -536,14 +552,30 @@ s! {
536
552
size: [ u8 ; __SIZEOF_PTHREAD_MUTEX_T] ,
537
553
}
538
554
555
+ #[ cfg_attr( all( feature = "align" ,
556
+ target_pointer_width = "32" ,
557
+ any( target_arch = "mips" ,
558
+ target_arch = "arm" ,
559
+ target_arch = "powerpc" ,
560
+ target_arch = "x86_64" ) ) ,
561
+ repr( align( 4 ) ) ) ]
562
+ #[ cfg_attr( all( feature = "align" ,
563
+ any( target_pointer_width = "64" ,
564
+ not( any( target_arch = "mips" ,
565
+ target_arch = "arm" ,
566
+ target_arch = "powerpc" ,
567
+ target_arch = "x86_64" ) ) ) ) ,
568
+ repr( align( 8 ) ) ) ]
539
569
pub struct pthread_rwlock_t {
540
- #[ cfg( any( target_arch = "mips" ,
541
- target_arch = "arm" ,
542
- target_arch = "powerpc" ,
543
- all( target_arch = "x86_64" ,
544
- target_pointer_width = "32" ) ) ) ]
570
+ #[ cfg( all( not( feature = "align" ) ,
571
+ any( target_arch = "mips" ,
572
+ target_arch = "arm" ,
573
+ target_arch = "powerpc" ,
574
+ all( target_arch = "x86_64" ,
575
+ target_pointer_width = "32" ) ) ) ) ]
545
576
__align: [ :: c_long; 0 ] ,
546
- #[ cfg( not( any( target_arch = "mips" ,
577
+ #[ cfg( not( any( feature = "align" ,
578
+ target_arch = "mips" ,
547
579
target_arch = "arm" ,
548
580
target_arch = "powerpc" ,
549
581
all( target_arch = "x86_64" ,
@@ -552,39 +584,78 @@ s! {
552
584
size: [ u8 ; __SIZEOF_PTHREAD_RWLOCK_T] ,
553
585
}
554
586
587
+ #[ cfg_attr( all( feature = "align" ,
588
+ any( target_pointer_width = "32" ,
589
+ target_arch = "x86_64" , target_arch = "powerpc64" ,
590
+ target_arch = "mips64" , target_arch = "s390x" ,
591
+ target_arch = "sparc64" ,
592
+ all( target_arch = "aarch64" , target_env = "musl" ) ) ) ,
593
+ repr( align( 4 ) ) ) ]
594
+ #[ cfg_attr( all( feature = "align" ,
595
+ not( any( target_pointer_width = "32" ,
596
+ target_arch = "x86_64" , target_arch = "powerpc64" ,
597
+ target_arch = "mips64" , target_arch = "s390x" ,
598
+ target_arch = "sparc64" ,
599
+ all( target_arch = "aarch64" , target_env = "musl" ) ) ) ) ,
600
+ repr( align( 8 ) ) ) ]
555
601
pub struct pthread_mutexattr_t {
556
- #[ cfg( any( target_arch = "x86_64" , target_arch = "powerpc64" ,
557
- target_arch = "mips64" , target_arch = "s390x" ,
558
- target_arch = "sparc64" ) ) ]
559
- __align: [ :: c_int; 0 ] ,
560
- #[ cfg( not( any( target_arch = "x86_64" , target_arch = "powerpc64" ,
602
+ #[ cfg( all( not( features = "align" ) ,
603
+ any( target_arch = "x86_64" , target_arch = "powerpc64" ,
561
604
target_arch = "mips64" , target_arch = "s390x" ,
562
- target_arch = "sparc64" , target_arch = "aarch64" ) ) ) ]
563
- __align: [ :: c_long; 0 ] ,
564
- #[ cfg( all( target_arch = "aarch64" , target_env = "gnu" ) ) ]
565
- __align: [ :: c_long; 0 ] ,
566
- #[ cfg( all( target_arch = "aarch64" , target_env = "musl" ) ) ]
605
+ target_arch = "sparc64" ,
606
+ all( target_arch = "aarch64" , target_env = "musl" ) ) ) ) ]
567
607
__align: [ :: c_int; 0 ] ,
608
+ #[ cfg( all( not( features = "align" ) ,
609
+ not( any( target_arch = "x86_64" , target_arch = "powerpc64" ,
610
+ target_arch = "mips64" , target_arch = "s390x" ,
611
+ target_arch = "sparc64" ,
612
+ all( target_arch = "aarch64" , target_env = "musl" ) ) ) ) ) ]
613
+ __align: [ :: c_long; 0 ] ,
568
614
size: [ u8 ; __SIZEOF_PTHREAD_MUTEXATTR_T] ,
569
615
}
570
616
617
+ #[ cfg_attr( all( feature = "align" ,
618
+ any( target_env = "musl" , target_pointer_width = "32" ) ) ,
619
+ repr( align( 4 ) ) ) ]
620
+ #[ cfg_attr( all( feature = "align" ,
621
+ not( target_env = "musl" ) ,
622
+ target_pointer_width = "64" ) ,
623
+ repr( align( 8 ) ) ) ]
571
624
pub struct pthread_rwlockattr_t {
572
- #[ cfg( any ( target_env = "musl" ) ) ]
625
+ #[ cfg( all ( not ( feature = "align" ) , target_env = "musl" ) ) ]
573
626
__align: [ :: c_int; 0 ] ,
574
- #[ cfg( not( any ( target_env = "musl" ) ) ) ]
627
+ #[ cfg( all ( not( feature = "align" ) , not ( target_env = "musl" ) ) ) ]
575
628
__align: [ :: c_long; 0 ] ,
576
629
size: [ u8 ; __SIZEOF_PTHREAD_RWLOCKATTR_T] ,
577
630
}
578
631
632
+ #[ cfg_attr( all( feature = "align" ,
633
+ target_env = "musl" ,
634
+ target_pointer_width = "32" ) ,
635
+ repr( align( 4 ) ) ) ]
636
+ #[ cfg_attr( all( feature = "align" ,
637
+ target_env = "musl" ,
638
+ target_pointer_width = "64" ) ,
639
+ repr( align( 8 ) ) ) ]
640
+ #[ cfg_attr( all( feature = "align" ,
641
+ not( target_env = "musl" ) ,
642
+ target_arch = "x86" ) ,
643
+ repr( align( 4 ) ) ) ]
644
+ #[ cfg_attr( all( feature = "align" ,
645
+ not( target_env = "musl" ) ,
646
+ not( target_arch = "x86" ) ) ,
647
+ repr( align( 8 ) ) ) ]
579
648
pub struct pthread_cond_t {
580
- #[ cfg( any ( target_env = "musl" ) ) ]
649
+ #[ cfg( all ( not ( feature = "align" ) , target_env = "musl" ) ) ]
581
650
__align: [ * const :: c_void; 0 ] ,
582
- #[ cfg( not( any( target_env = "musl" ) ) ) ]
651
+ #[ cfg( not( any( feature = "align" , target_env = "musl" ) ) ) ]
583
652
__align: [ :: c_longlong; 0 ] ,
584
653
size: [ u8 ; __SIZEOF_PTHREAD_COND_T] ,
585
654
}
586
655
656
+ #[ cfg_attr( feature = "align" , repr( align( 4 ) ) ) ]
587
657
pub struct pthread_condattr_t {
658
+ #[ cfg( not( feature = "align" ) ) ]
588
659
__align: [ :: c_int; 0 ] ,
589
660
size: [ u8 ; __SIZEOF_PTHREAD_CONDATTR_T] ,
590
661
}
@@ -2006,18 +2077,17 @@ pub const RTLD_NOW: ::c_int = 0x2;
2006
2077
2007
2078
pub const TCP_MD5SIG : :: c_int = 14 ;
2008
2079
2009
- pub const PTHREAD_MUTEX_INITIALIZER : pthread_mutex_t = pthread_mutex_t {
2010
- __align : [ ] ,
2011
- size : [ 0 ; __SIZEOF_PTHREAD_MUTEX_T] ,
2012
- } ;
2013
- pub const PTHREAD_COND_INITIALIZER : pthread_cond_t = pthread_cond_t {
2014
- __align : [ ] ,
2015
- size : [ 0 ; __SIZEOF_PTHREAD_COND_T] ,
2016
- } ;
2017
- pub const PTHREAD_RWLOCK_INITIALIZER : pthread_rwlock_t = pthread_rwlock_t {
2018
- __align : [ ] ,
2019
- size : [ 0 ; __SIZEOF_PTHREAD_RWLOCK_T] ,
2020
- } ;
2080
+ align_const ! {
2081
+ pub const PTHREAD_MUTEX_INITIALIZER : pthread_mutex_t = pthread_mutex_t {
2082
+ size: [ 0 ; __SIZEOF_PTHREAD_MUTEX_T] ,
2083
+ } ;
2084
+ pub const PTHREAD_COND_INITIALIZER : pthread_cond_t = pthread_cond_t {
2085
+ size: [ 0 ; __SIZEOF_PTHREAD_COND_T] ,
2086
+ } ;
2087
+ pub const PTHREAD_RWLOCK_INITIALIZER : pthread_rwlock_t = pthread_rwlock_t {
2088
+ size: [ 0 ; __SIZEOF_PTHREAD_RWLOCK_T] ,
2089
+ } ;
2090
+ }
2021
2091
pub const PTHREAD_MUTEX_NORMAL : :: c_int = 0 ;
2022
2092
pub const PTHREAD_MUTEX_RECURSIVE : :: c_int = 1 ;
2023
2093
pub const PTHREAD_MUTEX_ERRORCHECK : :: c_int = 2 ;
0 commit comments