summaryrefslogtreecommitdiffstats
path: root/gl/sys_socket.in.h
diff options
context:
space:
mode:
Diffstat (limited to 'gl/sys_socket.in.h')
-rw-r--r--gl/sys_socket.in.h140
1 files changed, 91 insertions, 49 deletions
diff --git a/gl/sys_socket.in.h b/gl/sys_socket.in.h
index 6705593f..8632c66d 100644
--- a/gl/sys_socket.in.h
+++ b/gl/sys_socket.in.h
@@ -1,6 +1,6 @@
1/* Provide a sys/socket header file for systems lacking it (read: MinGW) 1/* Provide a sys/socket header file for systems lacking it (read: MinGW)
2 and for systems where it is incomplete. 2 and for systems where it is incomplete.
3 Copyright (C) 2005-2023 Free Software Foundation, Inc. 3 Copyright (C) 2005-2025 Free Software Foundation, Inc.
4 Written by Simon Josefsson. 4 Written by Simon Josefsson.
5 5
6 This file is free software: you can redistribute it and/or modify 6 This file is free software: you can redistribute it and/or modify
@@ -27,7 +27,7 @@
27#endif 27#endif
28@PRAGMA_COLUMNS@ 28@PRAGMA_COLUMNS@
29 29
30#if defined _GL_ALREADY_INCLUDING_SYS_SOCKET_H 30#if defined _@GUARD_PREFIX@_ALREADY_INCLUDING_SYS_SOCKET_H
31/* Special invocation convention: 31/* Special invocation convention:
32 - On Cygwin 1.5.x we have a sequence of nested includes 32 - On Cygwin 1.5.x we have a sequence of nested includes
33 <sys/socket.h> -> <cygwin/socket.h> -> <asm/socket.h> -> <cygwin/if.h>, 33 <sys/socket.h> -> <cygwin/socket.h> -> <asm/socket.h> -> <cygwin/if.h>,
@@ -43,7 +43,7 @@
43 43
44#if @HAVE_SYS_SOCKET_H@ 44#if @HAVE_SYS_SOCKET_H@
45 45
46# define _GL_ALREADY_INCLUDING_SYS_SOCKET_H 46# define _@GUARD_PREFIX@_ALREADY_INCLUDING_SYS_SOCKET_H
47 47
48/* On many platforms, <sys/socket.h> assumes prior inclusion of 48/* On many platforms, <sys/socket.h> assumes prior inclusion of
49 <sys/types.h>. */ 49 <sys/types.h>. */
@@ -56,16 +56,19 @@
56/* The include_next requires a split double-inclusion guard. */ 56/* The include_next requires a split double-inclusion guard. */
57# @INCLUDE_NEXT@ @NEXT_SYS_SOCKET_H@ 57# @INCLUDE_NEXT@ @NEXT_SYS_SOCKET_H@
58 58
59# undef _GL_ALREADY_INCLUDING_SYS_SOCKET_H 59# undef _@GUARD_PREFIX@_ALREADY_INCLUDING_SYS_SOCKET_H
60 60
61#endif 61#endif
62 62
63#ifndef _@GUARD_PREFIX@_SYS_SOCKET_H 63#ifndef _@GUARD_PREFIX@_SYS_SOCKET_H
64#define _@GUARD_PREFIX@_SYS_SOCKET_H 64#define _@GUARD_PREFIX@_SYS_SOCKET_H
65 65
66#ifndef _GL_INLINE_HEADER_BEGIN 66/* This file uses _GL_INLINE_HEADER_BEGIN, _GL_INLINE, GNULIB_POSIXCHECK,
67 HAVE_RAW_DECL_*, alignof. */
68#if !_GL_CONFIG_H_INCLUDED
67 #error "Please include config.h first." 69 #error "Please include config.h first."
68#endif 70#endif
71
69_GL_INLINE_HEADER_BEGIN 72_GL_INLINE_HEADER_BEGIN
70#ifndef _GL_SYS_SOCKET_INLINE 73#ifndef _GL_SYS_SOCKET_INLINE
71# define _GL_SYS_SOCKET_INLINE _GL_INLINE 74# define _GL_SYS_SOCKET_INLINE _GL_INLINE
@@ -199,6 +202,7 @@ struct sockaddr_storage
199 202
200/* Rudimentary 'struct msghdr'; this works as long as you don't try to 203/* Rudimentary 'struct msghdr'; this works as long as you don't try to
201 access msg_control or msg_controllen. */ 204 access msg_control or msg_controllen. */
205# if !defined GNULIB_defined_struct_msghdr
202struct msghdr { 206struct msghdr {
203 void *msg_name; 207 void *msg_name;
204 socklen_t msg_namelen; 208 socklen_t msg_namelen;
@@ -206,6 +210,8 @@ struct msghdr {
206 int msg_iovlen; 210 int msg_iovlen;
207 int msg_flags; 211 int msg_flags;
208}; 212};
213# define GNULIB_defined_struct_msghdr 1
214# endif
209 215
210#endif 216#endif
211 217
@@ -286,15 +292,17 @@ rpl_fd_isset (SOCKET fd, fd_set * set)
286# undef socket 292# undef socket
287# define socket rpl_socket 293# define socket rpl_socket
288# endif 294# endif
289_GL_FUNCDECL_RPL (socket, int, (int domain, int type, int protocol)); 295_GL_FUNCDECL_RPL (socket, int, (int domain, int type, int protocol), );
290_GL_CXXALIAS_RPL (socket, int, (int domain, int type, int protocol)); 296_GL_CXXALIAS_RPL (socket, int, (int domain, int type, int protocol));
291# else 297# else
292_GL_CXXALIAS_SYS (socket, int, (int domain, int type, int protocol)); 298_GL_CXXALIAS_SYS (socket, int, (int domain, int type, int protocol));
293# endif 299# endif
294_GL_CXXALIASWARN (socket); 300_GL_CXXALIASWARN (socket);
295#elif @HAVE_WINSOCK2_H@ 301#elif @HAVE_WINSOCK2_H@
296# undef socket 302# if !GNULIB_SOCKET
297# define socket socket_used_without_requesting_gnulib_module_socket 303# undef socket
304# define socket socket_used_without_requesting_gnulib_module_socket
305# endif
298#elif defined GNULIB_POSIXCHECK 306#elif defined GNULIB_POSIXCHECK
299# undef socket 307# undef socket
300# if HAVE_RAW_DECL_SOCKET 308# if HAVE_RAW_DECL_SOCKET
@@ -310,7 +318,7 @@ _GL_WARN_ON_USE (socket, "socket is not always POSIX compliant - "
310# define connect rpl_connect 318# define connect rpl_connect
311# endif 319# endif
312_GL_FUNCDECL_RPL (connect, int, 320_GL_FUNCDECL_RPL (connect, int,
313 (int fd, const struct sockaddr *addr, socklen_t addrlen) 321 (int fd, const struct sockaddr *addr, socklen_t addrlen),
314 _GL_ARG_NONNULL ((2))); 322 _GL_ARG_NONNULL ((2)));
315_GL_CXXALIAS_RPL (connect, int, 323_GL_CXXALIAS_RPL (connect, int,
316 (int fd, const struct sockaddr *addr, socklen_t addrlen)); 324 (int fd, const struct sockaddr *addr, socklen_t addrlen));
@@ -323,8 +331,10 @@ _GL_CXXALIAS_SYS_CAST (connect, int,
323# endif 331# endif
324_GL_CXXALIASWARN (connect); 332_GL_CXXALIASWARN (connect);
325#elif @HAVE_WINSOCK2_H@ 333#elif @HAVE_WINSOCK2_H@
326# undef connect 334# if !GNULIB_CONNECT
327# define connect socket_used_without_requesting_gnulib_module_connect 335# undef connect
336# define connect connect_used_without_requesting_gnulib_module_connect
337# endif
328#elif defined GNULIB_POSIXCHECK 338#elif defined GNULIB_POSIXCHECK
329# undef connect 339# undef connect
330# if HAVE_RAW_DECL_CONNECT 340# if HAVE_RAW_DECL_CONNECT
@@ -342,7 +352,7 @@ _GL_WARN_ON_USE (connect, "connect is not always POSIX compliant - "
342_GL_FUNCDECL_RPL (accept, int, 352_GL_FUNCDECL_RPL (accept, int,
343 (int fd, 353 (int fd,
344 struct sockaddr *restrict addr, 354 struct sockaddr *restrict addr,
345 socklen_t *restrict addrlen)); 355 socklen_t *restrict addrlen), );
346_GL_CXXALIAS_RPL (accept, int, 356_GL_CXXALIAS_RPL (accept, int,
347 (int fd, 357 (int fd,
348 struct sockaddr *restrict addr, 358 struct sockaddr *restrict addr,
@@ -355,10 +365,14 @@ _GL_CXXALIAS_SYS_CAST (accept, int,
355 struct sockaddr *restrict addr, 365 struct sockaddr *restrict addr,
356 socklen_t *restrict addrlen)); 366 socklen_t *restrict addrlen));
357# endif 367# endif
368# if __GLIBC__ >= 2
358_GL_CXXALIASWARN (accept); 369_GL_CXXALIASWARN (accept);
370# endif
359#elif @HAVE_WINSOCK2_H@ 371#elif @HAVE_WINSOCK2_H@
360# undef accept 372# if !GNULIB_ACCEPT
361# define accept accept_used_without_requesting_gnulib_module_accept 373# undef accept
374# define accept accept_used_without_requesting_gnulib_module_accept
375# endif
362#elif defined GNULIB_POSIXCHECK 376#elif defined GNULIB_POSIXCHECK
363# undef accept 377# undef accept
364# if HAVE_RAW_DECL_ACCEPT 378# if HAVE_RAW_DECL_ACCEPT
@@ -374,7 +388,7 @@ _GL_WARN_ON_USE (accept, "accept is not always POSIX compliant - "
374# define bind rpl_bind 388# define bind rpl_bind
375# endif 389# endif
376_GL_FUNCDECL_RPL (bind, int, 390_GL_FUNCDECL_RPL (bind, int,
377 (int fd, const struct sockaddr *addr, socklen_t addrlen) 391 (int fd, const struct sockaddr *addr, socklen_t addrlen),
378 _GL_ARG_NONNULL ((2))); 392 _GL_ARG_NONNULL ((2)));
379_GL_CXXALIAS_RPL (bind, int, 393_GL_CXXALIAS_RPL (bind, int,
380 (int fd, const struct sockaddr *addr, socklen_t addrlen)); 394 (int fd, const struct sockaddr *addr, socklen_t addrlen));
@@ -387,8 +401,10 @@ _GL_CXXALIAS_SYS_CAST (bind, int,
387# endif 401# endif
388_GL_CXXALIASWARN (bind); 402_GL_CXXALIASWARN (bind);
389#elif @HAVE_WINSOCK2_H@ 403#elif @HAVE_WINSOCK2_H@
390# undef bind 404# if !GNULIB_BIND
391# define bind bind_used_without_requesting_gnulib_module_bind 405# undef bind
406# define bind bind_used_without_requesting_gnulib_module_bind
407# endif
392#elif defined GNULIB_POSIXCHECK 408#elif defined GNULIB_POSIXCHECK
393# undef bind 409# undef bind
394# if HAVE_RAW_DECL_BIND 410# if HAVE_RAW_DECL_BIND
@@ -405,7 +421,7 @@ _GL_WARN_ON_USE (bind, "bind is not always POSIX compliant - "
405# endif 421# endif
406_GL_FUNCDECL_RPL (getpeername, int, 422_GL_FUNCDECL_RPL (getpeername, int,
407 (int fd, struct sockaddr *restrict addr, 423 (int fd, struct sockaddr *restrict addr,
408 socklen_t *restrict addrlen) 424 socklen_t *restrict addrlen),
409 _GL_ARG_NONNULL ((2, 3))); 425 _GL_ARG_NONNULL ((2, 3)));
410_GL_CXXALIAS_RPL (getpeername, int, 426_GL_CXXALIAS_RPL (getpeername, int,
411 (int fd, struct sockaddr *restrict addr, 427 (int fd, struct sockaddr *restrict addr,
@@ -417,10 +433,14 @@ _GL_CXXALIAS_SYS_CAST (getpeername, int,
417 (int fd, struct sockaddr *restrict addr, 433 (int fd, struct sockaddr *restrict addr,
418 socklen_t *restrict addrlen)); 434 socklen_t *restrict addrlen));
419# endif 435# endif
436# if __GLIBC__ >= 2
420_GL_CXXALIASWARN (getpeername); 437_GL_CXXALIASWARN (getpeername);
438# endif
421#elif @HAVE_WINSOCK2_H@ 439#elif @HAVE_WINSOCK2_H@
422# undef getpeername 440# if !GNULIB_GETPEERNAME
423# define getpeername getpeername_used_without_requesting_gnulib_module_getpeername 441# undef getpeername
442# define getpeername getpeername_used_without_requesting_gnulib_module_getpeername
443# endif
424#elif defined GNULIB_POSIXCHECK 444#elif defined GNULIB_POSIXCHECK
425# undef getpeername 445# undef getpeername
426# if HAVE_RAW_DECL_GETPEERNAME 446# if HAVE_RAW_DECL_GETPEERNAME
@@ -437,7 +457,7 @@ _GL_WARN_ON_USE (getpeername, "getpeername is not always POSIX compliant - "
437# endif 457# endif
438_GL_FUNCDECL_RPL (getsockname, int, 458_GL_FUNCDECL_RPL (getsockname, int,
439 (int fd, struct sockaddr *restrict addr, 459 (int fd, struct sockaddr *restrict addr,
440 socklen_t *restrict addrlen) 460 socklen_t *restrict addrlen),
441 _GL_ARG_NONNULL ((2, 3))); 461 _GL_ARG_NONNULL ((2, 3)));
442_GL_CXXALIAS_RPL (getsockname, int, 462_GL_CXXALIAS_RPL (getsockname, int,
443 (int fd, struct sockaddr *restrict addr, 463 (int fd, struct sockaddr *restrict addr,
@@ -449,10 +469,14 @@ _GL_CXXALIAS_SYS_CAST (getsockname, int,
449 (int fd, struct sockaddr *restrict addr, 469 (int fd, struct sockaddr *restrict addr,
450 socklen_t *restrict addrlen)); 470 socklen_t *restrict addrlen));
451# endif 471# endif
472# if __GLIBC__ >= 2
452_GL_CXXALIASWARN (getsockname); 473_GL_CXXALIASWARN (getsockname);
474# endif
453#elif @HAVE_WINSOCK2_H@ 475#elif @HAVE_WINSOCK2_H@
454# undef getsockname 476# if !GNULIB_GETSOCKNAME
455# define getsockname getsockname_used_without_requesting_gnulib_module_getsockname 477# undef getsockname
478# define getsockname getsockname_used_without_requesting_gnulib_module_getsockname
479# endif
456#elif defined GNULIB_POSIXCHECK 480#elif defined GNULIB_POSIXCHECK
457# undef getsockname 481# undef getsockname
458# if HAVE_RAW_DECL_GETSOCKNAME 482# if HAVE_RAW_DECL_GETSOCKNAME
@@ -469,7 +493,7 @@ _GL_WARN_ON_USE (getsockname, "getsockname is not always POSIX compliant - "
469# endif 493# endif
470_GL_FUNCDECL_RPL (getsockopt, int, 494_GL_FUNCDECL_RPL (getsockopt, int,
471 (int fd, int level, int optname, 495 (int fd, int level, int optname,
472 void *restrict optval, socklen_t *restrict optlen) 496 void *restrict optval, socklen_t *restrict optlen),
473 _GL_ARG_NONNULL ((4, 5))); 497 _GL_ARG_NONNULL ((4, 5)));
474_GL_CXXALIAS_RPL (getsockopt, int, 498_GL_CXXALIAS_RPL (getsockopt, int,
475 (int fd, int level, int optname, 499 (int fd, int level, int optname,
@@ -483,8 +507,10 @@ _GL_CXXALIAS_SYS_CAST (getsockopt, int,
483# endif 507# endif
484_GL_CXXALIASWARN (getsockopt); 508_GL_CXXALIASWARN (getsockopt);
485#elif @HAVE_WINSOCK2_H@ 509#elif @HAVE_WINSOCK2_H@
486# undef getsockopt 510# if !GNULIB_GETSOCKOPT
487# define getsockopt getsockopt_used_without_requesting_gnulib_module_getsockopt 511# undef getsockopt
512# define getsockopt getsockopt_used_without_requesting_gnulib_module_getsockopt
513# endif
488#elif defined GNULIB_POSIXCHECK 514#elif defined GNULIB_POSIXCHECK
489# undef getsockopt 515# undef getsockopt
490# if HAVE_RAW_DECL_GETSOCKOPT 516# if HAVE_RAW_DECL_GETSOCKOPT
@@ -499,15 +525,17 @@ _GL_WARN_ON_USE (getsockopt, "getsockopt is not always POSIX compliant - "
499# undef listen 525# undef listen
500# define listen rpl_listen 526# define listen rpl_listen
501# endif 527# endif
502_GL_FUNCDECL_RPL (listen, int, (int fd, int backlog)); 528_GL_FUNCDECL_RPL (listen, int, (int fd, int backlog), );
503_GL_CXXALIAS_RPL (listen, int, (int fd, int backlog)); 529_GL_CXXALIAS_RPL (listen, int, (int fd, int backlog));
504# else 530# else
505_GL_CXXALIAS_SYS (listen, int, (int fd, int backlog)); 531_GL_CXXALIAS_SYS (listen, int, (int fd, int backlog));
506# endif 532# endif
507_GL_CXXALIASWARN (listen); 533_GL_CXXALIASWARN (listen);
508#elif @HAVE_WINSOCK2_H@ 534#elif @HAVE_WINSOCK2_H@
509# undef listen 535# if !GNULIB_LISTEN
510# define listen listen_used_without_requesting_gnulib_module_listen 536# undef listen
537# define listen listen_used_without_requesting_gnulib_module_listen
538# endif
511#elif defined GNULIB_POSIXCHECK 539#elif defined GNULIB_POSIXCHECK
512# undef listen 540# undef listen
513# if HAVE_RAW_DECL_LISTEN 541# if HAVE_RAW_DECL_LISTEN
@@ -522,7 +550,7 @@ _GL_WARN_ON_USE (listen, "listen is not always POSIX compliant - "
522# undef recv 550# undef recv
523# define recv rpl_recv 551# define recv rpl_recv
524# endif 552# endif
525_GL_FUNCDECL_RPL (recv, ssize_t, (int fd, void *buf, size_t len, int flags) 553_GL_FUNCDECL_RPL (recv, ssize_t, (int fd, void *buf, size_t len, int flags),
526 _GL_ARG_NONNULL ((2))); 554 _GL_ARG_NONNULL ((2)));
527_GL_CXXALIAS_RPL (recv, ssize_t, (int fd, void *buf, size_t len, int flags)); 555_GL_CXXALIAS_RPL (recv, ssize_t, (int fd, void *buf, size_t len, int flags));
528# else 556# else
@@ -533,8 +561,10 @@ _GL_CXXALIAS_SYS_CAST (recv, ssize_t, (int fd, void *buf, size_t len, int flags)
533# endif 561# endif
534_GL_CXXALIASWARN (recv); 562_GL_CXXALIASWARN (recv);
535#elif @HAVE_WINSOCK2_H@ 563#elif @HAVE_WINSOCK2_H@
536# undef recv 564# if !GNULIB_RECV
537# define recv recv_used_without_requesting_gnulib_module_recv 565# undef recv
566# define recv recv_used_without_requesting_gnulib_module_recv
567# endif
538#elif defined GNULIB_POSIXCHECK 568#elif defined GNULIB_POSIXCHECK
539# undef recv 569# undef recv
540# if HAVE_RAW_DECL_RECV 570# if HAVE_RAW_DECL_RECV
@@ -550,7 +580,7 @@ _GL_WARN_ON_USE (recv, "recv is not always POSIX compliant - "
550# define send rpl_send 580# define send rpl_send
551# endif 581# endif
552_GL_FUNCDECL_RPL (send, ssize_t, 582_GL_FUNCDECL_RPL (send, ssize_t,
553 (int fd, const void *buf, size_t len, int flags) 583 (int fd, const void *buf, size_t len, int flags),
554 _GL_ARG_NONNULL ((2))); 584 _GL_ARG_NONNULL ((2)));
555_GL_CXXALIAS_RPL (send, ssize_t, 585_GL_CXXALIAS_RPL (send, ssize_t,
556 (int fd, const void *buf, size_t len, int flags)); 586 (int fd, const void *buf, size_t len, int flags));
@@ -563,8 +593,10 @@ _GL_CXXALIAS_SYS_CAST (send, ssize_t,
563# endif 593# endif
564_GL_CXXALIASWARN (send); 594_GL_CXXALIASWARN (send);
565#elif @HAVE_WINSOCK2_H@ 595#elif @HAVE_WINSOCK2_H@
566# undef send 596# if !GNULIB_SEND
567# define send send_used_without_requesting_gnulib_module_send 597# undef send
598# define send send_used_without_requesting_gnulib_module_send
599# endif
568#elif defined GNULIB_POSIXCHECK 600#elif defined GNULIB_POSIXCHECK
569# undef send 601# undef send
570# if HAVE_RAW_DECL_SEND 602# if HAVE_RAW_DECL_SEND
@@ -582,7 +614,7 @@ _GL_WARN_ON_USE (send, "send is not always POSIX compliant - "
582_GL_FUNCDECL_RPL (recvfrom, ssize_t, 614_GL_FUNCDECL_RPL (recvfrom, ssize_t,
583 (int fd, void *restrict buf, size_t len, int flags, 615 (int fd, void *restrict buf, size_t len, int flags,
584 struct sockaddr *restrict from, 616 struct sockaddr *restrict from,
585 socklen_t *restrict fromlen) 617 socklen_t *restrict fromlen),
586 _GL_ARG_NONNULL ((2))); 618 _GL_ARG_NONNULL ((2)));
587_GL_CXXALIAS_RPL (recvfrom, ssize_t, 619_GL_CXXALIAS_RPL (recvfrom, ssize_t,
588 (int fd, void *restrict buf, size_t len, int flags, 620 (int fd, void *restrict buf, size_t len, int flags,
@@ -596,10 +628,14 @@ _GL_CXXALIAS_SYS_CAST (recvfrom, ssize_t,
596 struct sockaddr *restrict from, 628 struct sockaddr *restrict from,
597 socklen_t *restrict fromlen)); 629 socklen_t *restrict fromlen));
598# endif 630# endif
631# if __GLIBC__ >= 2
599_GL_CXXALIASWARN (recvfrom); 632_GL_CXXALIASWARN (recvfrom);
633# endif
600#elif @HAVE_WINSOCK2_H@ 634#elif @HAVE_WINSOCK2_H@
601# undef recvfrom 635# if !GNULIB_RECVFROM
602# define recvfrom recvfrom_used_without_requesting_gnulib_module_recvfrom 636# undef recvfrom
637# define recvfrom recvfrom_used_without_requesting_gnulib_module_recvfrom
638# endif
603#elif defined GNULIB_POSIXCHECK 639#elif defined GNULIB_POSIXCHECK
604# undef recvfrom 640# undef recvfrom
605# if HAVE_RAW_DECL_RECVFROM 641# if HAVE_RAW_DECL_RECVFROM
@@ -616,7 +652,7 @@ _GL_WARN_ON_USE (recvfrom, "recvfrom is not always POSIX compliant - "
616# endif 652# endif
617_GL_FUNCDECL_RPL (sendto, ssize_t, 653_GL_FUNCDECL_RPL (sendto, ssize_t,
618 (int fd, const void *buf, size_t len, int flags, 654 (int fd, const void *buf, size_t len, int flags,
619 const struct sockaddr *to, socklen_t tolen) 655 const struct sockaddr *to, socklen_t tolen),
620 _GL_ARG_NONNULL ((2))); 656 _GL_ARG_NONNULL ((2)));
621_GL_CXXALIAS_RPL (sendto, ssize_t, 657_GL_CXXALIAS_RPL (sendto, ssize_t,
622 (int fd, const void *buf, size_t len, int flags, 658 (int fd, const void *buf, size_t len, int flags,
@@ -630,8 +666,10 @@ _GL_CXXALIAS_SYS_CAST (sendto, ssize_t,
630# endif 666# endif
631_GL_CXXALIASWARN (sendto); 667_GL_CXXALIASWARN (sendto);
632#elif @HAVE_WINSOCK2_H@ 668#elif @HAVE_WINSOCK2_H@
633# undef sendto 669# if !GNULIB_SENDTO
634# define sendto sendto_used_without_requesting_gnulib_module_sendto 670# undef sendto
671# define sendto sendto_used_without_requesting_gnulib_module_sendto
672# endif
635#elif defined GNULIB_POSIXCHECK 673#elif defined GNULIB_POSIXCHECK
636# undef sendto 674# undef sendto
637# if HAVE_RAW_DECL_SENDTO 675# if HAVE_RAW_DECL_SENDTO
@@ -647,7 +685,7 @@ _GL_WARN_ON_USE (sendto, "sendto is not always POSIX compliant - "
647# define setsockopt rpl_setsockopt 685# define setsockopt rpl_setsockopt
648# endif 686# endif
649_GL_FUNCDECL_RPL (setsockopt, int, (int fd, int level, int optname, 687_GL_FUNCDECL_RPL (setsockopt, int, (int fd, int level, int optname,
650 const void * optval, socklen_t optlen) 688 const void * optval, socklen_t optlen),
651 _GL_ARG_NONNULL ((4))); 689 _GL_ARG_NONNULL ((4)));
652_GL_CXXALIAS_RPL (setsockopt, int, (int fd, int level, int optname, 690_GL_CXXALIAS_RPL (setsockopt, int, (int fd, int level, int optname,
653 const void * optval, socklen_t optlen)); 691 const void * optval, socklen_t optlen));
@@ -660,8 +698,10 @@ _GL_CXXALIAS_SYS_CAST (setsockopt, int,
660# endif 698# endif
661_GL_CXXALIASWARN (setsockopt); 699_GL_CXXALIASWARN (setsockopt);
662#elif @HAVE_WINSOCK2_H@ 700#elif @HAVE_WINSOCK2_H@
663# undef setsockopt 701# if !GNULIB_SETSOCKOPT
664# define setsockopt setsockopt_used_without_requesting_gnulib_module_setsockopt 702# undef setsockopt
703# define setsockopt setsockopt_used_without_requesting_gnulib_module_setsockopt
704# endif
665#elif defined GNULIB_POSIXCHECK 705#elif defined GNULIB_POSIXCHECK
666# undef setsockopt 706# undef setsockopt
667# if HAVE_RAW_DECL_SETSOCKOPT 707# if HAVE_RAW_DECL_SETSOCKOPT
@@ -676,15 +716,17 @@ _GL_WARN_ON_USE (setsockopt, "setsockopt is not always POSIX compliant - "
676# undef shutdown 716# undef shutdown
677# define shutdown rpl_shutdown 717# define shutdown rpl_shutdown
678# endif 718# endif
679_GL_FUNCDECL_RPL (shutdown, int, (int fd, int how)); 719_GL_FUNCDECL_RPL (shutdown, int, (int fd, int how), );
680_GL_CXXALIAS_RPL (shutdown, int, (int fd, int how)); 720_GL_CXXALIAS_RPL (shutdown, int, (int fd, int how));
681# else 721# else
682_GL_CXXALIAS_SYS (shutdown, int, (int fd, int how)); 722_GL_CXXALIAS_SYS (shutdown, int, (int fd, int how));
683# endif 723# endif
684_GL_CXXALIASWARN (shutdown); 724_GL_CXXALIASWARN (shutdown);
685#elif @HAVE_WINSOCK2_H@ 725#elif @HAVE_WINSOCK2_H@
686# undef shutdown 726# if !GNULIB_SHUTDOWN
687# define shutdown shutdown_used_without_requesting_gnulib_module_shutdown 727# undef shutdown
728# define shutdown shutdown_used_without_requesting_gnulib_module_shutdown
729# endif
688#elif defined GNULIB_POSIXCHECK 730#elif defined GNULIB_POSIXCHECK
689# undef shutdown 731# undef shutdown
690# if HAVE_RAW_DECL_SHUTDOWN 732# if HAVE_RAW_DECL_SHUTDOWN
@@ -705,14 +747,14 @@ _GL_WARN_ON_USE (shutdown, "shutdown is not always POSIX compliant - "
705# endif 747# endif
706_GL_FUNCDECL_RPL (accept4, int, 748_GL_FUNCDECL_RPL (accept4, int,
707 (int sockfd, struct sockaddr *addr, socklen_t *addrlen, 749 (int sockfd, struct sockaddr *addr, socklen_t *addrlen,
708 int flags)); 750 int flags), );
709_GL_CXXALIAS_RPL (accept4, int, 751_GL_CXXALIAS_RPL (accept4, int,
710 (int sockfd, struct sockaddr *addr, socklen_t *addrlen, 752 (int sockfd, struct sockaddr *addr, socklen_t *addrlen,
711 int flags)); 753 int flags));
712# else 754# else
713_GL_FUNCDECL_SYS (accept4, int, 755_GL_FUNCDECL_SYS (accept4, int,
714 (int sockfd, struct sockaddr *addr, socklen_t *addrlen, 756 (int sockfd, struct sockaddr *addr, socklen_t *addrlen,
715 int flags)); 757 int flags), );
716_GL_CXXALIAS_SYS (accept4, int, 758_GL_CXXALIAS_SYS (accept4, int,
717 (int sockfd, struct sockaddr *addr, socklen_t *addrlen, 759 (int sockfd, struct sockaddr *addr, socklen_t *addrlen,
718 int flags)); 760 int flags));