@@ -166,8 +166,10 @@ s! {
166
166
pub s_addr: in_addr_t,
167
167
}
168
168
169
+ #[ cfg_attr( feature = "align" , repr( align( 4 ) ) ) ]
169
170
pub struct in6_addr {
170
171
pub s6_addr: [ u8 ; 16 ] ,
172
+ #[ cfg( not( feature = "align" ) ) ]
171
173
__align: [ u32 ; 0 ] ,
172
174
}
173
175
@@ -518,14 +520,30 @@ s! {
518
520
pub ifa_data: * mut :: c_void
519
521
}
520
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 ) ) ) ]
521
537
pub struct pthread_mutex_t {
522
- #[ cfg( any( target_arch = "mips" ,
523
- target_arch = "arm" ,
524
- target_arch = "powerpc" ,
525
- all( target_arch = "x86_64" ,
526
- 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" ) ) ) ) ]
527
544
__align: [ :: c_long; 0 ] ,
528
- #[ cfg( not( any( target_arch = "mips" ,
545
+ #[ cfg( not( any( feature = "align" ,
546
+ target_arch = "mips" ,
529
547
target_arch = "arm" ,
530
548
target_arch = "powerpc" ,
531
549
all( target_arch = "x86_64" ,
@@ -534,14 +552,30 @@ s! {
534
552
size: [ u8 ; __SIZEOF_PTHREAD_MUTEX_T] ,
535
553
}
536
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 ) ) ) ]
537
569
pub struct pthread_rwlock_t {
538
- #[ cfg( any( target_arch = "mips" ,
539
- target_arch = "arm" ,
540
- target_arch = "powerpc" ,
541
- all( target_arch = "x86_64" ,
542
- 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" ) ) ) ) ]
543
576
__align: [ :: c_long; 0 ] ,
544
- #[ cfg( not( any( target_arch = "mips" ,
577
+ #[ cfg( not( any( feature = "align" ,
578
+ target_arch = "mips" ,
545
579
target_arch = "arm" ,
546
580
target_arch = "powerpc" ,
547
581
all( target_arch = "x86_64" ,
@@ -550,39 +584,78 @@ s! {
550
584
size: [ u8 ; __SIZEOF_PTHREAD_RWLOCK_T] ,
551
585
}
552
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 ) ) ) ]
553
601
pub struct pthread_mutexattr_t {
554
- #[ cfg( any( target_arch = "x86_64" , target_arch = "powerpc64" ,
555
- target_arch = "mips64" , target_arch = "s390x" ,
556
- target_arch = "sparc64" ) ) ]
557
- __align: [ :: c_int; 0 ] ,
558
- #[ 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" ,
559
604
target_arch = "mips64" , target_arch = "s390x" ,
560
- target_arch = "sparc64" , target_arch = "aarch64" ) ) ) ]
561
- __align: [ :: c_long; 0 ] ,
562
- #[ cfg( all( target_arch = "aarch64" , target_env = "gnu" ) ) ]
563
- __align: [ :: c_long; 0 ] ,
564
- #[ cfg( all( target_arch = "aarch64" , target_env = "musl" ) ) ]
605
+ target_arch = "sparc64" ,
606
+ all( target_arch = "aarch64" , target_env = "musl" ) ) ) ) ]
565
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 ] ,
566
614
size: [ u8 ; __SIZEOF_PTHREAD_MUTEXATTR_T] ,
567
615
}
568
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 ) ) ) ]
569
624
pub struct pthread_rwlockattr_t {
570
- #[ cfg( any ( target_env = "musl" ) ) ]
625
+ #[ cfg( all ( not ( feature = "align" ) , target_env = "musl" ) ) ]
571
626
__align: [ :: c_int; 0 ] ,
572
- #[ cfg( not( any ( target_env = "musl" ) ) ) ]
627
+ #[ cfg( all ( not( feature = "align" ) , not ( target_env = "musl" ) ) ) ]
573
628
__align: [ :: c_long; 0 ] ,
574
629
size: [ u8 ; __SIZEOF_PTHREAD_RWLOCKATTR_T] ,
575
630
}
576
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 ) ) ) ]
577
648
pub struct pthread_cond_t {
578
- #[ cfg( any ( target_env = "musl" ) ) ]
649
+ #[ cfg( all ( not ( feature = "align" ) , target_env = "musl" ) ) ]
579
650
__align: [ * const :: c_void; 0 ] ,
580
- #[ cfg( not( any( target_env = "musl" ) ) ) ]
651
+ #[ cfg( not( any( feature = "align" , target_env = "musl" ) ) ) ]
581
652
__align: [ :: c_longlong; 0 ] ,
582
653
size: [ u8 ; __SIZEOF_PTHREAD_COND_T] ,
583
654
}
584
655
656
+ #[ cfg_attr( feature = "align" , repr( align( 4 ) ) ) ]
585
657
pub struct pthread_condattr_t {
658
+ #[ cfg( not( feature = "align" ) ) ]
586
659
__align: [ :: c_int; 0 ] ,
587
660
size: [ u8 ; __SIZEOF_PTHREAD_CONDATTR_T] ,
588
661
}
@@ -2004,18 +2077,17 @@ pub const RTLD_NOW: ::c_int = 0x2;
2004
2077
2005
2078
pub const TCP_MD5SIG : :: c_int = 14 ;
2006
2079
2007
- pub const PTHREAD_MUTEX_INITIALIZER : pthread_mutex_t = pthread_mutex_t {
2008
- __align : [ ] ,
2009
- size : [ 0 ; __SIZEOF_PTHREAD_MUTEX_T] ,
2010
- } ;
2011
- pub const PTHREAD_COND_INITIALIZER : pthread_cond_t = pthread_cond_t {
2012
- __align : [ ] ,
2013
- size : [ 0 ; __SIZEOF_PTHREAD_COND_T] ,
2014
- } ;
2015
- pub const PTHREAD_RWLOCK_INITIALIZER : pthread_rwlock_t = pthread_rwlock_t {
2016
- __align : [ ] ,
2017
- size : [ 0 ; __SIZEOF_PTHREAD_RWLOCK_T] ,
2018
- } ;
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
+ }
2019
2091
pub const PTHREAD_MUTEX_NORMAL : :: c_int = 0 ;
2020
2092
pub const PTHREAD_MUTEX_RECURSIVE : :: c_int = 1 ;
2021
2093
pub const PTHREAD_MUTEX_ERRORCHECK : :: c_int = 2 ;
0 commit comments