@@ -15,10 +15,15 @@ pub type off_t = i64;
1515pub type pthread_t = :: c_ulong ;
1616pub type pthread_key_t = :: c_uint ;
1717pub type rlim_t = u32 ;
18- #[ cfg( not( target_os = "horizon" ) ) ]
19- pub type sa_family_t = u8 ;
20- #[ cfg( target_os = "horizon" ) ]
21- pub type sa_family_t = u16 ;
18+
19+ cfg_if ! {
20+ if #[ cfg( target_os = "horizon" ) ] {
21+ pub type sa_family_t = u16 ;
22+ } else {
23+ pub type sa_family_t = u8 ;
24+ }
25+ }
26+
2227pub type socklen_t = u32 ;
2328pub type speed_t = u32 ;
2429pub type suseconds_t = i32 ;
@@ -480,10 +485,13 @@ pub const SO_SNDLOWAT: ::c_int = 0x1003;
480485pub const SO_RCVLOWAT : :: c_int = 0x1004 ;
481486pub const SO_SNDTIMEO : :: c_int = 0x1005 ;
482487pub const SO_RCVTIMEO : :: c_int = 0x1006 ;
483- #[ cfg( not( target_os = "horizon" ) ) ]
484- pub const SO_ERROR : :: c_int = 0x1007 ;
485- #[ cfg( target_os = "horizon" ) ]
486- pub const SO_ERROR : :: c_int = 0x1009 ;
488+ cfg_if ! {
489+ if #[ cfg( target_os = "horizon" ) ] {
490+ pub const SO_ERROR : :: c_int = 0x1009 ;
491+ } else {
492+ pub const SO_ERROR : :: c_int = 0x1007 ;
493+ }
494+ }
487495pub const SO_TYPE : :: c_int = 0x1008 ;
488496
489497pub const SOCK_CLOEXEC : :: c_int = O_CLOEXEC ;
@@ -518,10 +526,13 @@ pub const TCP_KEEPIDLE: ::c_int = 256;
518526pub const TCP_KEEPINTVL : :: c_int = 512 ;
519527pub const TCP_KEEPCNT : :: c_int = 1024 ;
520528
521- #[ cfg( not( target_os = "horizon" ) ) ]
522- pub const IP_TOS : :: c_int = 3 ;
523- #[ cfg( target_os = "horizon" ) ]
524- pub const IP_TOS : :: c_int = 7 ;
529+ cfg_if ! {
530+ if #[ cfg( target_os = "horizon" ) ] {
531+ pub const IP_TOS : :: c_int = 7 ;
532+ } else {
533+ pub const IP_TOS : :: c_int = 3 ;
534+ }
535+ }
525536pub const IP_TTL : :: c_int = 8 ;
526537pub const IP_MULTICAST_IF : :: c_int = 9 ;
527538pub const IP_MULTICAST_TTL : :: c_int = 10 ;
0 commit comments