Mercurial > hg > octave-nkf > gnulib-hg
changeset 13910:d2ab80f79a05
sys_socket: Ensure ss_family field on AIX.
* lib/sys_socket.in.h (ss_family): New macro definition.
* m4/sys_socket_h.m4 (gl_HEADER_SYS_SOCKET): Set
HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY. Set SYS_SOCKET_H if necessary.
(gl_SYS_SOCKET_H_DEFAULTS): Initialize
HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY.
* modules/sys_socket (Makefile.am): Substitute
HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY.
* doc/posix-headers/sys_socket.texi: Mention the AIX bug.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Sun, 28 Nov 2010 17:04:03 +0100 |
parents | 280e14aca1f7 |
children | e6744cae0421 |
files | ChangeLog doc/posix-headers/sys_socket.texi lib/sys_socket.in.h m4/sys_socket_h.m4 modules/sys_socket |
diffstat | 5 files changed, 45 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2010-11-28 Bruno Haible <bruno@clisp.org> + + sys_socket: Ensure ss_family field on AIX. + * lib/sys_socket.in.h (ss_family): New macro definition. + * m4/sys_socket_h.m4 (gl_HEADER_SYS_SOCKET): Set + HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY. Set SYS_SOCKET_H if necessary. + (gl_SYS_SOCKET_H_DEFAULTS): Initialize + HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY. + * modules/sys_socket (Makefile.am): Substitute + HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY. + * doc/posix-headers/sys_socket.texi: Mention the AIX bug. + 2010-11-27 Bruno Haible <bruno@clisp.org> readline: Improve configure output.
--- a/doc/posix-headers/sys_socket.texi +++ b/doc/posix-headers/sys_socket.texi @@ -18,6 +18,10 @@ @code{SHUT_RDWR} macros on some platforms, despite having the @code{shutdown} functions: emx+gcc. +@item +The @code{struct sockaddr_storage} type does not have a member @code{ss_family} +on some platforms: +AIX 7.1. @end itemize Portability problems not fixed by Gnulib:
--- a/lib/sys_socket.in.h +++ b/lib/sys_socket.in.h @@ -70,7 +70,14 @@ typedef unsigned short sa_family_t; #endif -#if !@HAVE_STRUCT_SOCKADDR_STORAGE@ +#if @HAVE_STRUCT_SOCKADDR_STORAGE@ +/* Make the 'struct sockaddr_storage' field 'ss_family' visible on AIX 7.1. */ +# if !@HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY@ +# ifndef ss_family +# define ss_family __ss_family +# endif +# endif +#else # include <alignof.h> /* Code taken from glibc sysdeps/unix/sysv/linux/bits/socket.h on 2009-05-08, licensed under LGPLv2.1+, plus portability fixes. */
--- a/m4/sys_socket_h.m4 +++ b/m4/sys_socket_h.m4 @@ -1,4 +1,4 @@ -# sys_socket_h.m4 serial 19 +# sys_socket_h.m4 serial 20 dnl Copyright (C) 2005-2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -57,6 +57,23 @@ if test $ac_cv_type_sa_family_t = no; then HAVE_SA_FAMILY_T=0 fi + if test $ac_cv_type_struct_sockaddr_storage != no; then + AC_CHECK_MEMBERS([struct sockaddr_storage.ss_family], + [], + [HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY=0], + [#include <sys/types.h> + #ifdef HAVE_SYS_SOCKET_H + #include <sys/socket.h> + #endif + #ifdef HAVE_WS2TCPIP_H + #include <ws2tcpip.h> + #endif + ]) + fi + if test $HAVE_STRUCT_SOCKADDR_STORAGE = 0 || test $HAVE_SA_FAMILY_T = 0 \ + || test $HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY = 0; then + SYS_SOCKET_H='sys/socket.h' + fi gl_PREREQ_SYS_H_WINSOCK2 dnl Check for declarations of anything we want to poison if the @@ -145,6 +162,8 @@ GNULIB_SHUTDOWN=0; AC_SUBST([GNULIB_SHUTDOWN]) GNULIB_ACCEPT4=0; AC_SUBST([GNULIB_ACCEPT4]) HAVE_STRUCT_SOCKADDR_STORAGE=1; AC_SUBST([HAVE_STRUCT_SOCKADDR_STORAGE]) + HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY=1; + AC_SUBST([HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY]) HAVE_SA_FAMILY_T=1; AC_SUBST([HAVE_SA_FAMILY_T]) HAVE_ACCEPT4=1; AC_SUBST([HAVE_ACCEPT4]) ])
--- a/modules/sys_socket +++ b/modules/sys_socket @@ -52,6 +52,7 @@ -e 's|@''HAVE_WINSOCK2_H''@|$(HAVE_WINSOCK2_H)|g' \ -e 's|@''HAVE_WS2TCPIP_H''@|$(HAVE_WS2TCPIP_H)|g' \ -e 's|@''HAVE_STRUCT_SOCKADDR_STORAGE''@|$(HAVE_STRUCT_SOCKADDR_STORAGE)|g' \ + -e 's|@''HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY''@|$(HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY)|g' \ -e 's|@''HAVE_SA_FAMILY_T''@|$(HAVE_SA_FAMILY_T)|g' \ -e 's|@''HAVE_ACCEPT4''@|$(HAVE_ACCEPT4)|g' \ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \