Skip to content

Commit fe6531e

Browse files
committed
Auto merge of #2396 - ivmarkov:master, r=JohnTitor
Support for the ESP-IDF framework - 3 forgotten mappings When implementing [the initial support for ESP-IDF](#2310) a month ago, I managed to forget to properly decorate these 3 libc bindings for the ESP-IDF. So now we are in the uncomfortable situation that using STD's `TcpListener::bind` results in a linkage error. This PR is fixing this, as well as properly exposing two additional ESP-IDF APIs, implemented via LwIP.
2 parents 8c5efbf + 7e83ba0 commit fe6531e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/unix/newlib/mod.rs

+3
Original file line numberDiff line numberDiff line change
@@ -611,17 +611,20 @@ extern "C" {
611611
target_arch = "powerpc",
612612
target_vendor = "nintendo"
613613
)))]
614+
#[cfg_attr(target_os = "espidf", link_name = "lwip_bind")]
614615
pub fn bind(fd: ::c_int, addr: *const sockaddr, len: socklen_t) -> ::c_int;
615616
pub fn clock_settime(clock_id: ::clockid_t, tp: *const ::timespec) -> ::c_int;
616617
pub fn clock_gettime(clock_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
617618
pub fn clock_getres(clock_id: ::clockid_t, res: *mut ::timespec) -> ::c_int;
619+
#[cfg_attr(target_os = "espidf", link_name = "lwip_close")]
618620
pub fn closesocket(sockfd: ::c_int) -> ::c_int;
619621
pub fn ioctl(fd: ::c_int, request: ::c_ulong, ...) -> ::c_int;
620622
#[cfg(not(all(
621623
libc_cfg_target_vendor,
622624
target_arch = "powerpc",
623625
target_vendor = "nintendo"
624626
)))]
627+
#[cfg_attr(target_os = "espidf", link_name = "lwip_recvfrom")]
625628
pub fn recvfrom(
626629
fd: ::c_int,
627630
buf: *mut ::c_void,

0 commit comments

Comments
 (0)