Skip to content

Commit bc392ea

Browse files
committed
Remove unneeded remaps
1 parent 7739266 commit bc392ea

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

wolfssl/wolfcrypt/settings.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2668,12 +2668,13 @@ extern void uITRON4_free(void *p) ;
26682668
#define setsockopt zsock_setsockopt
26692669
#define getsockopt zsock_getsockopt
26702670
#define shutdown zsock_shutdown
2671-
#define close zsock_close
2672-
#define poll zsock_poll
26732671
#define getpeername zsock_getpeername
26742672
#define getsockname zsock_getsockname
2675-
#define inet_pton zsock_inet_pton
2676-
#define inet_ntop zsock_inet_ntop
2673+
/* Note: close, poll, inet_pton, inet_ntop are NOT remapped here.
2674+
* They are general POSIX functions still declared in Zephyr's POSIX
2675+
* headers; redefining them conflicts with __syscall declarations in
2676+
* <zephyr/net/socket.h>. close is handled via CloseSocket in wolfio.h,
2677+
* inet_pton/inet_ntop via XINET_PTON/XINET_NTOP in wolfio.h. */
26772678
#else
26782679
/* Zephyr < 4.1: define CONFIG_NET_SOCKETS_POSIX_NAMES so that
26792680
* <net/socket.h> provides the POSIX name remapping macros. */

wolfssl/wolfio.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -639,6 +639,11 @@ WOLFSSL_API int wolfIO_RecvFrom(SOCKET_T sd, WOLFSSL_BIO_ADDR *addr, char *buf,
639639
#define CloseSocket(s) closesocket(s)
640640
#endif
641641
#define StartTCP() WC_DO_NOTHING
642+
#elif defined(WOLFSSL_ZEPHYR) && KERNEL_VERSION_NUMBER >= 0x40100
643+
#ifndef CloseSocket
644+
#define CloseSocket(s) zsock_close(s)
645+
#endif
646+
#define StartTCP() WC_DO_NOTHING
642647
#else
643648
#ifndef CloseSocket
644649
#define CloseSocket(s) close(s)

0 commit comments

Comments
 (0)