@@ -60,9 +60,9 @@ pub(crate) use libc::c_int;
6060// Used in `Domain`.
6161pub ( crate ) use libc:: { AF_INET , AF_INET6 } ;
6262// Used in `Type`.
63- #[ cfg( all( feature = "all" , not( target_os = "redox" ) ) ) ]
63+ #[ cfg( all( feature = "all" , not( any ( target_os = "redox" , target_os = "espidf" ) ) ) ) ]
6464pub ( crate ) use libc:: SOCK_RAW ;
65- #[ cfg( feature = "all" ) ]
65+ #[ cfg( all ( feature = "all" , not ( target_os = "espidf" ) ) ) ]
6666pub ( crate ) use libc:: SOCK_SEQPACKET ;
6767pub ( crate ) use libc:: { SOCK_DGRAM , SOCK_STREAM } ;
6868// Used in `Protocol`.
@@ -72,8 +72,10 @@ pub(crate) use libc::{
7272 sa_family_t, sockaddr, sockaddr_in, sockaddr_in6, sockaddr_storage, socklen_t,
7373} ;
7474// Used in `RecvFlags`.
75+ #[ cfg( not( any( target_os = "redox" , target_os = "espidf" ) ) ) ]
76+ pub ( crate ) use libc:: MSG_TRUNC ;
7577#[ cfg( not( target_os = "redox" ) ) ]
76- pub ( crate ) use libc:: { MSG_TRUNC , SO_OOBINLINE } ;
78+ pub ( crate ) use libc:: SO_OOBINLINE ;
7779// Used in `Socket`.
7880#[ cfg( not( target_os = "nto" ) ) ]
7981pub ( crate ) use libc:: ipv6_mreq as Ipv6Mreq ;
@@ -89,6 +91,7 @@ pub(crate) use libc::IP_HDRINCL;
8991 target_os = "solaris" ,
9092 target_os = "haiku" ,
9193 target_os = "nto" ,
94+ target_os = "espidf" ,
9295) ) ) ]
9396pub ( crate ) use libc:: IP_RECVTOS ;
9497#[ cfg( not( any(
@@ -117,6 +120,7 @@ pub(crate) use libc::{
117120 target_os = "redox" ,
118121 target_os = "fuchsia" ,
119122 target_os = "nto" ,
123+ target_os = "espidf" ,
120124) ) ) ]
121125pub ( crate ) use libc:: {
122126 ip_mreq_source as IpMreqSource , IP_ADD_SOURCE_MEMBERSHIP , IP_DROP_SOURCE_MEMBERSHIP ,
@@ -232,6 +236,7 @@ type IovLen = usize;
232236 target_os = "solaris" ,
233237 target_os = "nto" ,
234238 target_vendor = "apple" ,
239+ target_os = "espidf" ,
235240) ) ]
236241type IovLen = c_int ;
237242
@@ -370,10 +375,11 @@ impl_debug!(
370375 Type ,
371376 libc:: SOCK_STREAM ,
372377 libc:: SOCK_DGRAM ,
373- #[ cfg( not( target_os = "redox" ) ) ]
378+ #[ cfg( not( any ( target_os = "redox" , target_os = "espidf" ) ) ) ]
374379 libc:: SOCK_RAW ,
375- #[ cfg( not( any( target_os = "redox" , target_os = "haiku" ) ) ) ]
380+ #[ cfg( not( any( target_os = "redox" , target_os = "haiku" , target_os = "espidf" ) ) ) ]
376381 libc:: SOCK_RDM ,
382+ #[ cfg( not( target_os = "espidf" ) ) ]
377383 libc:: SOCK_SEQPACKET ,
378384 /* TODO: add these optional bit OR-ed flags:
379385 #[cfg(any(
@@ -417,6 +423,7 @@ impl RecvFlags {
417423 /// a record is terminated by sending a message with the end-of-record flag set.
418424 ///
419425 /// On Unix this corresponds to the MSG_EOR flag.
426+ #[ cfg( not( target_os = "espidf" ) ) ]
420427 pub const fn is_end_of_record ( self ) -> bool {
421428 self . 0 & libc:: MSG_EOR != 0
422429 }
@@ -435,11 +442,13 @@ impl RecvFlags {
435442#[ cfg( not( target_os = "redox" ) ) ]
436443impl std:: fmt:: Debug for RecvFlags {
437444 fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
438- f. debug_struct ( "RecvFlags" )
439- . field ( "is_end_of_record" , & self . is_end_of_record ( ) )
440- . field ( "is_out_of_band" , & self . is_out_of_band ( ) )
441- . field ( "is_truncated" , & self . is_truncated ( ) )
442- . finish ( )
445+ let mut s = f. debug_struct ( "RecvFlags" ) ;
446+ #[ cfg( not( target_os = "espidf" ) ) ]
447+ s. field ( "is_end_of_record" , & self . is_end_of_record ( ) ) ;
448+ s. field ( "is_out_of_band" , & self . is_out_of_band ( ) ) ;
449+ #[ cfg( not( target_os = "espidf" ) ) ]
450+ s. field ( "is_truncated" , & self . is_truncated ( ) ) ;
451+ s. finish ( )
443452 }
444453}
445454
@@ -1056,6 +1065,7 @@ pub(crate) fn from_in6_addr(addr: in6_addr) -> Ipv6Addr {
10561065 target_os = "redox" ,
10571066 target_os = "solaris" ,
10581067 target_os = "nto" ,
1068+ target_os = "espidf" ,
10591069) ) ) ]
10601070pub ( crate ) fn to_mreqn (
10611071 multiaddr : & Ipv4Addr ,
0 commit comments