posix: sys: socket: move defines outside of extern C

preprocessor symbols do not need to be externed.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
This commit is contained in:
Chris Friedt 2024-03-30 10:18:09 -04:00 committed by Anas Nashif
parent 5591d2305e
commit f010f40c8c

View file

@ -9,6 +9,17 @@
#include <sys/types.h>
#include <zephyr/net/socket.h>
#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);