@@ -440,13 +440,6 @@ s_no_extra_traits! {
440
440
pub __reserved: [ c_char; 256 ] ,
441
441
}
442
442
443
- // FIXME(musl): musl added paddings and adjusted
444
- // layout in 1.2.0 but our CI is still 1.1.24.
445
- // So, I'm leaving some fields as cfg for now.
446
- // ref. https://github.com/bminor/musl/commit/
447
- // 1e7f0fcd7ff2096904fd93a2ee6d12a2392be392
448
- //
449
- // OpenHarmony uses the musl 1.2 layout.
450
443
pub struct utmpx {
451
444
pub ut_type: c_short,
452
445
__ut_pad1: c_short,
@@ -457,31 +450,24 @@ s_no_extra_traits! {
457
450
pub ut_host: [ c_char; 256 ] ,
458
451
pub ut_exit: __exit_status,
459
452
460
- #[ cfg( target_env = "musl" ) ]
461
- #[ cfg( not( target_arch = "loongarch64" ) ) ]
453
+ #[ cfg( not( musl_v1_2_3) ) ]
454
+ #[ deprecated(
455
+ since = "0.2.173" ,
456
+ note = "The ABI of this field has changed from c_long to c_int with padding, \
457
+ we'll follow that change in the future release. See #4443 for more info."
458
+ ) ]
462
459
pub ut_session: c_long,
463
460
464
- #[ cfg( target_env = "musl" ) ]
465
- #[ cfg( target_arch = "loongarch64" ) ]
466
- pub ut_session: c_int,
467
-
468
- #[ cfg( target_env = "musl" ) ]
469
- #[ cfg( target_arch = "loongarch64" ) ]
461
+ #[ cfg( musl_v1_2_3) ]
462
+ #[ cfg( not( target_endian = "little" ) ) ]
470
463
__ut_pad2: c_int,
471
464
472
- #[ cfg( target_env = "ohos" ) ]
473
- #[ cfg( target_endian = "little" ) ]
465
+ #[ cfg( musl_v1_2_3) ]
474
466
pub ut_session: c_int,
475
- #[ cfg( target_env = "ohos" ) ]
476
- #[ cfg( target_endian = "little" ) ]
477
- __ut_pad2: c_int,
478
467
479
- #[ cfg( target_env = "ohos" ) ]
480
- #[ cfg( not ( target_endian = "little" ) ) ]
468
+ #[ cfg( musl_v1_2_3 ) ]
469
+ #[ cfg( target_endian = "little" ) ]
481
470
__ut_pad2: c_int,
482
- #[ cfg( target_env = "ohos" ) ]
483
- #[ cfg( not( target_endian = "little" ) ) ]
484
- pub ut_session: c_int,
485
471
486
472
pub ut_tv: crate :: timeval,
487
473
pub ut_addr_v6: [ c_uint; 4 ] ,
@@ -557,6 +543,7 @@ cfg_if! {
557
543
}
558
544
559
545
impl PartialEq for utmpx {
546
+ #![ allow( deprecated) ]
560
547
fn eq( & self , other: & utmpx) -> bool {
561
548
self . ut_type == other. ut_type
562
549
//&& self.__ut_pad1 == other.__ut_pad1
@@ -581,6 +568,7 @@ cfg_if! {
581
568
impl Eq for utmpx { }
582
569
583
570
impl fmt:: Debug for utmpx {
571
+ #![ allow( deprecated) ]
584
572
fn fmt( & self , f: & mut fmt:: Formatter ) -> fmt:: Result {
585
573
f. debug_struct( "utmpx" )
586
574
. field( "ut_type" , & self . ut_type)
@@ -601,6 +589,7 @@ cfg_if! {
601
589
}
602
590
603
591
impl hash:: Hash for utmpx {
592
+ #![ allow( deprecated) ]
604
593
fn hash<H : hash:: Hasher >( & self , state: & mut H ) {
605
594
self . ut_type. hash( state) ;
606
595
//self.__ut_pad1.hash(state);
0 commit comments