@@ -440,13 +440,6 @@ s_no_extra_traits! {
440440 pub __reserved: [ c_char; 256 ] ,
441441 }
442442
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.
450443 pub struct utmpx {
451444 pub ut_type: c_short,
452445 __ut_pad1: c_short,
@@ -457,31 +450,24 @@ s_no_extra_traits! {
457450 pub ut_host: [ c_char; 256 ] ,
458451 pub ut_exit: __exit_status,
459452
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+ ) ]
462459 pub ut_session: c_long,
463460
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" ) ) ]
470463 __ut_pad2: c_int,
471464
472- #[ cfg( target_env = "ohos" ) ]
473- #[ cfg( target_endian = "little" ) ]
465+ #[ cfg( musl_v1_2_3) ]
474466 pub ut_session: c_int,
475- #[ cfg( target_env = "ohos" ) ]
476- #[ cfg( target_endian = "little" ) ]
477- __ut_pad2: c_int,
478467
479- #[ cfg( target_env = "ohos" ) ]
480- #[ cfg( not ( target_endian = "little" ) ) ]
468+ #[ cfg( musl_v1_2_3 ) ]
469+ #[ cfg( target_endian = "little" ) ]
481470 __ut_pad2: c_int,
482- #[ cfg( target_env = "ohos" ) ]
483- #[ cfg( not( target_endian = "little" ) ) ]
484- pub ut_session: c_int,
485471
486472 pub ut_tv: crate :: timeval,
487473 pub ut_addr_v6: [ c_uint; 4 ] ,
@@ -557,6 +543,7 @@ cfg_if! {
557543 }
558544
559545 impl PartialEq for utmpx {
546+ #![ allow( deprecated) ]
560547 fn eq( & self , other: & utmpx) -> bool {
561548 self . ut_type == other. ut_type
562549 //&& self.__ut_pad1 == other.__ut_pad1
@@ -581,6 +568,7 @@ cfg_if! {
581568 impl Eq for utmpx { }
582569
583570 impl fmt:: Debug for utmpx {
571+ #![ allow( deprecated) ]
584572 fn fmt( & self , f: & mut fmt:: Formatter ) -> fmt:: Result {
585573 f. debug_struct( "utmpx" )
586574 . field( "ut_type" , & self . ut_type)
@@ -601,6 +589,7 @@ cfg_if! {
601589 }
602590
603591 impl hash:: Hash for utmpx {
592+ #![ allow( deprecated) ]
604593 fn hash<H : hash:: Hasher >( & self , state: & mut H ) {
605594 self . ut_type. hash( state) ;
606595 //self.__ut_pad1.hash(state);
0 commit comments