@@ -60,9 +60,9 @@ pub(crate) use libc::c_int;
60
60
// Used in `Domain`.
61
61
pub ( crate ) use libc:: { AF_INET , AF_INET6 } ;
62
62
// 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" ) ) ) ) ]
64
64
pub ( crate ) use libc:: SOCK_RAW ;
65
- #[ cfg( feature = "all" ) ]
65
+ #[ cfg( all ( feature = "all" , not ( target_os = "espidf" ) ) ) ]
66
66
pub ( crate ) use libc:: SOCK_SEQPACKET ;
67
67
pub ( crate ) use libc:: { SOCK_DGRAM , SOCK_STREAM } ;
68
68
// Used in `Protocol`.
@@ -72,8 +72,10 @@ pub(crate) use libc::{
72
72
sa_family_t, sockaddr, sockaddr_in, sockaddr_in6, sockaddr_storage, socklen_t,
73
73
} ;
74
74
// Used in `RecvFlags`.
75
+ #[ cfg( not( any( target_os = "redox" , target_os = "espidf" ) ) ) ]
76
+ pub ( crate ) use libc:: MSG_TRUNC ;
75
77
#[ cfg( not( target_os = "redox" ) ) ]
76
- pub ( crate ) use libc:: { MSG_TRUNC , SO_OOBINLINE } ;
78
+ pub ( crate ) use libc:: SO_OOBINLINE ;
77
79
// Used in `Socket`.
78
80
#[ cfg( not( target_os = "nto" ) ) ]
79
81
pub ( crate ) use libc:: ipv6_mreq as Ipv6Mreq ;
@@ -89,6 +91,7 @@ pub(crate) use libc::IP_HDRINCL;
89
91
target_os = "solaris" ,
90
92
target_os = "haiku" ,
91
93
target_os = "nto" ,
94
+ target_os = "espidf" ,
92
95
) ) ) ]
93
96
pub ( crate ) use libc:: IP_RECVTOS ;
94
97
#[ cfg( not( any(
@@ -117,6 +120,7 @@ pub(crate) use libc::{
117
120
target_os = "redox" ,
118
121
target_os = "fuchsia" ,
119
122
target_os = "nto" ,
123
+ target_os = "espidf" ,
120
124
) ) ) ]
121
125
pub ( crate ) use libc:: {
122
126
ip_mreq_source as IpMreqSource , IP_ADD_SOURCE_MEMBERSHIP , IP_DROP_SOURCE_MEMBERSHIP ,
@@ -232,6 +236,7 @@ type IovLen = usize;
232
236
target_os = "solaris" ,
233
237
target_os = "nto" ,
234
238
target_vendor = "apple" ,
239
+ target_os = "espidf" ,
235
240
) ) ]
236
241
type IovLen = c_int ;
237
242
@@ -370,10 +375,11 @@ impl_debug!(
370
375
Type ,
371
376
libc:: SOCK_STREAM ,
372
377
libc:: SOCK_DGRAM ,
373
- #[ cfg( not( target_os = "redox" ) ) ]
378
+ #[ cfg( not( any ( target_os = "redox" , target_os = "espidf" ) ) ) ]
374
379
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" ) ) ) ]
376
381
libc:: SOCK_RDM ,
382
+ #[ cfg( not( target_os = "espidf" ) ) ]
377
383
libc:: SOCK_SEQPACKET ,
378
384
/* TODO: add these optional bit OR-ed flags:
379
385
#[cfg(any(
@@ -417,6 +423,7 @@ impl RecvFlags {
417
423
/// a record is terminated by sending a message with the end-of-record flag set.
418
424
///
419
425
/// On Unix this corresponds to the MSG_EOR flag.
426
+ #[ cfg( not( target_os = "espidf" ) ) ]
420
427
pub const fn is_end_of_record ( self ) -> bool {
421
428
self . 0 & libc:: MSG_EOR != 0
422
429
}
@@ -435,11 +442,13 @@ impl RecvFlags {
435
442
#[ cfg( not( target_os = "redox" ) ) ]
436
443
impl std:: fmt:: Debug for RecvFlags {
437
444
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 ( )
443
452
}
444
453
}
445
454
@@ -1056,6 +1065,7 @@ pub(crate) fn from_in6_addr(addr: in6_addr) -> Ipv6Addr {
1056
1065
target_os = "redox" ,
1057
1066
target_os = "solaris" ,
1058
1067
target_os = "nto" ,
1068
+ target_os = "espidf" ,
1059
1069
) ) ) ]
1060
1070
pub ( crate ) fn to_mreqn (
1061
1071
multiaddr : & Ipv4Addr ,
0 commit comments