summaryrefslogtreecommitdiff
path: root/lib/sys_socket.in.h
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2011-02-14 11:36:25 +0100
committerLudovic Courtès <ludo@gnu.org>2011-02-14 11:36:25 +0100
commit49114fd43de833c0724fbb0b6dc9ca639d1ab74f (patch)
treebd33e1612cbbc37218ff18a229ff603018d2d5d5 /lib/sys_socket.in.h
parentd9a00aa53612b97b11847cfc03647a3ab54b2a48 (diff)
downloadguile-49114fd43de833c0724fbb0b6dc9ca639d1ab74f.tar.gz
Update Gnulib; add new modules.
This updates Gnulib to v0.0-4889-ge375fe3. * m4/gnulib-cache.m4: Add `accept', `bind', `close', `connect', `getpeername', `getsockname', `getsockopt', `listen', `malloc', `malloca', `recv', `recvfrom', `send', `sendto', `setsockopt', `shutdown', `socket', and `sockets', requested by Jan Nieuwenhuizen <janneke-list@xs4all.nl> for cross-MinGW32 builds. Add `trunc', requested by Mark H Weaver <mhw@netris.org>.
Diffstat (limited to 'lib/sys_socket.in.h')
-rw-r--r--lib/sys_socket.in.h46
1 files changed, 36 insertions, 10 deletions
diff --git a/lib/sys_socket.in.h b/lib/sys_socket.in.h
index 5c8462716..12f6d1bc7 100644
--- a/lib/sys_socket.in.h
+++ b/lib/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-2010 Free Software Foundation, Inc.
+ Copyright (C) 2005-2011 Free Software Foundation, Inc.
Written by Simon Josefsson.
This program is free software; you can redistribute it and/or modify
@@ -67,7 +67,10 @@
/* The definition of _GL_WARN_ON_USE is copied here. */
#if !@HAVE_SA_FAMILY_T@
+# if !GNULIB_defined_sa_family_t
typedef unsigned short sa_family_t;
+# define GNULIB_defined_sa_family_t 1
+# endif
#endif
#if @HAVE_STRUCT_SOCKADDR_STORAGE@
@@ -89,12 +92,16 @@ typedef unsigned short sa_family_t;
: alignof (__ss_aligntype)) \
+ sizeof (__ss_aligntype)))
+# if !GNULIB_defined_struct_sockaddr_storage
struct sockaddr_storage
{
sa_family_t ss_family; /* Address family, etc. */
__ss_aligntype __ss_align; /* Force desired alignment. */
char __ss_padding[_SS_PADSIZE];
};
+# define GNULIB_defined_struct_sockaddr_storage 1
+# endif
+
#endif
#if @HAVE_SYS_SOCKET_H@
@@ -159,7 +166,10 @@ struct sockaddr_storage
# include <sys/types.h>
# include <io.h>
+# if !GNULIB_defined_socklen_t
typedef int socklen_t;
+# define GNULIB_defined_socklen_t 1
+# endif
# endif
@@ -167,6 +177,8 @@ typedef int socklen_t;
#if @HAVE_WINSOCK2_H@
+# if !GNULIB_defined_rpl_fd_isset
+
/* Re-define FD_ISSET to avoid a WSA call while we are not using
network sockets. */
static inline int
@@ -183,6 +195,9 @@ rpl_fd_isset (SOCKET fd, fd_set * set)
return 0;
}
+# define GNULIB_defined_rpl_fd_isset 1
+# endif
+
# undef FD_ISSET
# define FD_ISSET(fd, set) rpl_fd_isset(fd, set)
@@ -245,8 +260,11 @@ _GL_FUNCDECL_RPL (connect, int,
_GL_CXXALIAS_RPL (connect, int,
(int fd, const struct sockaddr *addr, socklen_t addrlen));
# else
-_GL_CXXALIAS_SYS (connect, int,
- (int fd, const struct sockaddr *addr, socklen_t addrlen));
+/* Need to cast, because on NonStop Kernel, the third parameter is
+ size_t addrlen. */
+_GL_CXXALIAS_SYS_CAST (connect, int,
+ (int fd,
+ const struct sockaddr *addr, socklen_t addrlen));
# endif
_GL_CXXALIASWARN (connect);
#elif @HAVE_WINSOCK2_H@
@@ -300,8 +318,11 @@ _GL_FUNCDECL_RPL (bind, int,
_GL_CXXALIAS_RPL (bind, int,
(int fd, const struct sockaddr *addr, socklen_t addrlen));
# else
-_GL_CXXALIAS_SYS (bind, int,
- (int fd, const struct sockaddr *addr, socklen_t addrlen));
+/* Need to cast, because on NonStop Kernel, the third parameter is
+ size_t addrlen. */
+_GL_CXXALIAS_SYS_CAST (bind, int,
+ (int fd,
+ const struct sockaddr *addr, socklen_t addrlen));
# endif
_GL_CXXALIASWARN (bind);
#elif @HAVE_WINSOCK2_H@
@@ -522,9 +543,11 @@ _GL_CXXALIAS_RPL (sendto, ssize_t,
(int fd, const void *buf, size_t len, int flags,
const struct sockaddr *to, socklen_t tolen));
# else
-_GL_CXXALIAS_SYS (sendto, ssize_t,
- (int fd, const void *buf, size_t len, int flags,
- const struct sockaddr *to, socklen_t tolen));
+/* Need to cast, because on NonStop Kernel, the sixth parameter is
+ size_t tolen. */
+_GL_CXXALIAS_SYS_CAST (sendto, ssize_t,
+ (int fd, const void *buf, size_t len, int flags,
+ const struct sockaddr *to, socklen_t tolen));
# endif
_GL_CXXALIASWARN (sendto);
#elif @HAVE_WINSOCK2_H@
@@ -550,8 +573,11 @@ _GL_FUNCDECL_RPL (setsockopt, int, (int fd, int level, int optname,
_GL_CXXALIAS_RPL (setsockopt, int, (int fd, int level, int optname,
const void * optval, socklen_t optlen));
# else
-_GL_CXXALIAS_SYS (setsockopt, int, (int fd, int level, int optname,
- const void * optval, socklen_t optlen));
+/* Need to cast, because on NonStop Kernel, the fifth parameter is
+ size_t optlen. */
+_GL_CXXALIAS_SYS_CAST (setsockopt, int,
+ (int fd, int level, int optname,
+ const void * optval, socklen_t optlen));
# endif
_GL_CXXALIASWARN (setsockopt);
#elif @HAVE_WINSOCK2_H@