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