From b0afb8fe0ff1d87165af9df61501197a06240dda Mon Sep 17 00:00:00 2001 From: Lorenz Kästle <12514511+RincewindsHat@users.noreply.github.com> Date: Sun, 28 Dec 2025 12:13:40 +0100 Subject: Sync with Gnulib stable-202507 code (a8ac9f9ce5) --- gl/sys_socket.in.h | 127 +++++++++++++++++++++++++++++++++-------------------- 1 file changed, 79 insertions(+), 48 deletions(-) (limited to 'gl/sys_socket.in.h') diff --git a/gl/sys_socket.in.h b/gl/sys_socket.in.h index 13833c0f..8632c66d 100644 --- a/gl/sys_socket.in.h +++ b/gl/sys_socket.in.h @@ -1,6 +1,6 @@ /* Provide a sys/socket header file for systems lacking it (read: MinGW) and for systems where it is incomplete. - Copyright (C) 2005-2024 Free Software Foundation, Inc. + Copyright (C) 2005-2025 Free Software Foundation, Inc. Written by Simon Josefsson. This file is free software: you can redistribute it and/or modify @@ -27,7 +27,7 @@ #endif @PRAGMA_COLUMNS@ -#if defined _GL_ALREADY_INCLUDING_SYS_SOCKET_H +#if defined _@GUARD_PREFIX@_ALREADY_INCLUDING_SYS_SOCKET_H /* Special invocation convention: - On Cygwin 1.5.x we have a sequence of nested includes -> -> -> , @@ -43,7 +43,7 @@ #if @HAVE_SYS_SOCKET_H@ -# define _GL_ALREADY_INCLUDING_SYS_SOCKET_H +# define _@GUARD_PREFIX@_ALREADY_INCLUDING_SYS_SOCKET_H /* On many platforms, assumes prior inclusion of . */ @@ -56,7 +56,7 @@ /* The include_next requires a split double-inclusion guard. */ # @INCLUDE_NEXT@ @NEXT_SYS_SOCKET_H@ -# undef _GL_ALREADY_INCLUDING_SYS_SOCKET_H +# undef _@GUARD_PREFIX@_ALREADY_INCLUDING_SYS_SOCKET_H #endif @@ -202,6 +202,7 @@ struct sockaddr_storage /* Rudimentary 'struct msghdr'; this works as long as you don't try to access msg_control or msg_controllen. */ +# if !defined GNULIB_defined_struct_msghdr struct msghdr { void *msg_name; socklen_t msg_namelen; @@ -209,6 +210,8 @@ struct msghdr { int msg_iovlen; int msg_flags; }; +# define GNULIB_defined_struct_msghdr 1 +# endif #endif @@ -289,15 +292,17 @@ rpl_fd_isset (SOCKET fd, fd_set * set) # undef socket # define socket rpl_socket # endif -_GL_FUNCDECL_RPL (socket, int, (int domain, int type, int protocol)); +_GL_FUNCDECL_RPL (socket, int, (int domain, int type, int protocol), ); _GL_CXXALIAS_RPL (socket, int, (int domain, int type, int protocol)); # else _GL_CXXALIAS_SYS (socket, int, (int domain, int type, int protocol)); # endif _GL_CXXALIASWARN (socket); #elif @HAVE_WINSOCK2_H@ -# undef socket -# define socket socket_used_without_requesting_gnulib_module_socket +# if !GNULIB_SOCKET +# undef socket +# define socket socket_used_without_requesting_gnulib_module_socket +# endif #elif defined GNULIB_POSIXCHECK # undef socket # if HAVE_RAW_DECL_SOCKET @@ -313,7 +318,7 @@ _GL_WARN_ON_USE (socket, "socket is not always POSIX compliant - " # define connect rpl_connect # endif _GL_FUNCDECL_RPL (connect, int, - (int fd, const struct sockaddr *addr, socklen_t addrlen) + (int fd, const struct sockaddr *addr, socklen_t addrlen), _GL_ARG_NONNULL ((2))); _GL_CXXALIAS_RPL (connect, int, (int fd, const struct sockaddr *addr, socklen_t addrlen)); @@ -326,8 +331,10 @@ _GL_CXXALIAS_SYS_CAST (connect, int, # endif _GL_CXXALIASWARN (connect); #elif @HAVE_WINSOCK2_H@ -# undef connect -# define connect socket_used_without_requesting_gnulib_module_connect +# if !GNULIB_CONNECT +# undef connect +# define connect connect_used_without_requesting_gnulib_module_connect +# endif #elif defined GNULIB_POSIXCHECK # undef connect # if HAVE_RAW_DECL_CONNECT @@ -345,7 +352,7 @@ _GL_WARN_ON_USE (connect, "connect is not always POSIX compliant - " _GL_FUNCDECL_RPL (accept, int, (int fd, struct sockaddr *restrict addr, - socklen_t *restrict addrlen)); + socklen_t *restrict addrlen), ); _GL_CXXALIAS_RPL (accept, int, (int fd, struct sockaddr *restrict addr, @@ -362,8 +369,10 @@ _GL_CXXALIAS_SYS_CAST (accept, int, _GL_CXXALIASWARN (accept); # endif #elif @HAVE_WINSOCK2_H@ -# undef accept -# define accept accept_used_without_requesting_gnulib_module_accept +# if !GNULIB_ACCEPT +# undef accept +# define accept accept_used_without_requesting_gnulib_module_accept +# endif #elif defined GNULIB_POSIXCHECK # undef accept # if HAVE_RAW_DECL_ACCEPT @@ -379,7 +388,7 @@ _GL_WARN_ON_USE (accept, "accept is not always POSIX compliant - " # define bind rpl_bind # endif _GL_FUNCDECL_RPL (bind, int, - (int fd, const struct sockaddr *addr, socklen_t addrlen) + (int fd, const struct sockaddr *addr, socklen_t addrlen), _GL_ARG_NONNULL ((2))); _GL_CXXALIAS_RPL (bind, int, (int fd, const struct sockaddr *addr, socklen_t addrlen)); @@ -392,8 +401,10 @@ _GL_CXXALIAS_SYS_CAST (bind, int, # endif _GL_CXXALIASWARN (bind); #elif @HAVE_WINSOCK2_H@ -# undef bind -# define bind bind_used_without_requesting_gnulib_module_bind +# if !GNULIB_BIND +# undef bind +# define bind bind_used_without_requesting_gnulib_module_bind +# endif #elif defined GNULIB_POSIXCHECK # undef bind # if HAVE_RAW_DECL_BIND @@ -410,7 +421,7 @@ _GL_WARN_ON_USE (bind, "bind is not always POSIX compliant - " # endif _GL_FUNCDECL_RPL (getpeername, int, (int fd, struct sockaddr *restrict addr, - socklen_t *restrict addrlen) + socklen_t *restrict addrlen), _GL_ARG_NONNULL ((2, 3))); _GL_CXXALIAS_RPL (getpeername, int, (int fd, struct sockaddr *restrict addr, @@ -426,8 +437,10 @@ _GL_CXXALIAS_SYS_CAST (getpeername, int, _GL_CXXALIASWARN (getpeername); # endif #elif @HAVE_WINSOCK2_H@ -# undef getpeername -# define getpeername getpeername_used_without_requesting_gnulib_module_getpeername +# if !GNULIB_GETPEERNAME +# undef getpeername +# define getpeername getpeername_used_without_requesting_gnulib_module_getpeername +# endif #elif defined GNULIB_POSIXCHECK # undef getpeername # if HAVE_RAW_DECL_GETPEERNAME @@ -444,7 +457,7 @@ _GL_WARN_ON_USE (getpeername, "getpeername is not always POSIX compliant - " # endif _GL_FUNCDECL_RPL (getsockname, int, (int fd, struct sockaddr *restrict addr, - socklen_t *restrict addrlen) + socklen_t *restrict addrlen), _GL_ARG_NONNULL ((2, 3))); _GL_CXXALIAS_RPL (getsockname, int, (int fd, struct sockaddr *restrict addr, @@ -460,8 +473,10 @@ _GL_CXXALIAS_SYS_CAST (getsockname, int, _GL_CXXALIASWARN (getsockname); # endif #elif @HAVE_WINSOCK2_H@ -# undef getsockname -# define getsockname getsockname_used_without_requesting_gnulib_module_getsockname +# if !GNULIB_GETSOCKNAME +# undef getsockname +# define getsockname getsockname_used_without_requesting_gnulib_module_getsockname +# endif #elif defined GNULIB_POSIXCHECK # undef getsockname # if HAVE_RAW_DECL_GETSOCKNAME @@ -478,7 +493,7 @@ _GL_WARN_ON_USE (getsockname, "getsockname is not always POSIX compliant - " # endif _GL_FUNCDECL_RPL (getsockopt, int, (int fd, int level, int optname, - void *restrict optval, socklen_t *restrict optlen) + void *restrict optval, socklen_t *restrict optlen), _GL_ARG_NONNULL ((4, 5))); _GL_CXXALIAS_RPL (getsockopt, int, (int fd, int level, int optname, @@ -492,8 +507,10 @@ _GL_CXXALIAS_SYS_CAST (getsockopt, int, # endif _GL_CXXALIASWARN (getsockopt); #elif @HAVE_WINSOCK2_H@ -# undef getsockopt -# define getsockopt getsockopt_used_without_requesting_gnulib_module_getsockopt +# if !GNULIB_GETSOCKOPT +# undef getsockopt +# define getsockopt getsockopt_used_without_requesting_gnulib_module_getsockopt +# endif #elif defined GNULIB_POSIXCHECK # undef getsockopt # if HAVE_RAW_DECL_GETSOCKOPT @@ -508,15 +525,17 @@ _GL_WARN_ON_USE (getsockopt, "getsockopt is not always POSIX compliant - " # undef listen # define listen rpl_listen # endif -_GL_FUNCDECL_RPL (listen, int, (int fd, int backlog)); +_GL_FUNCDECL_RPL (listen, int, (int fd, int backlog), ); _GL_CXXALIAS_RPL (listen, int, (int fd, int backlog)); # else _GL_CXXALIAS_SYS (listen, int, (int fd, int backlog)); # endif _GL_CXXALIASWARN (listen); #elif @HAVE_WINSOCK2_H@ -# undef listen -# define listen listen_used_without_requesting_gnulib_module_listen +# if !GNULIB_LISTEN +# undef listen +# define listen listen_used_without_requesting_gnulib_module_listen +# endif #elif defined GNULIB_POSIXCHECK # undef listen # if HAVE_RAW_DECL_LISTEN @@ -531,7 +550,7 @@ _GL_WARN_ON_USE (listen, "listen is not always POSIX compliant - " # undef recv # define recv rpl_recv # endif -_GL_FUNCDECL_RPL (recv, ssize_t, (int fd, void *buf, size_t len, int flags) +_GL_FUNCDECL_RPL (recv, ssize_t, (int fd, void *buf, size_t len, int flags), _GL_ARG_NONNULL ((2))); _GL_CXXALIAS_RPL (recv, ssize_t, (int fd, void *buf, size_t len, int flags)); # else @@ -542,8 +561,10 @@ _GL_CXXALIAS_SYS_CAST (recv, ssize_t, (int fd, void *buf, size_t len, int flags) # endif _GL_CXXALIASWARN (recv); #elif @HAVE_WINSOCK2_H@ -# undef recv -# define recv recv_used_without_requesting_gnulib_module_recv +# if !GNULIB_RECV +# undef recv +# define recv recv_used_without_requesting_gnulib_module_recv +# endif #elif defined GNULIB_POSIXCHECK # undef recv # if HAVE_RAW_DECL_RECV @@ -559,7 +580,7 @@ _GL_WARN_ON_USE (recv, "recv is not always POSIX compliant - " # define send rpl_send # endif _GL_FUNCDECL_RPL (send, ssize_t, - (int fd, const void *buf, size_t len, int flags) + (int fd, const void *buf, size_t len, int flags), _GL_ARG_NONNULL ((2))); _GL_CXXALIAS_RPL (send, ssize_t, (int fd, const void *buf, size_t len, int flags)); @@ -572,8 +593,10 @@ _GL_CXXALIAS_SYS_CAST (send, ssize_t, # endif _GL_CXXALIASWARN (send); #elif @HAVE_WINSOCK2_H@ -# undef send -# define send send_used_without_requesting_gnulib_module_send +# if !GNULIB_SEND +# undef send +# define send send_used_without_requesting_gnulib_module_send +# endif #elif defined GNULIB_POSIXCHECK # undef send # if HAVE_RAW_DECL_SEND @@ -591,7 +614,7 @@ _GL_WARN_ON_USE (send, "send is not always POSIX compliant - " _GL_FUNCDECL_RPL (recvfrom, ssize_t, (int fd, void *restrict buf, size_t len, int flags, struct sockaddr *restrict from, - socklen_t *restrict fromlen) + socklen_t *restrict fromlen), _GL_ARG_NONNULL ((2))); _GL_CXXALIAS_RPL (recvfrom, ssize_t, (int fd, void *restrict buf, size_t len, int flags, @@ -609,8 +632,10 @@ _GL_CXXALIAS_SYS_CAST (recvfrom, ssize_t, _GL_CXXALIASWARN (recvfrom); # endif #elif @HAVE_WINSOCK2_H@ -# undef recvfrom -# define recvfrom recvfrom_used_without_requesting_gnulib_module_recvfrom +# if !GNULIB_RECVFROM +# undef recvfrom +# define recvfrom recvfrom_used_without_requesting_gnulib_module_recvfrom +# endif #elif defined GNULIB_POSIXCHECK # undef recvfrom # if HAVE_RAW_DECL_RECVFROM @@ -627,7 +652,7 @@ _GL_WARN_ON_USE (recvfrom, "recvfrom is not always POSIX compliant - " # endif _GL_FUNCDECL_RPL (sendto, ssize_t, (int fd, const void *buf, size_t len, int flags, - const struct sockaddr *to, socklen_t tolen) + const struct sockaddr *to, socklen_t tolen), _GL_ARG_NONNULL ((2))); _GL_CXXALIAS_RPL (sendto, ssize_t, (int fd, const void *buf, size_t len, int flags, @@ -641,8 +666,10 @@ _GL_CXXALIAS_SYS_CAST (sendto, ssize_t, # endif _GL_CXXALIASWARN (sendto); #elif @HAVE_WINSOCK2_H@ -# undef sendto -# define sendto sendto_used_without_requesting_gnulib_module_sendto +# if !GNULIB_SENDTO +# undef sendto +# define sendto sendto_used_without_requesting_gnulib_module_sendto +# endif #elif defined GNULIB_POSIXCHECK # undef sendto # if HAVE_RAW_DECL_SENDTO @@ -658,7 +685,7 @@ _GL_WARN_ON_USE (sendto, "sendto is not always POSIX compliant - " # define setsockopt rpl_setsockopt # endif _GL_FUNCDECL_RPL (setsockopt, int, (int fd, int level, int optname, - const void * optval, socklen_t optlen) + const void * optval, socklen_t optlen), _GL_ARG_NONNULL ((4))); _GL_CXXALIAS_RPL (setsockopt, int, (int fd, int level, int optname, const void * optval, socklen_t optlen)); @@ -671,8 +698,10 @@ _GL_CXXALIAS_SYS_CAST (setsockopt, int, # endif _GL_CXXALIASWARN (setsockopt); #elif @HAVE_WINSOCK2_H@ -# undef setsockopt -# define setsockopt setsockopt_used_without_requesting_gnulib_module_setsockopt +# if !GNULIB_SETSOCKOPT +# undef setsockopt +# define setsockopt setsockopt_used_without_requesting_gnulib_module_setsockopt +# endif #elif defined GNULIB_POSIXCHECK # undef setsockopt # if HAVE_RAW_DECL_SETSOCKOPT @@ -687,15 +716,17 @@ _GL_WARN_ON_USE (setsockopt, "setsockopt is not always POSIX compliant - " # undef shutdown # define shutdown rpl_shutdown # endif -_GL_FUNCDECL_RPL (shutdown, int, (int fd, int how)); +_GL_FUNCDECL_RPL (shutdown, int, (int fd, int how), ); _GL_CXXALIAS_RPL (shutdown, int, (int fd, int how)); # else _GL_CXXALIAS_SYS (shutdown, int, (int fd, int how)); # endif _GL_CXXALIASWARN (shutdown); #elif @HAVE_WINSOCK2_H@ -# undef shutdown -# define shutdown shutdown_used_without_requesting_gnulib_module_shutdown +# if !GNULIB_SHUTDOWN +# undef shutdown +# define shutdown shutdown_used_without_requesting_gnulib_module_shutdown +# endif #elif defined GNULIB_POSIXCHECK # undef shutdown # if HAVE_RAW_DECL_SHUTDOWN @@ -716,14 +747,14 @@ _GL_WARN_ON_USE (shutdown, "shutdown is not always POSIX compliant - " # endif _GL_FUNCDECL_RPL (accept4, int, (int sockfd, struct sockaddr *addr, socklen_t *addrlen, - int flags)); + int flags), ); _GL_CXXALIAS_RPL (accept4, int, (int sockfd, struct sockaddr *addr, socklen_t *addrlen, int flags)); # else _GL_FUNCDECL_SYS (accept4, int, (int sockfd, struct sockaddr *addr, socklen_t *addrlen, - int flags)); + int flags), ); _GL_CXXALIAS_SYS (accept4, int, (int sockfd, struct sockaddr *addr, socklen_t *addrlen, int flags)); -- cgit v1.2.3-74-g34f1