@@ -534,20 +534,17 @@ s! {
534
534
}
535
535
536
536
s_no_extra_traits ! {
537
- #[ cfg( libc_union) ]
538
537
pub union __sigaction_sa_union {
539
538
pub __su_handler: extern fn ( c: :: c_int) ,
540
539
pub __su_sigaction: extern fn ( c: :: c_int, info: * mut siginfo_t, ptr: * mut :: c_void) ,
541
540
}
542
541
543
542
pub struct sigaction {
544
- #[ cfg( libc_union) ]
545
543
pub sa_union: __sigaction_sa_union,
546
544
pub sa_mask: sigset_t,
547
545
pub sa_flags: :: c_int,
548
546
}
549
547
550
- #[ cfg( libc_union) ]
551
548
pub union __poll_ctl_ext_u {
552
549
pub addr: * mut :: c_void,
553
550
pub data32: u32 ,
@@ -559,15 +556,13 @@ s_no_extra_traits! {
559
556
pub command: u8 ,
560
557
pub events: :: c_short,
561
558
pub fd: :: c_int,
562
- #[ cfg( libc_union) ]
563
559
pub u: __poll_ctl_ext_u,
564
560
pub reversed64: [ u64 ; 6 ] ,
565
561
}
566
562
}
567
563
568
564
cfg_if ! {
569
565
if #[ cfg( feature = "extra_traits" ) ] {
570
- #[ cfg( libc_union) ]
571
566
impl PartialEq for __sigaction_sa_union {
572
567
fn eq( & self , other: & __sigaction_sa_union) -> bool {
573
568
unsafe {
@@ -576,9 +571,7 @@ cfg_if! {
576
571
}
577
572
}
578
573
}
579
- #[ cfg( libc_union) ]
580
574
impl Eq for __sigaction_sa_union { }
581
- #[ cfg( libc_union) ]
582
575
impl :: fmt:: Debug for __sigaction_sa_union {
583
576
fn fmt( & self , f: & mut :: fmt:: Formatter ) -> :: fmt:: Result {
584
577
f. debug_struct( "__sigaction_sa_union" )
@@ -587,7 +580,6 @@ cfg_if! {
587
580
. finish( )
588
581
}
589
582
}
590
- #[ cfg( libc_union) ]
591
583
impl :: hash:: Hash for __sigaction_sa_union {
592
584
fn hash<H : :: hash:: Hasher >( & self , state: & mut H ) {
593
585
unsafe {
@@ -599,36 +591,29 @@ cfg_if! {
599
591
600
592
impl PartialEq for sigaction {
601
593
fn eq( & self , other: & sigaction) -> bool {
602
- #[ cfg( libc_union) ]
603
- let union_eq = self . sa_union == other. sa_union;
604
- #[ cfg( not( libc_union) ) ]
605
- let union_eq = true ;
606
594
self . sa_mask == other. sa_mask
607
595
&& self . sa_flags == other. sa_flags
608
- && union_eq
596
+ && self . sa_union == other . sa_union
609
597
}
610
598
}
611
599
impl Eq for sigaction { }
612
600
impl :: fmt:: Debug for sigaction {
613
601
fn fmt( & self , f: & mut :: fmt:: Formatter ) -> :: fmt:: Result {
614
- let mut struct_formatter = f. debug_struct( "sigaction" ) ;
615
- #[ cfg( libc_union) ]
616
- struct_formatter. field( "sa_union" , & self . sa_union) ;
617
- struct_formatter. field( "sa_mask" , & self . sa_mask) ;
618
- struct_formatter. field( "sa_flags" , & self . sa_flags) ;
619
- struct_formatter. finish( )
602
+ f. debug_struct( "sigaction" )
603
+ . field( "sa_union" , & self . sa_union)
604
+ . field( "sa_mask" , & self . sa_mask)
605
+ . field( "sa_flags" , & self . sa_flags)
606
+ . finish( )
620
607
}
621
608
}
622
609
impl :: hash:: Hash for sigaction {
623
610
fn hash<H : :: hash:: Hasher >( & self , state: & mut H ) {
624
- #[ cfg( libc_union) ]
625
611
self . sa_union. hash( state) ;
626
612
self . sa_mask. hash( state) ;
627
613
self . sa_flags. hash( state) ;
628
614
}
629
615
}
630
616
631
- #[ cfg( libc_union) ]
632
617
impl PartialEq for __poll_ctl_ext_u {
633
618
fn eq( & self , other: & __poll_ctl_ext_u) -> bool {
634
619
unsafe {
@@ -638,9 +623,7 @@ cfg_if! {
638
623
}
639
624
}
640
625
}
641
- #[ cfg( libc_union) ]
642
626
impl Eq for __poll_ctl_ext_u { }
643
- #[ cfg( libc_union) ]
644
627
impl :: fmt:: Debug for __poll_ctl_ext_u {
645
628
fn fmt( & self , f: & mut :: fmt:: Formatter ) -> :: fmt:: Result {
646
629
f. debug_struct( "__poll_ctl_ext_u" )
@@ -650,7 +633,6 @@ cfg_if! {
650
633
. finish( )
651
634
}
652
635
}
653
- #[ cfg( libc_union) ]
654
636
impl :: hash:: Hash for __poll_ctl_ext_u {
655
637
fn hash<H : :: hash:: Hasher >( & self , state: & mut H ) {
656
638
unsafe {
@@ -663,30 +645,25 @@ cfg_if! {
663
645
664
646
impl PartialEq for poll_ctl_ext {
665
647
fn eq( & self , other: & poll_ctl_ext) -> bool {
666
- #[ cfg( libc_union) ]
667
- let union_eq = self . u == other. u;
668
- #[ cfg( not( libc_union) ) ]
669
- let union_eq = true ;
670
648
self . version == other. version
671
649
&& self . command == other. command
672
650
&& self . events == other. events
673
651
&& self . fd == other. fd
674
652
&& self . reversed64 == other. reversed64
675
- && union_eq
653
+ && self . u == other . u
676
654
}
677
655
}
678
656
impl Eq for poll_ctl_ext { }
679
657
impl :: fmt:: Debug for poll_ctl_ext {
680
658
fn fmt( & self , f: & mut :: fmt:: Formatter ) -> :: fmt:: Result {
681
- let mut struct_formatter = f. debug_struct( "poll_ctl_ext" ) ;
682
- struct_formatter. field( "version" , & self . version) ;
683
- struct_formatter. field( "command" , & self . command) ;
684
- struct_formatter. field( "events" , & self . events) ;
685
- struct_formatter. field( "fd" , & self . fd) ;
686
- #[ cfg( libc_union) ]
687
- struct_formatter. field( "u" , & self . u) ;
688
- struct_formatter. field( "reversed64" , & self . reversed64) ;
689
- struct_formatter. finish( )
659
+ f. debug_struct( "poll_ctl_ext" )
660
+ . field( "version" , & self . version)
661
+ . field( "command" , & self . command)
662
+ . field( "events" , & self . events)
663
+ . field( "fd" , & self . fd)
664
+ . field( "u" , & self . u)
665
+ . field( "reversed64" , & self . reversed64)
666
+ . finish( )
690
667
}
691
668
}
692
669
impl :: hash:: Hash for poll_ctl_ext {
@@ -695,7 +672,6 @@ cfg_if! {
695
672
self . command. hash( state) ;
696
673
self . events. hash( state) ;
697
674
self . fd. hash( state) ;
698
- #[ cfg( libc_union) ]
699
675
self . u. hash( state) ;
700
676
self . reversed64. hash( state) ;
701
677
}
0 commit comments