From 45285d804d897857de56b17aa1132fcffa4718a3 Mon Sep 17 00:00:00 2001 From: Francesco Salvestrini Date: Thu, 6 Nov 2008 22:31:28 +0100 Subject: [PATCH] Updated with last gnulib sources --- src/gnulib/Makefile.am | 8 ++ src/gnulib/stdint.in.h | 2 + src/gnulib/unistd.in.h | 144 +++++++++++++++++++++++++++++++++++- src/gnulib/wchar.in.h | 2 + tools/autotools/m4/gnulib-common.m4 | 12 ++- tools/autotools/m4/include_next.m4 | 18 ++++- tools/autotools/m4/unistd_h.m4 | 10 ++- 7 files changed, 190 insertions(+), 6 deletions(-) diff --git a/src/gnulib/Makefile.am b/src/gnulib/Makefile.am index 890d8e4..e90dbbd 100644 --- a/src/gnulib/Makefile.am +++ b/src/gnulib/Makefile.am @@ -144,13 +144,17 @@ unistd.h: unistd.in.h -e 's|@''GNULIB_CLOSE''@|$(GNULIB_CLOSE)|g' \ -e 's|@''GNULIB_DUP2''@|$(GNULIB_DUP2)|g' \ -e 's|@''GNULIB_ENVIRON''@|$(GNULIB_ENVIRON)|g' \ + -e 's|@''GNULIB_EUIDACCESS''@|$(GNULIB_EUIDACCESS)|g' \ -e 's|@''GNULIB_FCHDIR''@|$(GNULIB_FCHDIR)|g' \ -e 's|@''GNULIB_FSYNC''@|$(GNULIB_FSYNC)|g' \ -e 's|@''GNULIB_FTRUNCATE''@|$(GNULIB_FTRUNCATE)|g' \ -e 's|@''GNULIB_GETCWD''@|$(GNULIB_GETCWD)|g' \ + -e 's|@''GNULIB_GETDOMAINNAME''@|$(GNULIB_GETDOMAINNAME)|g' \ -e 's|@''GNULIB_GETDTABLESIZE''@|$(GNULIB_GETDTABLESIZE)|g' \ + -e 's|@''GNULIB_GETHOSTNAME''@|$(GNULIB_GETHOSTNAME)|g' \ -e 's|@''GNULIB_GETLOGIN_R''@|$(GNULIB_GETLOGIN_R)|g' \ -e 's|@''GNULIB_GETPAGESIZE''@|$(GNULIB_GETPAGESIZE)|g' \ + -e 's|@''GNULIB_GETUSERSHELL''@|$(GNULIB_GETUSERSHELL)|g' \ -e 's|@''GNULIB_LCHOWN''@|$(GNULIB_LCHOWN)|g' \ -e 's|@''GNULIB_LSEEK''@|$(GNULIB_LSEEK)|g' \ -e 's|@''GNULIB_READLINK''@|$(GNULIB_READLINK)|g' \ @@ -158,10 +162,14 @@ unistd.h: unistd.in.h -e 's|@''GNULIB_UNISTD_H_SIGPIPE''@|$(GNULIB_UNISTD_H_SIGPIPE)|g' \ -e 's|@''GNULIB_WRITE''@|$(GNULIB_WRITE)|g' \ -e 's|@''HAVE_DUP2''@|$(HAVE_DUP2)|g' \ + -e 's|@''HAVE_EUIDACCESS''@|$(HAVE_EUIDACCESS)|g' \ -e 's|@''HAVE_FSYNC''@|$(HAVE_FSYNC)|g' \ -e 's|@''HAVE_FTRUNCATE''@|$(HAVE_FTRUNCATE)|g' \ + -e 's|@''HAVE_GETDOMAINNAME''@|$(HAVE_GETDOMAINNAME)|g' \ -e 's|@''HAVE_GETDTABLESIZE''@|$(HAVE_GETDTABLESIZE)|g' \ + -e 's|@''HAVE_GETHOSTNAME''@|$(HAVE_GETHOSTNAME)|g' \ -e 's|@''HAVE_GETPAGESIZE''@|$(HAVE_GETPAGESIZE)|g' \ + -e 's|@''HAVE_GETUSERSHELL''@|$(HAVE_GETUSERSHELL)|g' \ -e 's|@''HAVE_READLINK''@|$(HAVE_READLINK)|g' \ -e 's|@''HAVE_SLEEP''@|$(HAVE_SLEEP)|g' \ -e 's|@''HAVE_DECL_ENVIRON''@|$(HAVE_DECL_ENVIRON)|g' \ diff --git a/src/gnulib/stdint.in.h b/src/gnulib/stdint.in.h index d0cbdac..84b9f4b 100644 --- a/src/gnulib/stdint.in.h +++ b/src/gnulib/stdint.in.h @@ -49,7 +49,9 @@ in would reinclude us, skipping our contents because _GL_STDINT_H is defined. The include_next requires a split double-inclusion guard. */ +# if __GNUC__ >= 3 @PRAGMA_SYSTEM_HEADER@ +# endif # @INCLUDE_NEXT@ @NEXT_STDINT_H@ #endif diff --git a/src/gnulib/unistd.in.h b/src/gnulib/unistd.in.h index f92f714..f0b9b3b 100644 --- a/src/gnulib/unistd.in.h +++ b/src/gnulib/unistd.in.h @@ -1,5 +1,5 @@ /* Substitute for and wrapper around . - Copyright (C) 2004-2008 Free Software Foundation, Inc. + Copyright (C) 2003-2008 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by @@ -17,7 +17,9 @@ #ifndef _GL_UNISTD_H +#if __GNUC__ >= 3 @PRAGMA_SYSTEM_HEADER@ +#endif /* The include_next requires a split double-inclusion guard. */ #if @HAVE_UNISTD_H@ @@ -40,6 +42,47 @@ # include #endif +#if @GNULIB_GETHOSTNAME@ +/* Get all possible declarations of gethostname(). */ +# if @UNISTD_H_HAVE_WINSOCK2_H@ +# include +# if !defined _GL_SYS_SOCKET_H +# undef socket +# define socket socket_used_without_including_sys_socket_h +# undef connect +# define connect connect_used_without_including_sys_socket_h +# undef accept +# define accept accept_used_without_including_sys_socket_h +# undef bind +# define bind bind_used_without_including_sys_socket_h +# undef getpeername +# define getpeername getpeername_used_without_including_sys_socket_h +# undef getsockname +# define getsockname getsockname_used_without_including_sys_socket_h +# undef getsockopt +# define getsockopt getsockopt_used_without_including_sys_socket_h +# undef listen +# define listen listen_used_without_including_sys_socket_h +# undef recv +# define recv recv_used_without_including_sys_socket_h +# undef send +# define send send_used_without_including_sys_socket_h +# undef recvfrom +# define recvfrom recvfrom_used_without_including_sys_socket_h +# undef sendto +# define sendto sendto_used_without_including_sys_socket_h +# undef setsockopt +# define setsockopt setsockopt_used_without_including_sys_socket_h +# undef shutdown +# define shutdown shutdown_used_without_including_sys_socket_h +# endif +# if !defined _GL_SYS_SELECT_H +# undef select +# define select select_used_without_including_sys_select_h +# endif +# endif +#endif + /* The definition of GL_LINK_WARNING is copied here. */ @@ -76,6 +119,10 @@ extern int chown (const char *file, uid_t uid, gid_t gid); #if @GNULIB_CLOSE@ +# if @UNISTD_H_HAVE_WINSOCK2_H@ +/* Need a gnulib internal function. */ +# define HAVE__GL_CLOSE_FD_MAYBE_SOCKET 1 +# endif # if @REPLACE_CLOSE@ /* Automatically included by modules that need a replacement for close. */ # undef close @@ -132,6 +179,21 @@ extern char **environ; #endif +#if @GNULIB_EUIDACCESS@ +# if !@HAVE_EUIDACCESS@ +/* Like access(), except that is uses the effective user id and group id of + the current process. */ +extern int euidaccess (const char *filename, int mode); +# endif +#elif defined GNULIB_POSIXCHECK +# undef euidaccess +# define euidaccess(f,m) \ + (GL_LINK_WARNING ("euidaccess is unportable - " \ + "use gnulib module euidaccess for portability"), \ + euidaccess (f, m)) +#endif + + #if @GNULIB_FCHDIR@ # if @REPLACE_FCHDIR@ @@ -218,6 +280,29 @@ extern char * getcwd (char *buf, size_t size); #endif +#if @GNULIB_GETDOMAINNAME@ +/* Return the NIS domain name of the machine. + WARNING! The NIS domain name is unrelated to the fully qualified host name + of the machine. It is also unrelated to email addresses. + WARNING! The NIS domain name is usually the empty string or "(none)" when + not using NIS. + + Put up to LEN bytes of the NIS domain name into NAME. + Null terminate it if the name is shorter than LEN. + If the NIS domain name is longer than LEN, set errno = EINVAL and return -1. + Return 0 if successful, otherwise set errno and return -1. */ +# if !@HAVE_GETDOMAINNAME@ +extern int getdomainname(char *name, size_t len); +# endif +#elif defined GNULIB_POSIXCHECK +# undef getdomainname +# define getdomainname(n,l) \ + (GL_LINK_WARNING ("getdomainname is unportable - " \ + "use gnulib module getdomainname for portability"), \ + getdomainname (n, l)) +#endif + + #if @GNULIB_GETDTABLESIZE@ # if !@HAVE_GETDTABLESIZE@ /* Return the maximum number of file descriptors in the current process. */ @@ -232,6 +317,33 @@ extern int getdtablesize (void); #endif +#if @GNULIB_GETHOSTNAME@ +/* Return the standard host name of the machine. + WARNING! The host name may or may not be fully qualified. + + Put up to LEN bytes of the host name into NAME. + Null terminate it if the name is shorter than LEN. + If the host name is longer than LEN, set errno = EINVAL and return -1. + Return 0 if successful, otherwise set errno and return -1. */ +# if @UNISTD_H_HAVE_WINSOCK2_H@ +# undef gethostname +# define gethostname rpl_gethostname +# endif +# if @UNISTD_H_HAVE_WINSOCK2_H@ || !@HAVE_GETHOSTNAME@ +extern int gethostname(char *name, size_t len); +# endif +#elif @UNISTD_H_HAVE_WINSOCK2_H@ +# undef gethostname +# define gethostname gethostname_used_without_requesting_gnulib_module_gethostname +#elif defined GNULIB_POSIXCHECK +# undef gethostname +# define gethostname(n,l) \ + (GL_LINK_WARNING ("gethostname is unportable - " \ + "use gnulib module gethostname for portability"), \ + gethostname (n, l)) +#endif + + #if @GNULIB_GETLOGIN_R@ /* Copies the user's login name to NAME. The array pointed to by NAME has room for SIZE bytes. @@ -313,6 +425,36 @@ extern int getpagesize (void); #endif +#if @GNULIB_GETUSERSHELL@ +# if !@HAVE_GETUSERSHELL@ +/* Return the next valid login shell on the system, or NULL when the end of + the list has been reached. */ +extern char *getusershell (void); +/* Rewind to pointer that is advanced at each getusershell() call. */ +extern void setusershell (void); +/* Free the pointer that is advanced at each getusershell() call and + associated resources. */ +extern void endusershell (void); +# endif +#elif defined GNULIB_POSIXCHECK +# undef getusershell +# define getusershell() \ + (GL_LINK_WARNING ("getusershell is unportable - " \ + "use gnulib module getusershell for portability"), \ + getusershell ()) +# undef setusershell +# define setusershell() \ + (GL_LINK_WARNING ("setusershell is unportable - " \ + "use gnulib module getusershell for portability"), \ + setusershell ()) +# undef endusershell +# define endusershell() \ + (GL_LINK_WARNING ("endusershell is unportable - " \ + "use gnulib module getusershell for portability"), \ + endusershell ()) +#endif + + #if @GNULIB_LCHOWN@ # if @REPLACE_LCHOWN@ /* Change the owner of FILE to UID (if UID is not -1) and the group of FILE diff --git a/src/gnulib/wchar.in.h b/src/gnulib/wchar.in.h index a9d412b..2ba2d84 100644 --- a/src/gnulib/wchar.in.h +++ b/src/gnulib/wchar.in.h @@ -26,7 +26,9 @@ * the declaration of wcwidth(). */ +#if __GNUC__ >= 3 @PRAGMA_SYSTEM_HEADER@ +#endif #ifdef __need_mbstate_t /* Special invocation convention inside uClibc header files. */ diff --git a/tools/autotools/m4/gnulib-common.m4 b/tools/autotools/m4/gnulib-common.m4 index 34d91c7..c73db14 100644 --- a/tools/autotools/m4/gnulib-common.m4 +++ b/tools/autotools/m4/gnulib-common.m4 @@ -1,4 +1,4 @@ -# gnulib-common.m4 serial 5 +# gnulib-common.m4 serial 6 dnl Copyright (C) 2007-2008 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -21,6 +21,16 @@ AC_DEFUN([gl_COMMON_BODY], [ #if defined __APPLE__ && defined __MACH__ && __APPLE_CC__ >= 5465 && !defined __cplusplus && __STDC_VERSION__ >= 199901L && !defined __GNUC_STDC_INLINE__ # define __GNUC_STDC_INLINE__ 1 #endif]) + AH_VERBATIM([unused_parameter], +[/* Define as a marker that can be attached to function parameter declarations + for parameters that are not used. This helps to reduce warnings, such as + from GCC -Wunused-parameter. */ +#if __GNUC__ >= 3 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7) +# define _UNUSED_PARAMETER_ __attribute__ ((__unused__)) +#else +# define _UNUSED_PARAMETER_ +#endif +]) ]) # gl_MODULE_INDICATOR([modulename]) diff --git a/tools/autotools/m4/include_next.m4 b/tools/autotools/m4/include_next.m4 index b6e4d3a..c70c413 100644 --- a/tools/autotools/m4/include_next.m4 +++ b/tools/autotools/m4/include_next.m4 @@ -1,4 +1,4 @@ -# include_next.m4 serial 8 +# include_next.m4 serial 9 dnl Copyright (C) 2006-2008 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -87,6 +87,7 @@ EOF AC_DEFUN([gl_CHECK_NEXT_HEADERS], [ AC_REQUIRE([gl_INCLUDE_NEXT]) + AC_REQUIRE([AC_CANONICAL_HOST]) AC_CHECK_HEADERS_ONCE([$1]) m4_foreach_w([gl_HEADER_NAME], [$1], @@ -105,11 +106,22 @@ AC_DEFUN([gl_CHECK_NEXT_HEADERS], [AC_LANG_SOURCE( [[#include <]]m4_dquote(m4_defn([gl_HEADER_NAME]))[[>]] )]) - dnl eval is necessary to expand ac_cpp. + dnl AIX "xlc -E" and "cc -E" omit #line directives for header files + dnl that contain only a #include of other header files and no + dnl non-comment tokens of their own. This leads to a failure to + dnl detect the absolute name of , , + dnl and others. The workaround is to force preservation of comments + dnl through option -C. This ensures all necessary #line directives + dnl are present. GCC supports option -C as well. + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + dnl eval is necessary to expand gl_absname_cpp. dnl Ultrix and Pyramid sh refuse to redirect output of eval, dnl so use subshell. AS_VAR_SET([gl_next_header], - ['"'`(eval "$ac_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD | + ['"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD | sed -n '\#/]m4_quote(m4_defn([gl_HEADER_NAME]))[#{ s#.*"\(.*/]m4_quote(m4_defn([gl_HEADER_NAME]))[\)".*#\1# s#^/[^/]#//&# diff --git a/tools/autotools/m4/unistd_h.m4 b/tools/autotools/m4/unistd_h.m4 index e9f7a7d..5685273 100644 --- a/tools/autotools/m4/unistd_h.m4 +++ b/tools/autotools/m4/unistd_h.m4 @@ -1,4 +1,4 @@ -# unistd_h.m4 serial 14 +# unistd_h.m4 serial 16 dnl Copyright (C) 2006-2008 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -36,13 +36,17 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS], GNULIB_CLOSE=0; AC_SUBST([GNULIB_CLOSE]) GNULIB_DUP2=0; AC_SUBST([GNULIB_DUP2]) GNULIB_ENVIRON=0; AC_SUBST([GNULIB_ENVIRON]) + GNULIB_EUIDACCESS=0; AC_SUBST([GNULIB_EUIDACCESS]) GNULIB_FCHDIR=0; AC_SUBST([GNULIB_FCHDIR]) GNULIB_FSYNC=0; AC_SUBST([GNULIB_FSYNC]) GNULIB_FTRUNCATE=0; AC_SUBST([GNULIB_FTRUNCATE]) GNULIB_GETCWD=0; AC_SUBST([GNULIB_GETCWD]) + GNULIB_GETDOMAINNAME=0; AC_SUBST([GNULIB_GETDOMAINNAME]) GNULIB_GETDTABLESIZE=0; AC_SUBST([GNULIB_GETDTABLESIZE]) + GNULIB_GETHOSTNAME=0; AC_SUBST([GNULIB_GETHOSTNAME]) GNULIB_GETLOGIN_R=0; AC_SUBST([GNULIB_GETLOGIN_R]) GNULIB_GETPAGESIZE=0; AC_SUBST([GNULIB_GETPAGESIZE]) + GNULIB_GETUSERSHELL=0; AC_SUBST([GNULIB_GETUSERSHELL]) GNULIB_LCHOWN=0; AC_SUBST([GNULIB_LCHOWN]) GNULIB_LSEEK=0; AC_SUBST([GNULIB_LSEEK]) GNULIB_READLINK=0; AC_SUBST([GNULIB_READLINK]) @@ -51,10 +55,14 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS], GNULIB_WRITE=0; AC_SUBST([GNULIB_WRITE]) dnl Assume proper GNU behavior unless another module says otherwise. HAVE_DUP2=1; AC_SUBST([HAVE_DUP2]) + HAVE_EUIDACCESS=1; AC_SUBST([HAVE_EUIDACCESS]) HAVE_FSYNC=1; AC_SUBST([HAVE_FSYNC]) HAVE_FTRUNCATE=1; AC_SUBST([HAVE_FTRUNCATE]) + HAVE_GETDOMAINNAME=1; AC_SUBST([HAVE_GETDOMAINNAME]) HAVE_GETDTABLESIZE=1; AC_SUBST([HAVE_GETDTABLESIZE]) + HAVE_GETHOSTNAME=1; AC_SUBST([HAVE_GETHOSTNAME]) HAVE_GETPAGESIZE=1; AC_SUBST([HAVE_GETPAGESIZE]) + HAVE_GETUSERSHELL=1; AC_SUBST([HAVE_GETUSERSHELL]) HAVE_READLINK=1; AC_SUBST([HAVE_READLINK]) HAVE_SLEEP=1; AC_SUBST([HAVE_SLEEP]) HAVE_DECL_ENVIRON=1; AC_SUBST([HAVE_DECL_ENVIRON]) -- 2.11.4.GIT