@@ -345,39 +345,176 @@ s! {
345
345
}
346
346
347
347
s_no_extra_traits ! {
348
- #[ allow( missing_debug_implementations) ]
349
348
#[ cfg( libc_union) ]
350
349
pub union __sigaction_sa_union {
351
350
pub __su_handler: extern fn ( c: :: c_int) ,
352
351
pub __su_sigaction: extern fn ( c: :: c_int, info: * mut siginfo_t, ptr: * mut :: c_void) ,
353
352
}
354
353
355
- #[ allow( missing_debug_implementations) ]
356
354
pub struct sigaction {
355
+ #[ cfg( libc_union) ]
357
356
pub sa_union: __sigaction_sa_union,
358
357
pub sa_mask: sigset_t,
359
358
pub sa_flags: :: c_int,
360
359
}
361
360
362
- #[ allow( missing_debug_implementations) ]
363
361
#[ cfg( libc_union) ]
364
362
pub union __poll_ctl_ext_u {
365
363
pub addr: * mut :: c_void,
366
364
pub data32: u32 ,
367
365
pub data: u64 ,
368
366
}
369
367
370
- #[ allow( missing_debug_implementations) ]
371
368
pub struct poll_ctl_ext {
372
369
pub version: u8 ,
373
370
pub command: u8 ,
374
371
pub events: :: c_short,
375
372
pub fd: :: c_int,
373
+ #[ cfg( libc_union) ]
376
374
pub u: __poll_ctl_ext_u,
377
375
pub reversed64: [ u64 ; 6 ] ,
378
376
}
379
377
}
380
378
379
+
380
+ cfg_if ! {
381
+ if #[ cfg( feature = "extra_traits" ) ] {
382
+ #[ cfg( libc_union) ]
383
+ impl PartialEq for __sigaction_sa_union {
384
+ fn eq( & self , other: & __sigaction_sa_union) -> bool {
385
+ unsafe {
386
+ self . __su_handler == other. __su_handler
387
+ && self . __su_sigaction == other. __su_sigaction
388
+ }
389
+ }
390
+ }
391
+ #[ cfg( libc_union) ]
392
+ impl Eq for __sigaction_sa_union { }
393
+ #[ cfg( libc_union) ]
394
+ impl :: fmt:: Debug for __sigaction_sa_union {
395
+ fn fmt( & self , f: & mut :: fmt:: Formatter ) -> :: fmt:: Result {
396
+ f. debug_struct( "__sigaction_sa_union" )
397
+ . field( "__su_handler" , unsafe { & self . __su_handler } )
398
+ . field( "__su_sigaction" , unsafe { & self . __su_sigaction } )
399
+ . finish( )
400
+ }
401
+ }
402
+ #[ cfg( libc_union) ]
403
+ impl :: hash:: Hash for __sigaction_sa_union {
404
+ fn hash<H : :: hash:: Hasher >( & self , state: & mut H ) {
405
+ unsafe {
406
+ self . __su_handler. hash( state) ;
407
+ self . __su_sigaction. hash( state) ;
408
+ }
409
+ }
410
+ }
411
+
412
+ impl PartialEq for sigaction {
413
+ fn eq( & self , other: & sigaction) -> bool {
414
+ #[ cfg( libc_union) ]
415
+ let union_eq = self . sa_union == other. sa_union;
416
+ #[ cfg( not( libc_union) ) ]
417
+ let union_eq = true ;
418
+ self . sa_mask == other. sa_mask
419
+ && self . sa_flags == other. sa_flags
420
+ && union_eq
421
+ }
422
+ }
423
+ impl Eq for sigaction { }
424
+ impl :: fmt:: Debug for sigaction {
425
+ fn fmt( & self , f: & mut :: fmt:: Formatter ) -> :: fmt:: Result {
426
+ let mut struct_formatter = f. debug_struct( "sigaction" ) ;
427
+ #[ cfg( libc_union) ]
428
+ struct_formatter. field( "sa_union" , & self . sa_union) ;
429
+ struct_formatter. field( "sa_mask" , & self . sa_mask) ;
430
+ struct_formatter. field( "sa_flags" , & self . sa_flags) ;
431
+ struct_formatter. finish( )
432
+ }
433
+ }
434
+ impl :: hash:: Hash for sigaction {
435
+ fn hash<H : :: hash:: Hasher >( & self , state: & mut H ) {
436
+ #[ cfg( libc_union) ]
437
+ self . sa_union. hash( state) ;
438
+ self . sa_mask. hash( state) ;
439
+ self . sa_flags. hash( state) ;
440
+ }
441
+ }
442
+
443
+ #[ cfg( libc_union) ]
444
+ impl PartialEq for __poll_ctl_ext_u {
445
+ fn eq( & self , other: & __poll_ctl_ext_u) -> bool {
446
+ unsafe {
447
+ self . addr == other. addr
448
+ && self . data32 == other. data32
449
+ && self . data == other. data
450
+ }
451
+ }
452
+ }
453
+ #[ cfg( libc_union) ]
454
+ impl Eq for __poll_ctl_ext_u { }
455
+ #[ cfg( libc_union) ]
456
+ impl :: fmt:: Debug for __poll_ctl_ext_u {
457
+ fn fmt( & self , f: & mut :: fmt:: Formatter ) -> :: fmt:: Result {
458
+ f. debug_struct( "__poll_ctl_ext_u" )
459
+ . field( "addr" , unsafe { & self . addr } )
460
+ . field( "data32" , unsafe { & self . data32 } )
461
+ . field( "data" , unsafe { & self . data } )
462
+ . finish( )
463
+ }
464
+ }
465
+ #[ cfg( libc_union) ]
466
+ impl :: hash:: Hash for __poll_ctl_ext_u {
467
+ fn hash<H : :: hash:: Hasher >( & self , state: & mut H ) {
468
+ unsafe {
469
+ self . addr. hash( state) ;
470
+ self . data32. hash( state) ;
471
+ self . data. hash( state) ;
472
+ }
473
+ }
474
+ }
475
+
476
+ impl PartialEq for poll_ctl_ext {
477
+ fn eq( & self , other: & poll_ctl_ext) -> bool {
478
+ #[ cfg( libc_union) ]
479
+ let union_eq = self . u == other. u;
480
+ #[ cfg( not( libc_union) ) ]
481
+ let union_eq = true ;
482
+ self . version == other. version
483
+ && self . command == other. command
484
+ && self . events == other. events
485
+ && self . fd == other. fd
486
+ && self . reversed64 == other. reversed64
487
+ && union_eq
488
+ }
489
+ }
490
+ impl Eq for poll_ctl_ext { }
491
+ impl :: fmt:: Debug for poll_ctl_ext {
492
+ fn fmt( & self , f: & mut :: fmt:: Formatter ) -> :: fmt:: Result {
493
+ let mut struct_formatter = f. debug_struct( "poll_ctl_ext" ) ;
494
+ struct_formatter. field( "version" , & self . version) ;
495
+ struct_formatter. field( "command" , & self . command) ;
496
+ struct_formatter. field( "events" , & self . events) ;
497
+ struct_formatter. field( "fd" , & self . fd) ;
498
+ #[ cfg( libc_union) ]
499
+ struct_formatter. field( "u" , & self . u) ;
500
+ struct_formatter. field( "reversed64" , & self . reversed64) ;
501
+ struct_formatter. finish( )
502
+ }
503
+ }
504
+ impl :: hash:: Hash for poll_ctl_ext {
505
+ fn hash<H : :: hash:: Hasher >( & self , state: & mut H ) {
506
+ self . version. hash( state) ;
507
+ self . command. hash( state) ;
508
+ self . events. hash( state) ;
509
+ self . fd. hash( state) ;
510
+ #[ cfg( libc_union) ]
511
+ self . u. hash( state) ;
512
+ self . reversed64. hash( state) ;
513
+ }
514
+ }
515
+ }
516
+ }
517
+
381
518
// dlfcn.h
382
519
pub const RTLD_LAZY : :: c_int = 0x4 ;
383
520
pub const RTLD_NOW : :: c_int = 0x2 ;
0 commit comments