From f010f40c8cc7cc407590d831334eae0fdb917e40 Mon Sep 17 00:00:00 2001 From: Chris Friedt Date: Sat, 30 Mar 2024 10:18:09 -0400 Subject: [PATCH] posix: sys: socket: move defines outside of extern C preprocessor symbols do not need to be externed. Signed-off-by: Chris Friedt --- include/zephyr/posix/sys/socket.h | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/include/zephyr/posix/sys/socket.h b/include/zephyr/posix/sys/socket.h index ea3a177d88a..9ce76006f09 100644 --- a/include/zephyr/posix/sys/socket.h +++ b/include/zephyr/posix/sys/socket.h @@ -9,6 +9,17 @@ #include #include +#ifndef CONFIG_NET_SOCKETS_POSIX_NAMES + +#define SHUT_RD ZSOCK_SHUT_RD +#define SHUT_WR ZSOCK_SHUT_WR +#define SHUT_RDWR ZSOCK_SHUT_RDWR + +#define MSG_PEEK ZSOCK_MSG_PEEK +#define MSG_TRUNC ZSOCK_MSG_TRUNC +#define MSG_DONTWAIT ZSOCK_MSG_DONTWAIT +#define MSG_WAITALL ZSOCK_MSG_WAITALL + #ifdef __cplusplus extern "C" { #endif @@ -18,8 +29,6 @@ struct linger { int l_linger; }; -#ifndef CONFIG_NET_SOCKETS_POSIX_NAMES - static inline int socket(int family, int type, int proto) { return zsock_socket(family, type, proto); @@ -30,15 +39,6 @@ static inline int socketpair(int family, int type, int proto, int sv[2]) return zsock_socketpair(family, type, proto, sv); } -#define SHUT_RD ZSOCK_SHUT_RD -#define SHUT_WR ZSOCK_SHUT_WR -#define SHUT_RDWR ZSOCK_SHUT_RDWR - -#define MSG_PEEK ZSOCK_MSG_PEEK -#define MSG_TRUNC ZSOCK_MSG_TRUNC -#define MSG_DONTWAIT ZSOCK_MSG_DONTWAIT -#define MSG_WAITALL ZSOCK_MSG_WAITALL - static inline int shutdown(int sock, int how) { return zsock_shutdown(sock, how);