diff options
author | Simon Josefsson <simon@josefsson.org> | 2009-01-21 22:21:49 +0100 |
---|---|---|
committer | Simon Josefsson <simon@josefsson.org> | 2009-01-21 22:21:49 +0100 |
commit | 8a87bbc9984034fc736e54ef18f7b0006eee22ec (patch) | |
tree | 7f3e00086e922cf38acd60bde1843f1f75528e05 | |
parent | 0541e15f9302eeb2d45aff73db03a4c6d82cb717 (diff) | |
download | gnutls-8a87bbc9984034fc736e54ef18f7b0006eee22ec.tar.gz |
Update gnulib files.
92 files changed, 789 insertions, 460 deletions
diff --git a/gl/Makefile.am b/gl/Makefile.am index 85ab1c2ed6..210b381e2a 100644 --- a/gl/Makefile.am +++ b/gl/Makefile.am @@ -623,6 +623,8 @@ stdio.h: stdio.in.h -e 's|@''GNULIB_VPRINTF_POSIX''@|$(GNULIB_VPRINTF_POSIX)|g' \ -e 's|@''GNULIB_VSNPRINTF''@|$(GNULIB_VSNPRINTF)|g' \ -e 's|@''GNULIB_VSPRINTF_POSIX''@|$(GNULIB_VSPRINTF_POSIX)|g' \ + -e 's|@''GNULIB_DPRINTF''@|$(GNULIB_DPRINTF)|g' \ + -e 's|@''GNULIB_VDPRINTF''@|$(GNULIB_VDPRINTF)|g' \ -e 's|@''GNULIB_VASPRINTF''@|$(GNULIB_VASPRINTF)|g' \ -e 's|@''GNULIB_OBSTACK_PRINTF''@|$(GNULIB_OBSTACK_PRINTF)|g' \ -e 's|@''GNULIB_OBSTACK_PRINTF_POSIX''@|$(GNULIB_OBSTACK_PRINTF_POSIX)|g' \ @@ -655,6 +657,10 @@ stdio.h: stdio.in.h -e 's|@''HAVE_DECL_VSNPRINTF''@|$(HAVE_DECL_VSNPRINTF)|g' \ -e 's|@''REPLACE_SPRINTF''@|$(REPLACE_SPRINTF)|g' \ -e 's|@''REPLACE_VSPRINTF''@|$(REPLACE_VSPRINTF)|g' \ + -e 's|@''HAVE_DPRINTF''@|$(HAVE_DPRINTF)|g' \ + -e 's|@''REPLACE_DPRINTF''@|$(REPLACE_DPRINTF)|g' \ + -e 's|@''HAVE_VDPRINTF''@|$(HAVE_VDPRINTF)|g' \ + -e 's|@''REPLACE_VDPRINTF''@|$(REPLACE_VDPRINTF)|g' \ -e 's|@''HAVE_VASPRINTF''@|$(HAVE_VASPRINTF)|g' \ -e 's|@''REPLACE_VASPRINTF''@|$(REPLACE_VASPRINTF)|g' \ -e 's|@''HAVE_DECL_OBSTACK_PRINTF''@|$(HAVE_DECL_OBSTACK_PRINTF)|g' \ @@ -980,6 +986,7 @@ unistd.h: unistd.in.h -e 's|@''GNULIB_GETPAGESIZE''@|$(GNULIB_GETPAGESIZE)|g' \ -e 's|@''GNULIB_GETUSERSHELL''@|$(GNULIB_GETUSERSHELL)|g' \ -e 's|@''GNULIB_LCHOWN''@|$(GNULIB_LCHOWN)|g' \ + -e 's|@''GNULIB_LINK''@|$(GNULIB_LINK)|g' \ -e 's|@''GNULIB_LSEEK''@|$(GNULIB_LSEEK)|g' \ -e 's|@''GNULIB_READLINK''@|$(GNULIB_READLINK)|g' \ -e 's|@''GNULIB_SLEEP''@|$(GNULIB_SLEEP)|g' \ @@ -994,6 +1001,7 @@ unistd.h: unistd.in.h -e 's|@''HAVE_GETHOSTNAME''@|$(HAVE_GETHOSTNAME)|g' \ -e 's|@''HAVE_GETPAGESIZE''@|$(HAVE_GETPAGESIZE)|g' \ -e 's|@''HAVE_GETUSERSHELL''@|$(HAVE_GETUSERSHELL)|g' \ + -e 's|@''HAVE_LINK''@|$(HAVE_LINK)|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/gl/arpa_inet.in.h b/gl/arpa_inet.in.h index 4b95b944fc..ac93399143 100644 --- a/gl/arpa_inet.in.h +++ b/gl/arpa_inet.in.h @@ -38,6 +38,10 @@ /* The definition of GL_LINK_WARNING is copied here. */ +#ifdef __cplusplus +extern "C" { +#endif + #if @GNULIB_INET_NTOP@ # if !@HAVE_DECL_INET_NTOP@ /* Converts an internet address from internal format to a printable, @@ -78,5 +82,9 @@ extern int inet_pton (int af, const char *restrict src, void *restrict dst); inet_pton (af, src, dst)) #endif +#ifdef __cplusplus +} +#endif + #endif /* _GL_ARPA_INET_H */ #endif /* _GL_ARPA_INET_H */ diff --git a/gl/fseeko.c b/gl/fseeko.c index e0c5ae793d..e057508d49 100644 --- a/gl/fseeko.c +++ b/gl/fseeko.c @@ -1,5 +1,5 @@ /* An fseeko() function that, together with fflush(), is POSIX compliant. - Copyright (C) 2007-2008 Free Software Foundation, Inc. + Copyright (C) 2007-2009 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -86,7 +86,14 @@ rpl_fseeko (FILE *fp, off_t offset, int whence) #error "Please port gnulib fseeko.c to your platform! Look at the code in fpurge.c, then report this to bug-gnulib." #endif { - off_t pos = lseek (fileno (fp), offset, whence); + /* We get here when an fflush() call immediately preceded this one. We + know there are no buffers. + POSIX requires us to modify the file descriptor's position. + But we cannot position beyond end of file here. */ + off_t pos = + lseek (fileno (fp), + whence == SEEK_END && offset > 0 ? 0 : offset, + whence); if (pos == -1) { #if defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, MacOS X, Cygwin */ @@ -94,20 +101,22 @@ rpl_fseeko (FILE *fp, off_t offset, int whence) #endif return -1; } - else - { -#if defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, MacOS X, Cygwin */ - fp_->_offset = pos; - fp_->_flags |= __SOFF; - fp_->_flags &= ~__SEOF; + +#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ + fp->_flags &= ~_IO_EOF_SEEN; +#elif defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, MacOS X, Cygwin */ + fp_->_offset = pos; + fp_->_flags |= __SOFF; + fp_->_flags &= ~__SEOF; #elif defined __EMX__ /* emx+gcc */ - fp->_flags &= ~_IOEOF; + fp->_flags &= ~_IOEOF; #elif defined _IOERR /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw */ - fp->_flag &= ~_IOEOF; + fp->_flag &= ~_IOEOF; #endif - return 0; - } + /* If we were not requested to position beyond end of file, we're + done. */ + if (!(whence == SEEK_END && offset > 0)) + return 0; } - else - return fseeko (fp, offset, whence); + return fseeko (fp, offset, whence); } diff --git a/gl/m4/alloca.m4 b/gl/m4/alloca.m4 index 95f54a6d48..4b978e137c 100644 --- a/gl/m4/alloca.m4 +++ b/gl/m4/alloca.m4 @@ -1,5 +1,5 @@ -# alloca.m4 serial 8 -dnl Copyright (C) 2002-2004, 2006, 2007 Free Software Foundation, Inc. +# alloca.m4 serial 9 +dnl Copyright (C) 2002-2004, 2006, 2007, 2009 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -26,7 +26,7 @@ AC_DEFUN([gl_FUNC_ALLOCA], ]) if test $gl_cv_rpl_alloca = yes; then dnl OK, alloca can be implemented through a compiler built-in. - AC_DEFINE([HAVE_ALLOCA], 1, + AC_DEFINE([HAVE_ALLOCA], [1], [Define to 1 if you have 'alloca' after including <alloca.h>, a header that may be supplied by this distribution.]) ALLOCA_H=alloca.h diff --git a/gl/m4/errno_h.m4 b/gl/m4/errno_h.m4 index 22c08f07fa..0682d1ab63 100644 --- a/gl/m4/errno_h.m4 +++ b/gl/m4/errno_h.m4 @@ -1,5 +1,5 @@ -# errno_h.m4 serial 2 -dnl Copyright (C) 2004, 2006, 2008 Free Software Foundation, Inc. +# errno_h.m4 serial 3 +dnl Copyright (C) 2004, 2006, 2008, 2009 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -14,8 +14,8 @@ AC_DEFUN([gl_HEADER_ERRNO_H], AC_DEFUN([gl_HEADER_ERRNO_H_BODY], [ AC_REQUIRE([AC_PROG_CC]) - AC_CACHE_CHECK([for complete errno.h], gl_cv_header_errno_h_complete, [ - AC_EGREP_CPP(booboo,[ + AC_CACHE_CHECK([for complete errno.h], [gl_cv_header_errno_h_complete], [ + AC_EGREP_CPP([booboo],[ #include <errno.h> #if !defined ENOMSG booboo @@ -70,7 +70,7 @@ AC_DEFUN([gl_REPLACE_ERRNO_VALUE], [ if test -n "$ERRNO_H"; then AC_CACHE_CHECK([for ]$1[ value], [gl_cv_header_errno_h_]$1, [ - AC_EGREP_CPP(yes,[ + AC_EGREP_CPP([yes],[ #include <errno.h> #ifdef ]$1[ yes @@ -79,7 +79,7 @@ yes [gl_cv_header_errno_h_]$1[=yes], [gl_cv_header_errno_h_]$1[=no]) if test $gl_cv_header_errno_h_]$1[ = no; then - AC_EGREP_CPP(yes,[ + AC_EGREP_CPP([yes],[ #define _XOPEN_SOURCE_EXTENDED 1 #include <errno.h> #ifdef ]$1[ diff --git a/gl/m4/getaddrinfo.m4 b/gl/m4/getaddrinfo.m4 index 9655a4289b..4088671987 100644 --- a/gl/m4/getaddrinfo.m4 +++ b/gl/m4/getaddrinfo.m4 @@ -1,5 +1,5 @@ -# getaddrinfo.m4 serial 19 -dnl Copyright (C) 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# getaddrinfo.m4 serial 20 +dnl Copyright (C) 2004-2009 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -18,7 +18,7 @@ AC_DEFUN([gl_GETADDRINFO], dnl - On BeOS, it is in libnet. dnl - On native Windows, it is in ws2_32.dll. dnl - Otherwise it is in libc. - AC_SEARCH_LIBS(getaddrinfo, [socket network net], + AC_SEARCH_LIBS([getaddrinfo], [socket network net], [if test "$ac_cv_search_getaddrinfo" != "none required"; then GETADDRINFO_LIB="$ac_cv_search_getaddrinfo" fi]) @@ -38,7 +38,7 @@ AC_DEFUN([gl_GETADDRINFO], [gl_cv_func_getaddrinfo=yes], [gl_cv_func_getaddrinfo=no])]) if test $gl_cv_func_getaddrinfo = no; then - AC_CACHE_CHECK(for getaddrinfo in ws2tcpip.h and -lws2_32, + AC_CACHE_CHECK([for getaddrinfo in ws2tcpip.h and -lws2_32], gl_cv_w32_getaddrinfo, [ gl_cv_w32_getaddrinfo=no am_save_LIBS="$LIBS" @@ -55,7 +55,7 @@ AC_DEFUN([gl_GETADDRINFO], GETADDRINFO_LIB="-lws2_32" LIBS="$gai_saved_LIBS $GETADDRINFO_LIB" else - AC_LIBOBJ(getaddrinfo) + AC_LIBOBJ([getaddrinfo]) fi fi @@ -80,7 +80,7 @@ AC_DEFUN([gl_GETADDRINFO], [gl_cv_func_gai_strerror=yes], [gl_cv_func_gai_strerror=no])]) if test $gl_cv_func_gai_strerror = no; then - AC_LIBOBJ(gai_strerror) + AC_LIBOBJ([gai_strerror]) fi LIBS="$gai_saved_LIBS" @@ -106,7 +106,7 @@ AC_DEFUN([gl_PREREQ_GETADDRINFO], [ dnl have sa_len so the result is correct anyway. AC_CHECK_MEMBERS([struct sockaddr.sa_len], , , [#include <sys/socket.h>]) - AC_CHECK_HEADERS_ONCE(netinet/in.h) + AC_CHECK_HEADERS_ONCE([netinet/in.h]) AC_CHECK_DECLS([getaddrinfo, freeaddrinfo, gai_strerror, getnameinfo],,,[ /* sys/types.h is not needed according to POSIX, but the diff --git a/gl/m4/getline.m4 b/gl/m4/getline.m4 index 57625da5c9..99933455f0 100644 --- a/gl/m4/getline.m4 +++ b/gl/m4/getline.m4 @@ -1,7 +1,6 @@ -# getline.m4 serial 18 +# getline.m4 serial 19 -dnl Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2006, 2007 Free -dnl Software Foundation, Inc. +dnl Copyright (C) 1998-2003, 2005-2007, 2009 Free Software Foundation, Inc. dnl dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -10,7 +9,7 @@ dnl with or without modifications, as long as this notice is preserved. AC_PREREQ([2.59]) dnl See if there's a working, system-supplied version of the getline function. -dnl We can't just do AC_REPLACE_FUNCS(getline) because some systems +dnl We can't just do AC_REPLACE_FUNCS([getline]) because some systems dnl have a function by that name in -linet that doesn't have anything dnl to do with the function we need. AC_DEFUN([gl_FUNC_GETLINE], @@ -23,12 +22,12 @@ AC_DEFUN([gl_FUNC_GETLINE], AC_CHECK_DECLS_ONCE([getline]) gl_getline_needs_run_time_check=no - AC_CHECK_FUNC(getline, + AC_CHECK_FUNC([getline], dnl Found it in some library. Verify that it works. gl_getline_needs_run_time_check=yes, am_cv_func_working_getline=no) if test $gl_getline_needs_run_time_check = yes; then - AC_CACHE_CHECK([for working getline function], am_cv_func_working_getline, + AC_CACHE_CHECK([for working getline function], [am_cv_func_working_getline], [echo fooN |tr -d '\012'|tr N '\012' > conftest.data AC_TRY_RUN([ # include <stdio.h> diff --git a/gl/m4/getpass.m4 b/gl/m4/getpass.m4 index 54348ce7c7..3b55ee48ec 100644 --- a/gl/m4/getpass.m4 +++ b/gl/m4/getpass.m4 @@ -1,5 +1,5 @@ -# getpass.m4 serial 10 -dnl Copyright (C) 2002-2003, 2005-2006 Free Software Foundation, Inc. +# getpass.m4 serial 11 +dnl Copyright (C) 2002-2003, 2005-2006, 2009 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -7,8 +7,8 @@ dnl with or without modifications, as long as this notice is preserved. # Provide a getpass() function if the system doesn't have it. AC_DEFUN([gl_FUNC_GETPASS], [ - AC_REPLACE_FUNCS(getpass) - AC_CHECK_DECLS_ONCE(getpass) + AC_REPLACE_FUNCS([getpass]) + AC_CHECK_DECLS_ONCE([getpass]) if test $ac_cv_func_getpass = no; then gl_PREREQ_GETPASS fi @@ -18,9 +18,9 @@ AC_DEFUN([gl_FUNC_GETPASS], # arbitrary length (not just 8 bytes as on HP-UX). AC_DEFUN([gl_FUNC_GETPASS_GNU], [ - AC_CHECK_DECLS_ONCE(getpass) + AC_CHECK_DECLS_ONCE([getpass]) dnl TODO: Detect when GNU getpass() is already found in glibc. - AC_LIBOBJ(getpass) + AC_LIBOBJ([getpass]) gl_PREREQ_GETPASS dnl We must choose a different name for our function, since on ELF systems dnl an unusable getpass() in libc.so would override our getpass() if it is @@ -31,8 +31,8 @@ AC_DEFUN([gl_FUNC_GETPASS_GNU], # Prerequisites of lib/getpass.c. AC_DEFUN([gl_PREREQ_GETPASS], [ - AC_CHECK_HEADERS_ONCE(stdio_ext.h termios.h) - AC_CHECK_FUNCS_ONCE(__fsetlocking tcgetattr tcsetattr) + AC_CHECK_HEADERS_ONCE([stdio_ext.h termios.h]) + AC_CHECK_FUNCS_ONCE([__fsetlocking tcgetattr tcsetattr]) AC_CHECK_DECLS([__fsetlocking],,, [#include <stdio.h> #if HAVE_STDIO_EXT_H diff --git a/gl/m4/gettimeofday.m4 b/gl/m4/gettimeofday.m4 index b9bbb1081b..0fec7d42b7 100644 --- a/gl/m4/gettimeofday.m4 +++ b/gl/m4/gettimeofday.m4 @@ -1,6 +1,6 @@ -#serial 11 +# serial 12 -# Copyright (C) 2001, 2002, 2003, 2005, 2007 Free Software Foundation, Inc. +# Copyright (C) 2001-2003, 2005, 2007, 2009 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -34,7 +34,7 @@ AC_DEFUN([gl_FUNC_GETTIMEOFDAY], REPLACE_GETTIMEOFDAY=1 SYS_TIME_H=sys/time.h if test $gl_cv_func_gettimeofday_clobber != yes; then - AC_LIBOBJ(gettimeofday) + AC_LIBOBJ([gettimeofday]) gl_PREREQ_GETTIMEOFDAY fi fi @@ -80,13 +80,13 @@ AC_DEFUN([gl_FUNC_GETTIMEOFDAY_CLOBBER], REPLACE_GETTIMEOFDAY=1 SYS_TIME_H=sys/time.h gl_GETTIMEOFDAY_REPLACE_LOCALTIME - AC_DEFINE([GETTIMEOFDAY_CLOBBERS_LOCALTIME], 1, + AC_DEFINE([GETTIMEOFDAY_CLOBBERS_LOCALTIME], [1], [Define if gettimeofday clobbers the localtime buffer.]) fi ]) AC_DEFUN([gl_GETTIMEOFDAY_REPLACE_LOCALTIME], [ - AC_LIBOBJ(gettimeofday) + AC_LIBOBJ([gettimeofday]) gl_PREREQ_GETTIMEOFDAY AC_DEFINE([gmtime], [rpl_gmtime], [Define to rpl_gmtime if the replacement function should be used.]) diff --git a/gl/m4/gnulib-common.m4 b/gl/m4/gnulib-common.m4 index c73db14cc5..cfd1b99f82 100644 --- a/gl/m4/gnulib-common.m4 +++ b/gl/m4/gnulib-common.m4 @@ -1,5 +1,5 @@ -# gnulib-common.m4 serial 6 -dnl Copyright (C) 2007-2008 Free Software Foundation, Inc. +# gnulib-common.m4 serial 8 +dnl Copyright (C) 2007-2009 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -63,7 +63,7 @@ m4_ifdef([AC_PROG_MKDIR_P], [], [ # works. # This definition can be removed once autoconf >= 2.62 can be assumed. AC_DEFUN([AC_C_RESTRICT], -[AC_CACHE_CHECK([for C/C++ restrict keyword], ac_cv_c_restrict, +[AC_CACHE_CHECK([for C/C++ restrict keyword], [ac_cv_c_restrict], [ac_cv_c_restrict=no # The order here caters to the fact that C++ does not require restrict. for ac_kw in __restrict __restrict__ _Restrict restrict; do @@ -99,3 +99,12 @@ AC_DEFUN([AC_C_RESTRICT], *) AC_DEFINE_UNQUOTED([restrict], [$ac_cv_c_restrict]) ;; esac ]) + +# gl_BIGENDIAN +# is like AC_C_BIGENDIAN, except that it can be AC_REQUIREd. +# Note that AC_REQUIRE([AC_C_BIGENDIAN]) does not work reliably because some +# macros invoke AC_C_BIGENDIAN with arguments. +AC_DEFUN([gl_BIGENDIAN], +[ + AC_C_BIGENDIAN +]) diff --git a/gl/m4/inet_ntop.m4 b/gl/m4/inet_ntop.m4 index 6f873063b9..42bfc5e417 100644 --- a/gl/m4/inet_ntop.m4 +++ b/gl/m4/inet_ntop.m4 @@ -1,5 +1,5 @@ -# inet_ntop.m4 serial 7 -dnl Copyright (C) 2005, 2006, 2008 Free Software Foundation, Inc. +# inet_ntop.m4 serial 8 +dnl Copyright (C) 2005, 2006, 2008, 2009 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -11,7 +11,7 @@ AC_DEFUN([gl_INET_NTOP], gl_REPLACE_ARPA_INET_H - AC_REPLACE_FUNCS(inet_ntop) + AC_REPLACE_FUNCS([inet_ntop]) gl_PREREQ_INET_NTOP ]) diff --git a/gl/m4/inet_pton.m4 b/gl/m4/inet_pton.m4 index 06331e9dec..e0ec432bc6 100644 --- a/gl/m4/inet_pton.m4 +++ b/gl/m4/inet_pton.m4 @@ -1,5 +1,5 @@ -# inet_pton.m4 serial 6 -dnl Copyright (C) 2006, 2008 Free Software Foundation, Inc. +# inet_pton.m4 serial 7 +dnl Copyright (C) 2006, 2008, 2009 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -11,7 +11,7 @@ AC_DEFUN([gl_INET_PTON], gl_REPLACE_ARPA_INET_H - AC_REPLACE_FUNCS(inet_pton) + AC_REPLACE_FUNCS([inet_pton]) gl_PREREQ_INET_PTON ]) diff --git a/gl/m4/intmax_t.m4 b/gl/m4/intmax_t.m4 index 50ae35d223..264cb57184 100644 --- a/gl/m4/intmax_t.m4 +++ b/gl/m4/intmax_t.m4 @@ -1,12 +1,12 @@ -# intmax_t.m4 serial 6 -dnl Copyright (C) 1997-2004, 2006-2007 Free Software Foundation, Inc. +# intmax_t.m4 serial 7 +dnl Copyright (C) 1997-2004, 2006-2007, 2009 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Paul Eggert. -AC_PREREQ(2.13) +AC_PREREQ([2.13]) # Define intmax_t to 'long' or 'long long' # if it is not already defined in <stdint.h> or <inttypes.h>. @@ -22,10 +22,10 @@ AC_DEFUN([gl_AC_TYPE_INTMAX_T], test $ac_cv_type_long_long_int = yes \ && ac_type='long long' \ || ac_type='long' - AC_DEFINE_UNQUOTED(intmax_t, $ac_type, + AC_DEFINE_UNQUOTED([intmax_t], [$ac_type], [Define to long or long long if <inttypes.h> and <stdint.h> don't define.]) else - AC_DEFINE(HAVE_INTMAX_T, 1, + AC_DEFINE([HAVE_INTMAX_T], [1], [Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>.]) fi ]) @@ -36,7 +36,7 @@ AC_DEFUN([gt_AC_TYPE_INTMAX_T], [ AC_REQUIRE([gl_AC_HEADER_INTTYPES_H]) AC_REQUIRE([gl_AC_HEADER_STDINT_H]) - AC_CACHE_CHECK(for intmax_t, gt_cv_c_intmax_t, + AC_CACHE_CHECK([for intmax_t], [gt_cv_c_intmax_t], [AC_TRY_COMPILE([ #include <stddef.h> #include <stdlib.h> @@ -48,14 +48,14 @@ AC_DEFUN([gt_AC_TYPE_INTMAX_T], #endif ], [intmax_t x = -1; return !x;], gt_cv_c_intmax_t=yes, gt_cv_c_intmax_t=no)]) if test $gt_cv_c_intmax_t = yes; then - AC_DEFINE(HAVE_INTMAX_T, 1, + AC_DEFINE([HAVE_INTMAX_T], [1], [Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>.]) else AC_REQUIRE([AC_TYPE_LONG_LONG_INT]) test $ac_cv_type_long_long_int = yes \ && ac_type='long long' \ || ac_type='long' - AC_DEFINE_UNQUOTED(intmax_t, $ac_type, + AC_DEFINE_UNQUOTED([intmax_t], [$ac_type], [Define to long or long long if <stdint.h> and <inttypes.h> don't define.]) fi ]) diff --git a/gl/m4/inttypes_h.m4 b/gl/m4/inttypes_h.m4 index cf482d2875..f4ca16021c 100644 --- a/gl/m4/inttypes_h.m4 +++ b/gl/m4/inttypes_h.m4 @@ -1,5 +1,5 @@ -# inttypes_h.m4 serial 8 -dnl Copyright (C) 1997-2004, 2006, 2008 Free Software Foundation, Inc. +# inttypes_h.m4 serial 9 +dnl Copyright (C) 1997-2004, 2006, 2008, 2009 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -19,7 +19,7 @@ AC_DEFUN([gl_AC_HEADER_INTTYPES_H], [gl_cv_header_inttypes_h=yes], [gl_cv_header_inttypes_h=no])]) if test $gl_cv_header_inttypes_h = yes; then - AC_DEFINE_UNQUOTED([HAVE_INTTYPES_H_WITH_UINTMAX], 1, + AC_DEFINE_UNQUOTED([HAVE_INTTYPES_H_WITH_UINTMAX], [1], [Define if <inttypes.h> exists, doesn't clash with <sys/types.h>, and declares uintmax_t. ]) fi diff --git a/gl/m4/lib-ld.m4 b/gl/m4/lib-ld.m4 index 96c4e2c339..e4863f2c9b 100644 --- a/gl/m4/lib-ld.m4 +++ b/gl/m4/lib-ld.m4 @@ -1,5 +1,5 @@ -# lib-ld.m4 serial 3 (gettext-0.13) -dnl Copyright (C) 1996-2003 Free Software Foundation, Inc. +# lib-ld.m4 serial 4 (gettext-0.18) +dnl Copyright (C) 1996-2003, 2009 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -10,7 +10,7 @@ dnl with libtool.m4. dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no. AC_DEFUN([AC_LIB_PROG_LD_GNU], -[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld, +[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], [acl_cv_prog_gnu_ld], [# I'd rather use --version here, but apparently some GNU ld's only accept -v. case `$LD -v 2>&1 </dev/null` in *GNU* | *'with BFD'*) @@ -23,7 +23,7 @@ with_gnu_ld=$acl_cv_prog_gnu_ld dnl From libtool-1.4. Sets the variable LD. AC_DEFUN([AC_LIB_PROG_LD], -[AC_ARG_WITH(gnu-ld, +[AC_ARG_WITH([gnu-ld], [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]], test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no) AC_REQUIRE([AC_PROG_CC])dnl @@ -77,7 +77,7 @@ elif test "$with_gnu_ld" = yes; then else AC_MSG_CHECKING([for non-GNU ld]) fi -AC_CACHE_VAL(acl_cv_path_LD, +AC_CACHE_VAL([acl_cv_path_LD], [if test -z "$LD"; then IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" for ac_dir in $PATH; do @@ -101,9 +101,9 @@ else fi]) LD="$acl_cv_path_LD" if test -n "$LD"; then - AC_MSG_RESULT($LD) + AC_MSG_RESULT([$LD]) else - AC_MSG_RESULT(no) + AC_MSG_RESULT([no]) fi test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) AC_LIB_PROG_LD_GNU diff --git a/gl/m4/lib-link.m4 b/gl/m4/lib-link.m4 index e29eead276..fcd3391bbc 100644 --- a/gl/m4/lib-link.m4 +++ b/gl/m4/lib-link.m4 @@ -1,12 +1,12 @@ -# lib-link.m4 serial 17 (gettext-0.18) -dnl Copyright (C) 2001-2008 Free Software Foundation, Inc. +# lib-link.m4 serial 18 (gettext-0.18) +dnl Copyright (C) 2001-2009 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. -AC_PREREQ(2.54) +AC_PREREQ([2.54]) dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and dnl the libraries corresponding to explicit and implicit dependencies. @@ -114,7 +114,7 @@ AC_DEFUN([AC_LIB_RPATH], AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir - AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [ + AC_CACHE_CHECK([for shared library run path origin], [acl_cv_rpath], [ CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh . ./conftest.sh @@ -131,7 +131,7 @@ AC_DEFUN([AC_LIB_RPATH], acl_hardcode_direct="$acl_cv_hardcode_direct" acl_hardcode_minus_L="$acl_cv_hardcode_minus_L" dnl Determine whether the user wants rpath handling at all. - AC_ARG_ENABLE(rpath, + AC_ARG_ENABLE([rpath], [ --disable-rpath do not hardcode runtime library paths], :, enable_rpath=yes) ]) diff --git a/gl/m4/longlong.m4 b/gl/m4/longlong.m4 index 15bf9dacad..eedc8d5682 100644 --- a/gl/m4/longlong.m4 +++ b/gl/m4/longlong.m4 @@ -1,5 +1,5 @@ -# longlong.m4 serial 13 -dnl Copyright (C) 1999-2007 Free Software Foundation, Inc. +# longlong.m4 serial 14 +dnl Copyright (C) 1999-2007, 2009 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -46,7 +46,7 @@ AC_DEFUN([AC_TYPE_LONG_LONG_INT], [ac_cv_type_long_long_int=yes])], [ac_cv_type_long_long_int=no])]) if test $ac_cv_type_long_long_int = yes; then - AC_DEFINE([HAVE_LONG_LONG_INT], 1, + AC_DEFINE([HAVE_LONG_LONG_INT], [1], [Define to 1 if the system has the type `long long int'.]) fi ]) @@ -69,7 +69,7 @@ AC_DEFUN([AC_TYPE_UNSIGNED_LONG_LONG_INT], [ac_cv_type_unsigned_long_long_int=yes], [ac_cv_type_unsigned_long_long_int=no])]) if test $ac_cv_type_unsigned_long_long_int = yes; then - AC_DEFINE([HAVE_UNSIGNED_LONG_LONG_INT], 1, + AC_DEFINE([HAVE_UNSIGNED_LONG_LONG_INT], [1], [Define to 1 if the system has the type `unsigned long long int'.]) fi ]) diff --git a/gl/m4/malloc.m4 b/gl/m4/malloc.m4 index 764f2a9fa1..807017166b 100644 --- a/gl/m4/malloc.m4 +++ b/gl/m4/malloc.m4 @@ -1,5 +1,5 @@ -# malloc.m4 serial 8 -dnl Copyright (C) 2007 Free Software Foundation, Inc. +# malloc.m4 serial 9 +dnl Copyright (C) 2007, 2009 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -13,7 +13,7 @@ AC_DEFUN([gl_FUNC_MALLOC_POSIX], AC_REQUIRE([gl_CHECK_MALLOC_POSIX]) if test $gl_cv_func_malloc_posix = yes; then HAVE_MALLOC_POSIX=1 - AC_DEFINE([HAVE_MALLOC_POSIX], 1, + AC_DEFINE([HAVE_MALLOC_POSIX], [1], [Define if the 'malloc' function is POSIX compliant.]) else AC_LIBOBJ([malloc]) diff --git a/gl/m4/minmax.m4 b/gl/m4/minmax.m4 index bbd1ba0b84..d2993fbaf7 100644 --- a/gl/m4/minmax.m4 +++ b/gl/m4/minmax.m4 @@ -1,10 +1,10 @@ -# minmax.m4 serial 2 -dnl Copyright (C) 2005 Free Software Foundation, Inc. +# minmax.m4 serial 3 +dnl Copyright (C) 2005, 2009 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. -AC_PREREQ(2.52) +AC_PREREQ([2.52]) AC_DEFUN([gl_MINMAX], [ diff --git a/gl/m4/printf.m4 b/gl/m4/printf.m4 index 474a635575..a1d4dadd7b 100644 --- a/gl/m4/printf.m4 +++ b/gl/m4/printf.m4 @@ -1,5 +1,5 @@ -# printf.m4 serial 25 -dnl Copyright (C) 2003, 2007-2008 Free Software Foundation, Inc. +# printf.m4 serial 28 +dnl Copyright (C) 2003, 2007-2009 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -225,12 +225,12 @@ AC_DEFUN([gl_PRINTF_INFINITE_LONG_DOUBLE], [ AC_REQUIRE([gl_PRINTF_LONG_DOUBLE]) AC_REQUIRE([AC_PROG_CC]) - AC_REQUIRE([AC_C_BIGENDIAN]) + AC_REQUIRE([gl_BIGENDIAN]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles dnl The user can set or unset the variable gl_printf_safe to indicate dnl that he wishes a safe handling of non-IEEE-754 'long double' values. if test -n "$gl_printf_safe"; then - AC_DEFINE([CHECK_PRINTF_SAFE], 1, + AC_DEFINE([CHECK_PRINTF_SAFE], [1], [Define if you wish *printf() functions that have a safe handling of non-IEEE-754 'long double' values.]) fi @@ -1142,7 +1142,7 @@ AC_DEFUN([gl_SNPRINTF_SIZE1], #include <stdio.h> int main() { - static char buf[8] = "DEADBEEF"; + static char buf[8] = { 'D', 'E', 'A', 'D', 'B', 'E', 'E', 'F' }; snprintf (buf, 1, "%d", 12345); return buf[1] != 'E'; }], @@ -1160,7 +1160,7 @@ dnl --------------------------------------------------------------------- dnl #include <stdio.h> dnl int main() dnl { -dnl static char buf[8] = "DEADBEEF"; +dnl static char buf[8] = { 'D', 'E', 'A', 'D', 'B', 'E', 'E', 'F' }; dnl snprintf (buf, 0, "%d", 12345); dnl return buf[0] != 'D'; dnl } @@ -1181,7 +1181,7 @@ dnl return ret; dnl } dnl int main() dnl { -dnl static char buf[8] = "DEADBEEF"; +dnl static char buf[8] = { 'D', 'E', 'A', 'D', 'B', 'E', 'E', 'F' }; dnl my_snprintf (buf, 0, "%d", 12345); dnl return buf[0] != 'D'; dnl } @@ -1209,7 +1209,7 @@ static int my_snprintf (char *buf, int size, const char *format, ...) } int main() { - static char buf[8] = "DEADBEEF"; + static char buf[8] = { 'D', 'E', 'A', 'D', 'B', 'E', 'E', 'F' }; my_snprintf (buf, 0, "%d", 12345); return buf[0] != 'D'; }], diff --git a/gl/m4/readline.m4 b/gl/m4/readline.m4 index 4c82a7fafe..60b0aa8fb0 100644 --- a/gl/m4/readline.m4 +++ b/gl/m4/readline.m4 @@ -1,5 +1,5 @@ -# readline.m4 serial 5 -dnl Copyright (C) 2005, 2006 Free Software Foundation, Inc. +# readline.m4 serial 6 +dnl Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -24,7 +24,7 @@ AC_DEFUN([gl_FUNC_READLINE], am_save_CPPFLAGS="$CPPFLAGS" AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCREADLINE]) - AC_CACHE_CHECK(for readline, gl_cv_lib_readline, [ + AC_CACHE_CHECK([for readline], [gl_cv_lib_readline], [ gl_cv_lib_readline=no am_save_LIBS="$LIBS" dnl On some systems, -lreadline doesn't link without an additional @@ -49,7 +49,7 @@ AC_DEFUN([gl_FUNC_READLINE], ]) if test "$gl_cv_lib_readline" != no; then - AC_DEFINE(HAVE_READLINE, 1, [Define if you have the readline library.]) + AC_DEFINE([HAVE_READLINE], [1], [Define if you have the readline library.]) if test "$gl_cv_lib_readline" != " -l"; then LIBREADLINE="$LIBREADLINE$gl_cv_lib_readline" LTLIBREADLINE="$LTLIBREADLINE$gl_cv_lib_readline" @@ -63,13 +63,13 @@ AC_DEFUN([gl_FUNC_READLINE], LIBREADLINE= LTLIBREADLINE= fi - AC_SUBST(LIBREADLINE) - AC_SUBST(LTLIBREADLINE) + AC_SUBST([LIBREADLINE]) + AC_SUBST([LTLIBREADLINE]) - AC_CHECK_HEADERS(readline/readline.h) + AC_CHECK_HEADERS([readline/readline.h]) if test $gl_cv_lib_readline = no; then - AC_LIBOBJ(readline) + AC_LIBOBJ([readline]) gl_PREREQ_READLINE fi ]) diff --git a/gl/m4/realloc.m4 b/gl/m4/realloc.m4 index f9fd935dbb..5925796864 100644 --- a/gl/m4/realloc.m4 +++ b/gl/m4/realloc.m4 @@ -1,5 +1,5 @@ -# realloc.m4 serial 8 -dnl Copyright (C) 2007 Free Software Foundation, Inc. +# realloc.m4 serial 9 +dnl Copyright (C) 2007, 2009 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -13,7 +13,7 @@ AC_DEFUN([gl_FUNC_REALLOC_POSIX], AC_REQUIRE([gl_CHECK_MALLOC_POSIX]) if test $gl_cv_func_malloc_posix = yes; then HAVE_REALLOC_POSIX=1 - AC_DEFINE([HAVE_REALLOC_POSIX], 1, + AC_DEFINE([HAVE_REALLOC_POSIX], [1], [Define if the 'realloc' function is POSIX compliant.]) else AC_LIBOBJ([realloc]) diff --git a/gl/m4/sockets.m4 b/gl/m4/sockets.m4 index 124e777a5e..d5a7dbfb4b 100644 --- a/gl/m4/sockets.m4 +++ b/gl/m4/sockets.m4 @@ -1,5 +1,5 @@ -# sockets.m4 serial 3 -dnl Copyright (C) 2008 Free Software Foundation, Inc. +# sockets.m4 serial 4 +dnl Copyright (C) 2008, 2009 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -26,7 +26,7 @@ AC_DEFUN([gl_SOCKETS], LIBS="$gl_save_LIBS" ]) if test "$gl_cv_func_wsastartup" = "yes"; then - AC_DEFINE([WINDOWS_SOCKETS], 1, [Define if WSAStartup is needed.]) + AC_DEFINE([WINDOWS_SOCKETS], [1], [Define if WSAStartup is needed.]) LIBSOCKET='-lws2_32' fi else diff --git a/gl/m4/sockpfaf.m4 b/gl/m4/sockpfaf.m4 index 25d9755c5e..99ea06f96f 100644 --- a/gl/m4/sockpfaf.m4 +++ b/gl/m4/sockpfaf.m4 @@ -1,5 +1,5 @@ -# sockpfaf.m4 serial 5 -dnl Copyright (C) 2004, 2006 Free Software Foundation, Inc. +# sockpfaf.m4 serial 6 +dnl Copyright (C) 2004, 2006, 2009 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -16,8 +16,8 @@ AC_DEFUN([gl_SOCKET_FAMILIES], AC_REQUIRE([gl_HEADER_SYS_SOCKET]) AC_CHECK_HEADERS_ONCE([netinet/in.h]) - AC_MSG_CHECKING(for IPv4 sockets) - AC_CACHE_VAL(gl_cv_socket_ipv4, + AC_MSG_CHECKING([for IPv4 sockets]) + AC_CACHE_VAL([gl_cv_socket_ipv4], [AC_TRY_COMPILE([#include <sys/types.h> #ifdef HAVE_SYS_SOCKET_H #include <sys/socket.h> @@ -31,13 +31,13 @@ AC_DEFUN([gl_SOCKET_FAMILIES], [int x = AF_INET; struct in_addr y; struct sockaddr_in z; if (&x && &y && &z) return 0;], gl_cv_socket_ipv4=yes, gl_cv_socket_ipv4=no)]) - AC_MSG_RESULT($gl_cv_socket_ipv4) + AC_MSG_RESULT([$gl_cv_socket_ipv4]) if test $gl_cv_socket_ipv4 = yes; then - AC_DEFINE(HAVE_IPV4, 1, [Define to 1 if <sys/socket.h> defines AF_INET.]) + AC_DEFINE([HAVE_IPV4], [1], [Define to 1 if <sys/socket.h> defines AF_INET.]) fi - AC_MSG_CHECKING(for IPv6 sockets) - AC_CACHE_VAL(gl_cv_socket_ipv6, + AC_MSG_CHECKING([for IPv6 sockets]) + AC_CACHE_VAL([gl_cv_socket_ipv6], [AC_TRY_COMPILE([#include <sys/types.h> #ifdef HAVE_SYS_SOCKET_H #include <sys/socket.h> @@ -51,8 +51,8 @@ AC_DEFUN([gl_SOCKET_FAMILIES], [int x = AF_INET6; struct in6_addr y; struct sockaddr_in6 z; if (&x && &y && &z) return 0;], gl_cv_socket_ipv6=yes, gl_cv_socket_ipv6=no)]) - AC_MSG_RESULT($gl_cv_socket_ipv6) + AC_MSG_RESULT([$gl_cv_socket_ipv6]) if test $gl_cv_socket_ipv6 = yes; then - AC_DEFINE(HAVE_IPV6, 1, [Define to 1 if <sys/socket.h> defines AF_INET6.]) + AC_DEFINE([HAVE_IPV6], [1], [Define to 1 if <sys/socket.h> defines AF_INET6.]) fi ]) diff --git a/gl/m4/stdbool.m4 b/gl/m4/stdbool.m4 index 2204ecd984..57c804a80f 100644 --- a/gl/m4/stdbool.m4 +++ b/gl/m4/stdbool.m4 @@ -1,6 +1,6 @@ # Check for stdbool.h that conforms to C99. -dnl Copyright (C) 2002-2006 Free Software Foundation, Inc. +dnl Copyright (C) 2002-2006, 2009 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -111,5 +111,5 @@ AC_DEFUN([AC_HEADER_STDBOOL], [ac_cv_header_stdbool_h=no])]) AC_CHECK_TYPES([_Bool]) if test $ac_cv_header_stdbool_h = yes; then - AC_DEFINE(HAVE_STDBOOL_H, 1, [Define to 1 if stdbool.h conforms to C99.]) + AC_DEFINE([HAVE_STDBOOL_H], [1], [Define to 1 if stdbool.h conforms to C99.]) fi]) diff --git a/gl/m4/stdint.m4 b/gl/m4/stdint.m4 index e507a02eb8..b4194c8adc 100644 --- a/gl/m4/stdint.m4 +++ b/gl/m4/stdint.m4 @@ -1,5 +1,5 @@ -# stdint.m4 serial 32 -dnl Copyright (C) 2001-2008 Free Software Foundation, Inc. +# stdint.m4 serial 33 +dnl Copyright (C) 2001-2009 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -9,7 +9,7 @@ dnl Test whether <stdint.h> is supported or must be substituted. AC_DEFUN([gl_STDINT_H], [ - AC_PREREQ(2.59)dnl + AC_PREREQ([2.59])dnl dnl Check for long long int and unsigned long long int. AC_REQUIRE([AC_TYPE_LONG_LONG_INT]) @@ -229,7 +229,7 @@ struct s { gl_STDINT_TYPE_PROPERTIES STDINT_H=stdint.h fi - AC_SUBST(STDINT_H) + AC_SUBST([STDINT_H]) ]) dnl gl_STDINT_BITSIZEOF(TYPES, INCLUDES) @@ -292,7 +292,7 @@ AC_DEFUN([gl_CHECK_TYPES_SIGNED], eval result=\$gl_cv_type_${gltype}_signed GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` if test "$result" = yes; then - AC_DEFINE_UNQUOTED([HAVE_SIGNED_${GLTYPE}], 1) + AC_DEFINE_UNQUOTED([HAVE_SIGNED_${GLTYPE}], [1]) eval HAVE_SIGNED_${GLTYPE}=1 else eval HAVE_SIGNED_${GLTYPE}=0 @@ -348,7 +348,7 @@ AC_DEFUN([gl_INTEGER_TYPE_SUFFIX], eval result=\$gl_cv_type_${gltype}_suffix test "$result" = no && result= eval ${GLTYPE}_SUFFIX=\$result - AC_DEFINE_UNQUOTED([${GLTYPE}_SUFFIX], $result) + AC_DEFINE_UNQUOTED([${GLTYPE}_SUFFIX], [$result]) done m4_foreach_w([gltype], [$1], [AC_SUBST(translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_])[_SUFFIX])]) diff --git a/gl/m4/stdint_h.m4 b/gl/m4/stdint_h.m4 index 2c8e649799..82f0c244c8 100644 --- a/gl/m4/stdint_h.m4 +++ b/gl/m4/stdint_h.m4 @@ -1,5 +1,5 @@ -# stdint_h.m4 serial 7 -dnl Copyright (C) 1997-2004, 2006, 2008 Free Software Foundation, Inc. +# stdint_h.m4 serial 8 +dnl Copyright (C) 1997-2004, 2006, 2008, 2009 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -19,7 +19,7 @@ AC_DEFUN([gl_AC_HEADER_STDINT_H], [gl_cv_header_stdint_h=yes], [gl_cv_header_stdint_h=no])]) if test $gl_cv_header_stdint_h = yes; then - AC_DEFINE_UNQUOTED([HAVE_STDINT_H_WITH_UINTMAX], 1, + AC_DEFINE_UNQUOTED([HAVE_STDINT_H_WITH_UINTMAX], [1], [Define if <stdint.h> exists, doesn't clash with <sys/types.h>, and declares uintmax_t. ]) fi diff --git a/gl/m4/stdio_h.m4 b/gl/m4/stdio_h.m4 index 60b4bd791a..846b65d302 100644 --- a/gl/m4/stdio_h.m4 +++ b/gl/m4/stdio_h.m4 @@ -1,5 +1,5 @@ -# stdio_h.m4 serial 14 -dnl Copyright (C) 2007-2008 Free Software Foundation, Inc. +# stdio_h.m4 serial 15 +dnl Copyright (C) 2007-2009 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -53,6 +53,8 @@ AC_DEFUN([gl_STDIO_H_DEFAULTS], GNULIB_VPRINTF_POSIX=0; AC_SUBST([GNULIB_VPRINTF_POSIX]) GNULIB_VSNPRINTF=0; AC_SUBST([GNULIB_VSNPRINTF]) GNULIB_VSPRINTF_POSIX=0; AC_SUBST([GNULIB_VSPRINTF_POSIX]) + GNULIB_DPRINTF=0; AC_SUBST([GNULIB_DPRINTF]) + GNULIB_VDPRINTF=0; AC_SUBST([GNULIB_VDPRINTF]) GNULIB_VASPRINTF=0; AC_SUBST([GNULIB_VASPRINTF]) GNULIB_OBSTACK_PRINTF=0; AC_SUBST([GNULIB_OBSTACK_PRINTF]) GNULIB_OBSTACK_PRINTF_POSIX=0; AC_SUBST([GNULIB_OBSTACK_PRINTF_POSIX]) @@ -86,6 +88,10 @@ AC_DEFUN([gl_STDIO_H_DEFAULTS], HAVE_DECL_VSNPRINTF=1; AC_SUBST([HAVE_DECL_VSNPRINTF]) REPLACE_SPRINTF=0; AC_SUBST([REPLACE_SPRINTF]) REPLACE_VSPRINTF=0; AC_SUBST([REPLACE_VSPRINTF]) + HAVE_DPRINTF=1; AC_SUBST([HAVE_DPRINTF]) + REPLACE_DPRINTF=0; AC_SUBST([REPLACE_DPRINTF]) + HAVE_VDPRINTF=1; AC_SUBST([HAVE_VDPRINTF]) + REPLACE_VDPRINTF=0; AC_SUBST([REPLACE_VDPRINTF]) HAVE_VASPRINTF=1; AC_SUBST([HAVE_VASPRINTF]) REPLACE_VASPRINTF=0; AC_SUBST([REPLACE_VASPRINTF]) HAVE_DECL_OBSTACK_PRINTF=1; AC_SUBST([HAVE_DECL_OBSTACK_PRINTF]) diff --git a/gl/m4/unistd_h.m4 b/gl/m4/unistd_h.m4 index 5685273656..ff9a4ea0a5 100644 --- a/gl/m4/unistd_h.m4 +++ b/gl/m4/unistd_h.m4 @@ -1,5 +1,5 @@ -# unistd_h.m4 serial 16 -dnl Copyright (C) 2006-2008 Free Software Foundation, Inc. +# unistd_h.m4 serial 17 +dnl Copyright (C) 2006-2009 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -48,6 +48,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS], GNULIB_GETPAGESIZE=0; AC_SUBST([GNULIB_GETPAGESIZE]) GNULIB_GETUSERSHELL=0; AC_SUBST([GNULIB_GETUSERSHELL]) GNULIB_LCHOWN=0; AC_SUBST([GNULIB_LCHOWN]) + GNULIB_LINK=0; AC_SUBST([GNULIB_LINK]) GNULIB_LSEEK=0; AC_SUBST([GNULIB_LSEEK]) GNULIB_READLINK=0; AC_SUBST([GNULIB_READLINK]) GNULIB_SLEEP=0; AC_SUBST([GNULIB_SLEEP]) @@ -63,6 +64,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS], HAVE_GETHOSTNAME=1; AC_SUBST([HAVE_GETHOSTNAME]) HAVE_GETPAGESIZE=1; AC_SUBST([HAVE_GETPAGESIZE]) HAVE_GETUSERSHELL=1; AC_SUBST([HAVE_GETUSERSHELL]) + HAVE_LINK=1; AC_SUBST([HAVE_LINK]) HAVE_READLINK=1; AC_SUBST([HAVE_READLINK]) HAVE_SLEEP=1; AC_SUBST([HAVE_SLEEP]) HAVE_DECL_ENVIRON=1; AC_SUBST([HAVE_DECL_ENVIRON]) diff --git a/gl/m4/vasnprintf.m4 b/gl/m4/vasnprintf.m4 index 536258c06b..9e839d2bc8 100644 --- a/gl/m4/vasnprintf.m4 +++ b/gl/m4/vasnprintf.m4 @@ -1,5 +1,5 @@ -# vasnprintf.m4 serial 25 -dnl Copyright (C) 2002-2004, 2006-2008 Free Software Foundation, Inc. +# vasnprintf.m4 serial 26 +dnl Copyright (C) 2002-2004, 2006-2009 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -20,7 +20,7 @@ AC_DEFUN([gl_REPLACE_VASNPRINTF], AC_LIBOBJ([printf-parse]) AC_LIBOBJ([asnprintf]) if test $ac_cv_func_vasnprintf = yes; then - AC_DEFINE([REPLACE_VASNPRINTF], 1, + AC_DEFINE([REPLACE_VASNPRINTF], [1], [Define if vasnprintf exists but is overridden by gnulib.]) fi gl_PREREQ_PRINTF_ARGS @@ -58,7 +58,7 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF], AC_REQUIRE([AC_TYPE_LONG_LONG_INT]) AC_REQUIRE([gt_TYPE_WCHAR_T]) AC_REQUIRE([gt_TYPE_WINT_T]) - AC_CHECK_FUNCS(snprintf wcslen) + AC_CHECK_FUNCS([snprintf wcslen]) dnl Use the _snprintf function only if it is declared (because on NetBSD it dnl is defined as a weak alias of snprintf; we prefer to use the latter). AC_CHECK_DECLS([_snprintf], , , [#include <stdio.h>]) @@ -73,7 +73,7 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF_LONG_DOUBLE], *yes) ;; *) - AC_DEFINE([NEED_PRINTF_LONG_DOUBLE], 1, + AC_DEFINE([NEED_PRINTF_LONG_DOUBLE], [1], [Define if the vasnprintf implementation needs special code for 'long double' arguments.]) ;; @@ -89,7 +89,7 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF_INFINITE_DOUBLE], *yes) ;; *) - AC_DEFINE([NEED_PRINTF_INFINITE_DOUBLE], 1, + AC_DEFINE([NEED_PRINTF_INFINITE_DOUBLE], [1], [Define if the vasnprintf implementation needs special code for infinite 'double' arguments.]) ;; @@ -110,7 +110,7 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF_INFINITE_LONG_DOUBLE], *yes) ;; *) - AC_DEFINE([NEED_PRINTF_INFINITE_LONG_DOUBLE], 1, + AC_DEFINE([NEED_PRINTF_INFINITE_LONG_DOUBLE], [1], [Define if the vasnprintf implementation needs special code for infinite 'long double' arguments.]) ;; @@ -127,7 +127,7 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF_DIRECTIVE_A], *yes) ;; *) - AC_DEFINE([NEED_PRINTF_DIRECTIVE_A], 1, + AC_DEFINE([NEED_PRINTF_DIRECTIVE_A], [1], [Define if the vasnprintf implementation needs special code for the 'a' and 'A' directives.]) AC_CHECK_FUNCS([nl_langinfo]) @@ -143,7 +143,7 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF_DIRECTIVE_F], *yes) ;; *) - AC_DEFINE([NEED_PRINTF_DIRECTIVE_F], 1, + AC_DEFINE([NEED_PRINTF_DIRECTIVE_F], [1], [Define if the vasnprintf implementation needs special code for the 'F' directive.]) ;; @@ -158,7 +158,7 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF_FLAG_GROUPING], *yes) ;; *) - AC_DEFINE([NEED_PRINTF_FLAG_GROUPING], 1, + AC_DEFINE([NEED_PRINTF_FLAG_GROUPING], [1], [Define if the vasnprintf implementation needs special code for the ' flag.]) ;; @@ -173,7 +173,7 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF_FLAG_LEFTADJUST], *yes) ;; *) - AC_DEFINE([NEED_PRINTF_FLAG_LEFTADJUST], 1, + AC_DEFINE([NEED_PRINTF_FLAG_LEFTADJUST], [1], [Define if the vasnprintf implementation needs special code for the '-' flag.]) ;; @@ -188,7 +188,7 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF_FLAG_ZERO], *yes) ;; *) - AC_DEFINE([NEED_PRINTF_FLAG_ZERO], 1, + AC_DEFINE([NEED_PRINTF_FLAG_ZERO], [1], [Define if the vasnprintf implementation needs special code for the 0 flag.]) ;; @@ -203,13 +203,13 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF_PRECISION], *yes) ;; *) - AC_DEFINE([NEED_PRINTF_UNBOUNDED_PRECISION], 1, + AC_DEFINE([NEED_PRINTF_UNBOUNDED_PRECISION], [1], [Define if the vasnprintf implementation needs special code for supporting large precisions without arbitrary bounds.]) - AC_DEFINE([NEED_PRINTF_DOUBLE], 1, + AC_DEFINE([NEED_PRINTF_DOUBLE], [1], [Define if the vasnprintf implementation needs special code for 'double' arguments.]) - AC_DEFINE([NEED_PRINTF_LONG_DOUBLE], 1, + AC_DEFINE([NEED_PRINTF_LONG_DOUBLE], [1], [Define if the vasnprintf implementation needs special code for 'long double' arguments.]) ;; @@ -225,13 +225,13 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF_ENOMEM], *yes) ;; *) - AC_DEFINE([NEED_PRINTF_ENOMEM], 1, + AC_DEFINE([NEED_PRINTF_ENOMEM], [1], [Define if the vasnprintf implementation needs special code for surviving out-of-memory conditions.]) - AC_DEFINE([NEED_PRINTF_DOUBLE], 1, + AC_DEFINE([NEED_PRINTF_DOUBLE], [1], [Define if the vasnprintf implementation needs special code for 'double' arguments.]) - AC_DEFINE([NEED_PRINTF_LONG_DOUBLE], 1, + AC_DEFINE([NEED_PRINTF_LONG_DOUBLE], [1], [Define if the vasnprintf implementation needs special code for 'long double' arguments.]) ;; diff --git a/gl/m4/wchar_t.m4 b/gl/m4/wchar_t.m4 index 3c81564adc..fb27a7f65f 100644 --- a/gl/m4/wchar_t.m4 +++ b/gl/m4/wchar_t.m4 @@ -1,5 +1,5 @@ -# wchar_t.m4 serial 2 (gettext-0.18) -dnl Copyright (C) 2002-2003, 2008 Free Software Foundation, Inc. +# wchar_t.m4 serial 3 (gettext-0.18) +dnl Copyright (C) 2002-2003, 2008, 2009 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -15,6 +15,6 @@ AC_DEFUN([gt_TYPE_WCHAR_T], wchar_t foo = (wchar_t)'\0';], , [gt_cv_c_wchar_t=yes], [gt_cv_c_wchar_t=no])]) if test $gt_cv_c_wchar_t = yes; then - AC_DEFINE([HAVE_WCHAR_T], 1, [Define if you have the 'wchar_t' type.]) + AC_DEFINE([HAVE_WCHAR_T], [1], [Define if you have the 'wchar_t' type.]) fi ]) diff --git a/gl/m4/wint_t.m4 b/gl/m4/wint_t.m4 index 0026a13188..47a4363d79 100644 --- a/gl/m4/wint_t.m4 +++ b/gl/m4/wint_t.m4 @@ -1,5 +1,5 @@ -# wint_t.m4 serial 3 (gettext-0.18) -dnl Copyright (C) 2003, 2007-2008 Free Software Foundation, Inc. +# wint_t.m4 serial 4 (gettext-0.18) +dnl Copyright (C) 2003, 2007-2009 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -23,6 +23,6 @@ AC_DEFUN([gt_TYPE_WINT_T], wint_t foo = (wchar_t)'\0';], , [gt_cv_c_wint_t=yes], [gt_cv_c_wint_t=no])]) if test $gt_cv_c_wint_t = yes; then - AC_DEFINE([HAVE_WINT_T], 1, [Define if you have the 'wint_t' type.]) + AC_DEFINE([HAVE_WINT_T], [1], [Define if you have the 'wint_t' type.]) fi ]) diff --git a/gl/progname.c b/gl/progname.c index 2b77a5883c..9854b5e7cc 100644 --- a/gl/progname.c +++ b/gl/progname.c @@ -1,5 +1,5 @@ /* Program name management. - Copyright (C) 2001-2003, 2005-2008 Free Software Foundation, Inc. + Copyright (C) 2001-2003, 2005-2009 Free Software Foundation, Inc. Written by Bruno Haible <haible@clisp.cons.org>, 2001. This program is free software: you can redistribute it and/or modify @@ -35,6 +35,8 @@ set_program_name (const char *argv0) { /* libtool creates a temporary executable whose name is sometimes prefixed with "lt-" (depends on the platform). It also makes argv[0] absolute. + But the name of the temporary executable is a detail that should not be + visible to the end user and to the test suite. Remove this "<dirname>/.libs/" or "<dirname>/.libs/lt-" prefix here. */ const char *slash; const char *base; @@ -47,5 +49,15 @@ set_program_name (const char *argv0) if (strncmp (base, "lt-", 3) == 0) argv0 = base + 3; } + + /* But don't strip off a leading <dirname>/ in general, because when the user + runs + /some/hidden/place/bin/cp foo foo + he should get the error message + /some/hidden/place/bin/cp: `foo' and `foo' are the same file + not + cp: `foo' and `foo' are the same file + */ + program_name = argv0; } diff --git a/gl/stdint.in.h b/gl/stdint.in.h index f8218c8537..f141c8f606 100644 --- a/gl/stdint.in.h +++ b/gl/stdint.in.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2001-2002, 2004-2008 Free Software Foundation, Inc. +/* Copyright (C) 2001-2002, 2004-2009 Free Software Foundation, Inc. Written by Paul Eggert, Bruno Haible, Sam Steingold, Peter Burwood. This file is part of gnulib. @@ -478,7 +478,9 @@ typedef int _verify_intmax_size[2 * (sizeof (intmax_t) == sizeof (uintmax_t)) - includes <wchar.h> -> <stdio.h> -> <getopt.h> -> <stdlib.h>, and the latter includes <stdint.h> and assumes its types are already defined. */ #if ! (defined WCHAR_MIN && defined WCHAR_MAX) +# define _GL_JUST_INCLUDE_SYSTEM_WCHAR_H # include <wchar.h> +# undef _GL_JUST_INCLUDE_SYSTEM_WCHAR_H #endif #undef WCHAR_MIN #undef WCHAR_MAX diff --git a/gl/stdio.in.h b/gl/stdio.in.h index 96cb25737e..cb273d7642 100644 --- a/gl/stdio.in.h +++ b/gl/stdio.in.h @@ -216,6 +216,38 @@ extern int vsprintf (char *str, const char *format, va_list args) vsprintf (b, f, a)) #endif +#if @GNULIB_DPRINTF@ +# if @REPLACE_DPRINTF@ +# define dprintf rpl_dprintf +# endif +# if @REPLACE_DPRINTF@ || !@HAVE_DPRINTF@ +extern int dprintf (int fd, const char *format, ...) + __attribute__ ((__format__ (__printf__, 2, 3))); +# endif +#elif defined GNULIB_POSIXCHECK +# undef dprintf +# define dprintf(d,f,a) \ + (GL_LINK_WARNING ("dprintf is unportable - " \ + "use gnulib module dprintf for portability"), \ + dprintf (d, f, a)) +#endif + +#if @GNULIB_VDPRINTF@ +# if @REPLACE_VDPRINTF@ +# define vdprintf rpl_vdprintf +# endif +# if @REPLACE_VDPRINTF@ || !@HAVE_VDPRINTF@ +extern int vdprintf (int fd, const char *format, va_list args) + __attribute__ ((__format__ (__printf__, 2, 0))); +# endif +#elif defined GNULIB_POSIXCHECK +# undef vdprintf +# define vdprintf(d,f,a) \ + (GL_LINK_WARNING ("vdprintf is unportable - " \ + "use gnulib module vdprintf for portability"), \ + vdprintf (d, f, a)) +#endif + #if @GNULIB_VASPRINTF@ # if @REPLACE_VASPRINTF@ # define asprintf rpl_asprintf diff --git a/gl/strerror.c b/gl/strerror.c index 787575fda5..798d854005 100644 --- a/gl/strerror.c +++ b/gl/strerror.c @@ -1,6 +1,6 @@ /* strerror.c --- POSIX compatible system error routine - Copyright (C) 2007-2008 Free Software Foundation, Inc. + Copyright (C) 2007-2009 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -40,94 +40,133 @@ char * rpl_strerror (int n) { + char const *msg = NULL; /* These error messages are taken from glibc/sysdeps/gnu/errlist.c. */ switch (n) { # if GNULIB_defined_ETXTBSY case ETXTBSY: - return "Text file busy"; + msg = "Text file busy"; + break; # endif # if GNULIB_defined_ESOCK /* native Windows platforms */ /* EWOULDBLOCK is the same as EAGAIN. */ case EINPROGRESS: - return "Operation now in progress"; + msg = "Operation now in progress"; + break; case EALREADY: - return "Operation already in progress"; + msg = "Operation already in progress"; + break; case ENOTSOCK: - return "Socket operation on non-socket"; + msg = "Socket operation on non-socket"; + break; case EDESTADDRREQ: - return "Destination address required"; + msg = "Destination address required"; + break; case EMSGSIZE: - return "Message too long"; + msg = "Message too long"; + break; case EPROTOTYPE: - return "Protocol wrong type for socket"; + msg = "Protocol wrong type for socket"; + break; case ENOPROTOOPT: - return "Protocol not available"; + msg = "Protocol not available"; + break; case EPROTONOSUPPORT: - return "Protocol not supported"; + msg = "Protocol not supported"; + break; case ESOCKTNOSUPPORT: - return "Socket type not supported"; + msg = "Socket type not supported"; + break; case EOPNOTSUPP: - return "Operation not supported"; + msg = "Operation not supported"; + break; case EPFNOSUPPORT: - return "Protocol family not supported"; + msg = "Protocol family not supported"; + break; case EAFNOSUPPORT: - return "Address family not supported by protocol"; + msg = "Address family not supported by protocol"; + break; case EADDRINUSE: - return "Address already in use"; + msg = "Address already in use"; + break; case EADDRNOTAVAIL: - return "Cannot assign requested address"; + msg = "Cannot assign requested address"; + break; case ENETDOWN: - return "Network is down"; + msg = "Network is down"; + break; case ENETUNREACH: - return "Network is unreachable"; + msg = "Network is unreachable"; + break; case ENETRESET: - return "Network dropped connection on reset"; + msg = "Network dropped connection on reset"; + break; case ECONNABORTED: - return "Software caused connection abort"; + msg = "Software caused connection abort"; + break; case ECONNRESET: - return "Connection reset by peer"; + msg = "Connection reset by peer"; + break; case ENOBUFS: - return "No buffer space available"; + msg = "No buffer space available"; + break; case EISCONN: - return "Transport endpoint is already connected"; + msg = "Transport endpoint is already connected"; + break; case ENOTCONN: - return "Transport endpoint is not connected"; + msg = "Transport endpoint is not connected"; + break; case ESHUTDOWN: - return "Cannot send after transport endpoint shutdown"; + msg = "Cannot send after transport endpoint shutdown"; + break; case ETOOMANYREFS: - return "Too many references: cannot splice"; + msg = "Too many references: cannot splice"; + break; case ETIMEDOUT: - return "Connection timed out"; + msg = "Connection timed out"; + break; case ECONNREFUSED: - return "Connection refused"; + msg = "Connection refused"; + break; case ELOOP: - return "Too many levels of symbolic links"; + msg = "Too many levels of symbolic links"; + break; case EHOSTDOWN: - return "Host is down"; + msg = "Host is down"; + break; case EHOSTUNREACH: - return "No route to host"; + msg = "No route to host"; + break; case EPROCLIM: - return "Too many processes"; + msg = "Too many processes"; + break; case EUSERS: - return "Too many users"; + msg = "Too many users"; + break; case EDQUOT: - return "Disk quota exceeded"; + msg = "Disk quota exceeded"; + break; case ESTALE: - return "Stale NFS file handle"; + msg = "Stale NFS file handle"; + break; case EREMOTE: - return "Object is remote"; + msg = "Object is remote"; + break; # if HAVE_WINSOCK2_H /* WSA_INVALID_HANDLE maps to EBADF */ /* WSA_NOT_ENOUGH_MEMORY maps to ENOMEM */ /* WSA_INVALID_PARAMETER maps to EINVAL */ case WSA_OPERATION_ABORTED: - return "Overlapped operation aborted"; + msg = "Overlapped operation aborted"; + break; case WSA_IO_INCOMPLETE: - return "Overlapped I/O event object not in signaled state"; + msg = "Overlapped I/O event object not in signaled state"; + break; case WSA_IO_PENDING: - return "Overlapped operations will complete later"; + msg = "Overlapped operations will complete later"; + break; /* WSAEINTR maps to EINTR */ /* WSAEBADF maps to EBADF */ /* WSAEACCES maps to EACCES */ @@ -172,98 +211,127 @@ rpl_strerror (int n) /* WSAESTALE is ESTALE */ /* WSAEREMOTE is EREMOTE */ case WSASYSNOTREADY: - return "Network subsystem is unavailable"; + msg = "Network subsystem is unavailable"; + break; case WSAVERNOTSUPPORTED: - return "Winsock.dll version out of range"; + msg = "Winsock.dll version out of range"; + break; case WSANOTINITIALISED: - return "Successful WSAStartup not yet performed"; + msg = "Successful WSAStartup not yet performed"; + break; case WSAEDISCON: - return "Graceful shutdown in progress"; + msg = "Graceful shutdown in progress"; + break; case WSAENOMORE: case WSA_E_NO_MORE: - return "No more results"; + msg = "No more results"; + break; case WSAECANCELLED: case WSA_E_CANCELLED: - return "Call was canceled"; + msg = "Call was canceled"; + break; case WSAEINVALIDPROCTABLE: - return "Procedure call table is invalid"; + msg = "Procedure call table is invalid"; + break; case WSAEINVALIDPROVIDER: - return "Service provider is invalid"; + msg = "Service provider is invalid"; + break; case WSAEPROVIDERFAILEDINIT: - return "Service provider failed to initialize"; + msg = "Service provider failed to initialize"; + break; case WSASYSCALLFAILURE: - return "System call failure"; + msg = "System call failure"; + break; case WSASERVICE_NOT_FOUND: - return "Service not found"; + msg = "Service not found"; + break; case WSATYPE_NOT_FOUND: - return "Class type not found"; + msg = "Class type not found"; + break; case WSAEREFUSED: - return "Database query was refused"; + msg = "Database query was refused"; + break; case WSAHOST_NOT_FOUND: - return "Host not found"; + msg = "Host not found"; + break; case WSATRY_AGAIN: - return "Nonauthoritative host not found"; + msg = "Nonauthoritative host not found"; + break; case WSANO_RECOVERY: - return "Nonrecoverable error"; + msg = "Nonrecoverable error"; + break; case WSANO_DATA: - return "Valid name, no data record of requested type"; + msg = "Valid name, no data record of requested type"; + break; /* WSA_QOS_* omitted */ # endif # endif # if GNULIB_defined_ENOMSG case ENOMSG: - return "No message of desired type"; + msg = "No message of desired type"; + break; # endif # if GNULIB_defined_EIDRM case EIDRM: - return "Identifier removed"; + msg = "Identifier removed"; + break; # endif # if GNULIB_defined_ENOLINK case ENOLINK: - return "Link has been severed"; + msg = "Link has been severed"; + break; # endif # if GNULIB_defined_EPROTO case EPROTO: - return "Protocol error"; + msg = "Protocol error"; + break; # endif # if GNULIB_defined_EMULTIHOP case EMULTIHOP: - return "Multihop attempted"; + msg = "Multihop attempted"; + break; # endif # if GNULIB_defined_EBADMSG case EBADMSG: - return "Bad message"; + msg = "Bad message"; + break; # endif # if GNULIB_defined_EOVERFLOW case EOVERFLOW: - return "Value too large for defined data type"; + msg = "Value too large for defined data type"; + break; # endif # if GNULIB_defined_ENOTSUP case ENOTSUP: - return "Not supported"; + msg = "Not supported"; + break; # endif # if GNULIB_defined_ case ECANCELED: - return "Operation canceled"; + msg = "Operation canceled"; + break; # endif } + if (msg) + return (char *) msg; + { char *result = strerror (n); if (result == NULL || result[0] == '\0') { static char const fmt[] = "Unknown error (%d)"; - static char mesg[sizeof fmt + INT_STRLEN_BOUND (n)]; - sprintf (mesg, fmt, n); - return mesg; + static char msg_buf[sizeof fmt + INT_STRLEN_BOUND (n)]; + sprintf (msg_buf, fmt, n); + return msg_buf; } return result; diff --git a/gl/sys_stat.in.h b/gl/sys_stat.in.h index 3748c261c8..1e6294da89 100644 --- a/gl/sys_stat.in.h +++ b/gl/sys_stat.in.h @@ -1,5 +1,5 @@ /* Provide a more complete sys/stat header file. - Copyright (C) 2005-2008 Free Software Foundation, Inc. + Copyright (C) 2005-2009 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -35,6 +35,9 @@ #ifndef _GL_SYS_STAT_H +/* Get nlink_t. */ +#include <sys/types.h> + /* The include_next requires a split double-inclusion guard. */ #@INCLUDE_NEXT@ @NEXT_SYS_STAT_H@ diff --git a/gl/tests/gettimeofday.c b/gl/tests/gettimeofday.c index 88295ce6a8..eb6bf9c126 100644 --- a/gl/tests/gettimeofday.c +++ b/gl/tests/gettimeofday.c @@ -41,6 +41,12 @@ static struct tm tm_zero_buffer; static struct tm *localtime_buffer_addr = &tm_zero_buffer; +#undef localtime +extern struct tm *localtime (time_t const *); + +#undef gmtime +extern struct tm *gmtime (time_t const *); + /* This is a wrapper for localtime. It is used only on systems for which gettimeofday clobbers the static buffer used for localtime's result. @@ -50,8 +56,6 @@ static struct tm *localtime_buffer_addr = &tm_zero_buffer; struct tm * rpl_localtime (time_t const *timep) { -#undef localtime - extern struct tm *localtime (time_t const *); struct tm *tm = localtime (timep); if (localtime_buffer_addr == &tm_zero_buffer) @@ -64,8 +68,6 @@ rpl_localtime (time_t const *timep) struct tm * rpl_gmtime (time_t const *timep) { -#undef gmtime - extern struct tm *gmtime (time_t const *); struct tm *tm = gmtime (timep); if (localtime_buffer_addr == &tm_zero_buffer) @@ -77,14 +79,15 @@ rpl_gmtime (time_t const *timep) #endif /* GETTIMEOFDAY_CLOBBERS_LOCALTIME || TZSET_CLOBBERS_LOCALTIME */ #if TZSET_CLOBBERS_LOCALTIME + +#undef tzset +extern void tzset (void); + /* This is a wrapper for tzset, for systems on which tzset may clobber the static buffer used for localtime's result. */ void rpl_tzset (void) { -#undef tzset - extern void tzset (void); - /* Save and restore the contents of the buffer used for localtime's result around the call to tzset. */ struct tm save = *localtime_buffer_addr; diff --git a/gl/tests/ioctl.c b/gl/tests/ioctl.c index a23d363bc5..75ed5c06f4 100644 --- a/gl/tests/ioctl.c +++ b/gl/tests/ioctl.c @@ -1,6 +1,6 @@ /* ioctl.c --- wrappers for Windows ioctl function - Copyright (C) 2008 Free Software Foundation, Inc. + Copyright (C) 2008, 2009 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -19,6 +19,8 @@ #include <config.h> +#include <sys/ioctl.h> + #include <stdarg.h> #define WIN32_LEAN_AND_MEAN diff --git a/gl/tests/test-unistd.c b/gl/tests/test-unistd.c index dc15bda0df..5fed15cf9f 100644 --- a/gl/tests/test-unistd.c +++ b/gl/tests/test-unistd.c @@ -1,5 +1,5 @@ /* Test of <unistd.h> substitute. - Copyright (C) 2007 Free Software Foundation, Inc. + Copyright (C) 2007, 2009 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -23,6 +23,12 @@ /* Check that the various SEEK_* macros are defined. */ int sk[] = { SEEK_CUR, SEEK_END, SEEK_SET }; +/* Check that the various *_FILENO macros are defined. */ +#if ! (defined STDIN_FILENO \ + && (STDIN_FILENO + STDOUT_FILENO + STDERR_FILENO == 3)) +missing or broken *_FILENO macros +#endif + /* Check that the types are all defined. */ size_t t1; ssize_t t2; diff --git a/gl/unistd.in.h b/gl/unistd.in.h index 1b2f80ee18..f0a674079d 100644 --- a/gl/unistd.in.h +++ b/gl/unistd.in.h @@ -1,5 +1,5 @@ /* Substitute for and wrapper around <unistd.h>. - Copyright (C) 2003-2008 Free Software Foundation, Inc. + Copyright (C) 2003-2009 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -29,7 +29,7 @@ #ifndef _GL_UNISTD_H #define _GL_UNISTD_H -/* mingw doesn't define the SEEK_* macros in <unistd.h>. */ +/* mingw doesn't define the SEEK_* or *_FILENO macros in <unistd.h>. */ #if !(defined SEEK_CUR && defined SEEK_END && defined SEEK_SET) # include <stdio.h> #endif @@ -87,6 +87,17 @@ /* The definition of GL_LINK_WARNING is copied here. */ +/* OS/2 EMX lacks these macros. */ +#ifndef STDIN_FILENO +# define STDIN_FILENO 0 +#endif +#ifndef STDOUT_FILENO +# define STDOUT_FILENO 1 +#endif +#ifndef STDERR_FILENO +# define STDERR_FILENO 2 +#endif + /* Declare overridden functions. */ #ifdef __cplusplus @@ -475,6 +486,23 @@ extern int lchown (char const *file, uid_t owner, gid_t group); #endif +#if @GNULIB_LINK@ +/* Create a new hard link for an existing file. + Return 0 if successful, otherwise -1 and errno set. + See POSIX:2001 specification + <http://www.opengroup.org/susv3xsh/link.html>. */ +# if !@HAVE_LINK@ +extern int link (const char *path1, const char *path2); +# endif +#elif defined GNULIB_POSIXCHECK +# undef link +# define link(path1,path2) \ + (GL_LINK_WARNING ("link is unportable - " \ + "use gnulib module link for portability"), \ + link (path1, path2)) +#endif + + #if @GNULIB_LSEEK@ # if @REPLACE_LSEEK@ /* Set the offset of FD relative to SEEK_SET, SEEK_CUR, or SEEK_END. diff --git a/gl/wchar.in.h b/gl/wchar.in.h index f8b9948f74..cc436b14b0 100644 --- a/gl/wchar.in.h +++ b/gl/wchar.in.h @@ -1,6 +1,6 @@ /* A substitute for ISO C99 <wchar.h>, for platforms that have issues. - Copyright (C) 2007-2008 Free Software Foundation, Inc. + Copyright (C) 2007-2009 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -30,8 +30,18 @@ @PRAGMA_SYSTEM_HEADER@ #endif -#ifdef __need_mbstate_t -/* Special invocation convention inside uClibc header files. */ +#if defined __need_mbstate_t || (defined __hpux && ((defined _INTTYPES_INCLUDED && !defined strtoimax) || defined _GL_JUST_INCLUDE_SYSTEM_WCHAR_H)) || defined _GL_ALREADY_INCLUDING_WCHAR_H +/* Special invocation convention: + - Inside uClibc header files. + - On HP-UX 11.00 we have a sequence of nested includes + <wchar.h> -> <stdlib.h> -> <stdint.h>, and the latter includes <wchar.h>, + once indirectly <stdint.h> -> <sys/types.h> -> <inttypes.h> -> <wchar.h> + and once directly. In both situations 'wint_t' is not yet defined, + therefore we cannot provide the function overrides; instead include only + the system's <wchar.h>. + - On IRIX 6.5, similarly, we have an include <wchar.h> -> <wctype.h>, and + the latter includes <wchar.h>. But here, we have no way to detect whether + <wctype.h> is completely included or is still being included. */ #@INCLUDE_NEXT@ @NEXT_WCHAR_H@ @@ -40,6 +50,8 @@ #ifndef _GL_WCHAR_H +#define _GL_ALREADY_INCLUDING_WCHAR_H + /* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before <wchar.h>. BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be @@ -55,6 +67,8 @@ # @INCLUDE_NEXT@ @NEXT_WCHAR_H@ #endif +#undef _GL_ALREADY_INCLUDING_WCHAR_H + #ifndef _GL_WCHAR_H #define _GL_WCHAR_H diff --git a/lib/gl/Makefile.am b/lib/gl/Makefile.am index a65da22f4e..09ddad4f4a 100644 --- a/lib/gl/Makefile.am +++ b/lib/gl/Makefile.am @@ -356,6 +356,8 @@ stdio.h: stdio.in.h -e 's|@''GNULIB_VPRINTF_POSIX''@|$(GNULIB_VPRINTF_POSIX)|g' \ -e 's|@''GNULIB_VSNPRINTF''@|$(GNULIB_VSNPRINTF)|g' \ -e 's|@''GNULIB_VSPRINTF_POSIX''@|$(GNULIB_VSPRINTF_POSIX)|g' \ + -e 's|@''GNULIB_DPRINTF''@|$(GNULIB_DPRINTF)|g' \ + -e 's|@''GNULIB_VDPRINTF''@|$(GNULIB_VDPRINTF)|g' \ -e 's|@''GNULIB_VASPRINTF''@|$(GNULIB_VASPRINTF)|g' \ -e 's|@''GNULIB_OBSTACK_PRINTF''@|$(GNULIB_OBSTACK_PRINTF)|g' \ -e 's|@''GNULIB_OBSTACK_PRINTF_POSIX''@|$(GNULIB_OBSTACK_PRINTF_POSIX)|g' \ @@ -388,6 +390,10 @@ stdio.h: stdio.in.h -e 's|@''HAVE_DECL_VSNPRINTF''@|$(HAVE_DECL_VSNPRINTF)|g' \ -e 's|@''REPLACE_SPRINTF''@|$(REPLACE_SPRINTF)|g' \ -e 's|@''REPLACE_VSPRINTF''@|$(REPLACE_VSPRINTF)|g' \ + -e 's|@''HAVE_DPRINTF''@|$(HAVE_DPRINTF)|g' \ + -e 's|@''REPLACE_DPRINTF''@|$(REPLACE_DPRINTF)|g' \ + -e 's|@''HAVE_VDPRINTF''@|$(HAVE_VDPRINTF)|g' \ + -e 's|@''REPLACE_VDPRINTF''@|$(REPLACE_VDPRINTF)|g' \ -e 's|@''HAVE_VASPRINTF''@|$(HAVE_VASPRINTF)|g' \ -e 's|@''REPLACE_VASPRINTF''@|$(REPLACE_VASPRINTF)|g' \ -e 's|@''HAVE_DECL_OBSTACK_PRINTF''@|$(HAVE_DECL_OBSTACK_PRINTF)|g' \ @@ -730,6 +736,7 @@ unistd.h: unistd.in.h -e 's|@''GNULIB_GETPAGESIZE''@|$(GNULIB_GETPAGESIZE)|g' \ -e 's|@''GNULIB_GETUSERSHELL''@|$(GNULIB_GETUSERSHELL)|g' \ -e 's|@''GNULIB_LCHOWN''@|$(GNULIB_LCHOWN)|g' \ + -e 's|@''GNULIB_LINK''@|$(GNULIB_LINK)|g' \ -e 's|@''GNULIB_LSEEK''@|$(GNULIB_LSEEK)|g' \ -e 's|@''GNULIB_READLINK''@|$(GNULIB_READLINK)|g' \ -e 's|@''GNULIB_SLEEP''@|$(GNULIB_SLEEP)|g' \ @@ -744,6 +751,7 @@ unistd.h: unistd.in.h -e 's|@''HAVE_GETHOSTNAME''@|$(HAVE_GETHOSTNAME)|g' \ -e 's|@''HAVE_GETPAGESIZE''@|$(HAVE_GETPAGESIZE)|g' \ -e 's|@''HAVE_GETUSERSHELL''@|$(HAVE_GETUSERSHELL)|g' \ + -e 's|@''HAVE_LINK''@|$(HAVE_LINK)|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/lib/gl/fseeko.c b/lib/gl/fseeko.c index e11e49ad1e..7ba8e58431 100644 --- a/lib/gl/fseeko.c +++ b/lib/gl/fseeko.c @@ -1,5 +1,5 @@ /* An fseeko() function that, together with fflush(), is POSIX compliant. - Copyright (C) 2007-2008 Free Software Foundation, Inc. + Copyright (C) 2007-2009 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 @@ -86,7 +86,14 @@ rpl_fseeko (FILE *fp, off_t offset, int whence) #error "Please port gnulib fseeko.c to your platform! Look at the code in fpurge.c, then report this to bug-gnulib." #endif { - off_t pos = lseek (fileno (fp), offset, whence); + /* We get here when an fflush() call immediately preceded this one. We + know there are no buffers. + POSIX requires us to modify the file descriptor's position. + But we cannot position beyond end of file here. */ + off_t pos = + lseek (fileno (fp), + whence == SEEK_END && offset > 0 ? 0 : offset, + whence); if (pos == -1) { #if defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, MacOS X, Cygwin */ @@ -94,20 +101,22 @@ rpl_fseeko (FILE *fp, off_t offset, int whence) #endif return -1; } - else - { -#if defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, MacOS X, Cygwin */ - fp_->_offset = pos; - fp_->_flags |= __SOFF; - fp_->_flags &= ~__SEOF; + +#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ + fp->_flags &= ~_IO_EOF_SEEN; +#elif defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, MacOS X, Cygwin */ + fp_->_offset = pos; + fp_->_flags |= __SOFF; + fp_->_flags &= ~__SEOF; #elif defined __EMX__ /* emx+gcc */ - fp->_flags &= ~_IOEOF; + fp->_flags &= ~_IOEOF; #elif defined _IOERR /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw */ - fp->_flag &= ~_IOEOF; + fp->_flag &= ~_IOEOF; #endif - return 0; - } + /* If we were not requested to position beyond end of file, we're + done. */ + if (!(whence == SEEK_END && offset > 0)) + return 0; } - else - return fseeko (fp, offset, whence); + return fseeko (fp, offset, whence); } diff --git a/lib/gl/m4/alloca.m4 b/lib/gl/m4/alloca.m4 index 95f54a6d48..4b978e137c 100644 --- a/lib/gl/m4/alloca.m4 +++ b/lib/gl/m4/alloca.m4 @@ -1,5 +1,5 @@ -# alloca.m4 serial 8 -dnl Copyright (C) 2002-2004, 2006, 2007 Free Software Foundation, Inc. +# alloca.m4 serial 9 +dnl Copyright (C) 2002-2004, 2006, 2007, 2009 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -26,7 +26,7 @@ AC_DEFUN([gl_FUNC_ALLOCA], ]) if test $gl_cv_rpl_alloca = yes; then dnl OK, alloca can be implemented through a compiler built-in. - AC_DEFINE([HAVE_ALLOCA], 1, + AC_DEFINE([HAVE_ALLOCA], [1], [Define to 1 if you have 'alloca' after including <alloca.h>, a header that may be supplied by this distribution.]) ALLOCA_H=alloca.h diff --git a/lib/gl/m4/byteswap.m4 b/lib/gl/m4/byteswap.m4 index 642c42cf83..ad13f22867 100644 --- a/lib/gl/m4/byteswap.m4 +++ b/lib/gl/m4/byteswap.m4 @@ -1,5 +1,5 @@ -# byteswap.m4 serial 2 -dnl Copyright (C) 2005, 2007 Free Software Foundation, Inc. +# byteswap.m4 serial 3 +dnl Copyright (C) 2005, 2007, 2009 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -14,5 +14,5 @@ AC_DEFUN([gl_BYTESWAP], ], [ BYTESWAP_H='byteswap.h' ]) - AC_SUBST(BYTESWAP_H) + AC_SUBST([BYTESWAP_H]) ]) diff --git a/lib/gl/m4/codeset.m4 b/lib/gl/m4/codeset.m4 index de4181d7d2..413217bd4a 100644 --- a/lib/gl/m4/codeset.m4 +++ b/lib/gl/m4/codeset.m4 @@ -1,5 +1,5 @@ -# codeset.m4 serial 3 (gettext-0.18) -dnl Copyright (C) 2000-2002, 2006, 2008 Free Software Foundation, Inc. +# codeset.m4 serial 4 (gettext-0.18) +dnl Copyright (C) 2000-2002, 2006, 2008, 2009 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -15,7 +15,7 @@ AC_DEFUN([AM_LANGINFO_CODESET], [am_cv_langinfo_codeset=no]) ]) if test $am_cv_langinfo_codeset = yes; then - AC_DEFINE([HAVE_LANGINFO_CODESET], 1, + AC_DEFINE([HAVE_LANGINFO_CODESET], [1], [Define if you have <langinfo.h> and nl_langinfo(CODESET).]) fi ]) diff --git a/lib/gl/m4/errno_h.m4 b/lib/gl/m4/errno_h.m4 index 22c08f07fa..0682d1ab63 100644 --- a/lib/gl/m4/errno_h.m4 +++ b/lib/gl/m4/errno_h.m4 @@ -1,5 +1,5 @@ -# errno_h.m4 serial 2 -dnl Copyright (C) 2004, 2006, 2008 Free Software Foundation, Inc. +# errno_h.m4 serial 3 +dnl Copyright (C) 2004, 2006, 2008, 2009 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -14,8 +14,8 @@ AC_DEFUN([gl_HEADER_ERRNO_H], AC_DEFUN([gl_HEADER_ERRNO_H_BODY], [ AC_REQUIRE([AC_PROG_CC]) - AC_CACHE_CHECK([for complete errno.h], gl_cv_header_errno_h_complete, [ - AC_EGREP_CPP(booboo,[ + AC_CACHE_CHECK([for complete errno.h], [gl_cv_header_errno_h_complete], [ + AC_EGREP_CPP([booboo],[ #include <errno.h> #if !defined ENOMSG booboo @@ -70,7 +70,7 @@ AC_DEFUN([gl_REPLACE_ERRNO_VALUE], [ if test -n "$ERRNO_H"; then AC_CACHE_CHECK([for ]$1[ value], [gl_cv_header_errno_h_]$1, [ - AC_EGREP_CPP(yes,[ + AC_EGREP_CPP([yes],[ #include <errno.h> #ifdef ]$1[ yes @@ -79,7 +79,7 @@ yes [gl_cv_header_errno_h_]$1[=yes], [gl_cv_header_errno_h_]$1[=no]) if test $gl_cv_header_errno_h_]$1[ = no; then - AC_EGREP_CPP(yes,[ + AC_EGREP_CPP([yes],[ #define _XOPEN_SOURCE_EXTENDED 1 #include <errno.h> #ifdef ]$1[ diff --git a/lib/gl/m4/gettext.m4 b/lib/gl/m4/gettext.m4 index c48856397b..d90c85008a 100644 --- a/lib/gl/m4/gettext.m4 +++ b/lib/gl/m4/gettext.m4 @@ -1,5 +1,5 @@ -# gettext.m4 serial 61 (gettext-0.18) -dnl Copyright (C) 1995-2008 Free Software Foundation, Inc. +# gettext.m4 serial 62 (gettext-0.18) +dnl Copyright (C) 1995-2009 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -123,7 +123,7 @@ AC_DEFUN([AM_GNU_GETTEXT], gt_use_preinstalled_gnugettext=no ifelse(gt_included_intl, yes, [ AC_MSG_CHECKING([whether included gettext is requested]) - AC_ARG_WITH(included-gettext, + AC_ARG_WITH([included-gettext], [ --with-included-gettext use the GNU gettext library included here], nls_cv_force_use_gnu_gettext=$withval, nls_cv_force_use_gnu_gettext=no) @@ -267,7 +267,7 @@ return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_a if test "$gt_use_preinstalled_gnugettext" = "yes" \ || test "$nls_cv_use_gnu_gettext" = "yes"; then - AC_DEFINE([ENABLE_NLS], 1, + AC_DEFINE([ENABLE_NLS], [1], [Define to 1 if translation of program messages to the user's native language is requested.]) else @@ -301,9 +301,9 @@ return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_a fi dnl For backward compatibility. Some packages may be using this. - AC_DEFINE([HAVE_GETTEXT], 1, + AC_DEFINE([HAVE_GETTEXT], [1], [Define if the GNU gettext() function is already present or preinstalled.]) - AC_DEFINE([HAVE_DCGETTEXT], 1, + AC_DEFINE([HAVE_DCGETTEXT], [1], [Define if the GNU dcgettext() function is already present or preinstalled.]) fi diff --git a/lib/gl/m4/gnulib-common.m4 b/lib/gl/m4/gnulib-common.m4 index c73db14cc5..cfd1b99f82 100644 --- a/lib/gl/m4/gnulib-common.m4 +++ b/lib/gl/m4/gnulib-common.m4 @@ -1,5 +1,5 @@ -# gnulib-common.m4 serial 6 -dnl Copyright (C) 2007-2008 Free Software Foundation, Inc. +# gnulib-common.m4 serial 8 +dnl Copyright (C) 2007-2009 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -63,7 +63,7 @@ m4_ifdef([AC_PROG_MKDIR_P], [], [ # works. # This definition can be removed once autoconf >= 2.62 can be assumed. AC_DEFUN([AC_C_RESTRICT], -[AC_CACHE_CHECK([for C/C++ restrict keyword], ac_cv_c_restrict, +[AC_CACHE_CHECK([for C/C++ restrict keyword], [ac_cv_c_restrict], [ac_cv_c_restrict=no # The order here caters to the fact that C++ does not require restrict. for ac_kw in __restrict __restrict__ _Restrict restrict; do @@ -99,3 +99,12 @@ AC_DEFUN([AC_C_RESTRICT], *) AC_DEFINE_UNQUOTED([restrict], [$ac_cv_c_restrict]) ;; esac ]) + +# gl_BIGENDIAN +# is like AC_C_BIGENDIAN, except that it can be AC_REQUIREd. +# Note that AC_REQUIRE([AC_C_BIGENDIAN]) does not work reliably because some +# macros invoke AC_C_BIGENDIAN with arguments. +AC_DEFUN([gl_BIGENDIAN], +[ + AC_C_BIGENDIAN +]) diff --git a/lib/gl/m4/iconv.m4 b/lib/gl/m4/iconv.m4 index 848b2f85c3..3cc626829e 100644 --- a/lib/gl/m4/iconv.m4 +++ b/lib/gl/m4/iconv.m4 @@ -1,5 +1,5 @@ -# iconv.m4 serial AM6 (gettext-0.18) -dnl Copyright (C) 2000-2002, 2007-2008 Free Software Foundation, Inc. +# iconv.m4 serial AM7 (gettext-0.18) +dnl Copyright (C) 2000-2002, 2007-2009 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -134,7 +134,7 @@ int main () am_func_iconv=no am_cv_lib_iconv=no fi if test "$am_func_iconv" = yes; then - AC_DEFINE([HAVE_ICONV], 1, + AC_DEFINE([HAVE_ICONV], [1], [Define if you have the iconv() function and it works.]) fi if test "$am_cv_lib_iconv" = yes; then diff --git a/lib/gl/m4/intldir.m4 b/lib/gl/m4/intldir.m4 index 7a28843f64..0980e6f286 100644 --- a/lib/gl/m4/intldir.m4 +++ b/lib/gl/m4/intldir.m4 @@ -1,5 +1,5 @@ -# intldir.m4 serial 1 (gettext-0.16) -dnl Copyright (C) 2006 Free Software Foundation, Inc. +# intldir.m4 serial 2 (gettext-0.18) +dnl Copyright (C) 2006, 2009 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -13,7 +13,7 @@ dnl by the GNU Library General Public License, and the rest of the GNU dnl gettext package package is covered by the GNU General Public License. dnl They are *not* in the public domain. -AC_PREREQ(2.52) +AC_PREREQ([2.52]) dnl Tells the AM_GNU_GETTEXT macro to consider an intl/ directory. AC_DEFUN([AM_GNU_GETTEXT_INTL_SUBDIR], []) diff --git a/lib/gl/m4/intlmacosx.m4 b/lib/gl/m4/intlmacosx.m4 index b77527d17d..c24837c429 100644 --- a/lib/gl/m4/intlmacosx.m4 +++ b/lib/gl/m4/intlmacosx.m4 @@ -1,5 +1,5 @@ -# intlmacosx.m4 serial 2 (gettext-0.18) -dnl Copyright (C) 2004-2008 Free Software Foundation, Inc. +# intlmacosx.m4 serial 3 (gettext-0.18) +dnl Copyright (C) 2004-2009 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -28,7 +28,7 @@ AC_DEFUN([gt_INTL_MACOSX], [gt_cv_func_CFPreferencesCopyAppValue=no]) LIBS="$gt_save_LIBS"]) if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then - AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], 1, + AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], [1], [Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in the CoreFoundation framework.]) fi dnl Check for API introduced in MacOS X 10.3. @@ -40,7 +40,7 @@ AC_DEFUN([gt_INTL_MACOSX], [gt_cv_func_CFLocaleCopyCurrent=no]) LIBS="$gt_save_LIBS"]) if test $gt_cv_func_CFLocaleCopyCurrent = yes; then - AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], 1, + AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], [1], [Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the CoreFoundation framework.]) fi INTL_MACOSX_LIBS= diff --git a/lib/gl/m4/intmax.m4 b/lib/gl/m4/intmax.m4 index d713db2286..a3785e9989 100644 --- a/lib/gl/m4/intmax.m4 +++ b/lib/gl/m4/intmax.m4 @@ -1,5 +1,5 @@ -# intmax.m4 serial 4 (gettext-0.18) -dnl Copyright (C) 2002-2005, 2008 Free Software Foundation, Inc. +# intmax.m4 serial 5 (gettext-0.18) +dnl Copyright (C) 2002-2005, 2008, 2009 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -27,7 +27,7 @@ AC_DEFUN([gt_TYPE_INTMAX_T], [gt_cv_c_intmax_t=yes], [gt_cv_c_intmax_t=no])]) if test $gt_cv_c_intmax_t = yes; then - AC_DEFINE([HAVE_INTMAX_T], 1, + AC_DEFINE([HAVE_INTMAX_T], [1], [Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>.]) fi ]) diff --git a/lib/gl/m4/intmax_t.m4 b/lib/gl/m4/intmax_t.m4 index 50ae35d223..264cb57184 100644 --- a/lib/gl/m4/intmax_t.m4 +++ b/lib/gl/m4/intmax_t.m4 @@ -1,12 +1,12 @@ -# intmax_t.m4 serial 6 -dnl Copyright (C) 1997-2004, 2006-2007 Free Software Foundation, Inc. +# intmax_t.m4 serial 7 +dnl Copyright (C) 1997-2004, 2006-2007, 2009 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Paul Eggert. -AC_PREREQ(2.13) +AC_PREREQ([2.13]) # Define intmax_t to 'long' or 'long long' # if it is not already defined in <stdint.h> or <inttypes.h>. @@ -22,10 +22,10 @@ AC_DEFUN([gl_AC_TYPE_INTMAX_T], test $ac_cv_type_long_long_int = yes \ && ac_type='long long' \ || ac_type='long' - AC_DEFINE_UNQUOTED(intmax_t, $ac_type, + AC_DEFINE_UNQUOTED([intmax_t], [$ac_type], [Define to long or long long if <inttypes.h> and <stdint.h> don't define.]) else - AC_DEFINE(HAVE_INTMAX_T, 1, + AC_DEFINE([HAVE_INTMAX_T], [1], [Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>.]) fi ]) @@ -36,7 +36,7 @@ AC_DEFUN([gt_AC_TYPE_INTMAX_T], [ AC_REQUIRE([gl_AC_HEADER_INTTYPES_H]) AC_REQUIRE([gl_AC_HEADER_STDINT_H]) - AC_CACHE_CHECK(for intmax_t, gt_cv_c_intmax_t, + AC_CACHE_CHECK([for intmax_t], [gt_cv_c_intmax_t], [AC_TRY_COMPILE([ #include <stddef.h> #include <stdlib.h> @@ -48,14 +48,14 @@ AC_DEFUN([gt_AC_TYPE_INTMAX_T], #endif ], [intmax_t x = -1; return !x;], gt_cv_c_intmax_t=yes, gt_cv_c_intmax_t=no)]) if test $gt_cv_c_intmax_t = yes; then - AC_DEFINE(HAVE_INTMAX_T, 1, + AC_DEFINE([HAVE_INTMAX_T], [1], [Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>.]) else AC_REQUIRE([AC_TYPE_LONG_LONG_INT]) test $ac_cv_type_long_long_int = yes \ && ac_type='long long' \ || ac_type='long' - AC_DEFINE_UNQUOTED(intmax_t, $ac_type, + AC_DEFINE_UNQUOTED([intmax_t], [$ac_type], [Define to long or long long if <stdint.h> and <inttypes.h> don't define.]) fi ]) diff --git a/lib/gl/m4/inttypes-pri.m4 b/lib/gl/m4/inttypes-pri.m4 index 66650ebdc8..98fec7bcf6 100644 --- a/lib/gl/m4/inttypes-pri.m4 +++ b/lib/gl/m4/inttypes-pri.m4 @@ -1,12 +1,12 @@ -# inttypes-pri.m4 serial 5 (gettext-0.18) -dnl Copyright (C) 1997-2002, 2006, 2008 Free Software Foundation, Inc. +# inttypes-pri.m4 serial 6 (gettext-0.18) +dnl Copyright (C) 1997-2002, 2006, 2008, 2009 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. -AC_PREREQ(2.52) +AC_PREREQ([2.52]) # Define PRI_MACROS_BROKEN if <inttypes.h> exists and defines the PRI* # macros to non-string values. This is the case on AIX 4.3.3. @@ -26,7 +26,7 @@ char *p = PRId32; ]) fi if test "$gt_cv_inttypes_pri_broken" = yes; then - AC_DEFINE_UNQUOTED([PRI_MACROS_BROKEN], 1, + AC_DEFINE_UNQUOTED([PRI_MACROS_BROKEN], [1], [Define if <inttypes.h> exists and defines unusable PRI* macros.]) PRI_MACROS_BROKEN=1 else diff --git a/lib/gl/m4/inttypes_h.m4 b/lib/gl/m4/inttypes_h.m4 index cf482d2875..f4ca16021c 100644 --- a/lib/gl/m4/inttypes_h.m4 +++ b/lib/gl/m4/inttypes_h.m4 @@ -1,5 +1,5 @@ -# inttypes_h.m4 serial 8 -dnl Copyright (C) 1997-2004, 2006, 2008 Free Software Foundation, Inc. +# inttypes_h.m4 serial 9 +dnl Copyright (C) 1997-2004, 2006, 2008, 2009 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -19,7 +19,7 @@ AC_DEFUN([gl_AC_HEADER_INTTYPES_H], [gl_cv_header_inttypes_h=yes], [gl_cv_header_inttypes_h=no])]) if test $gl_cv_header_inttypes_h = yes; then - AC_DEFINE_UNQUOTED([HAVE_INTTYPES_H_WITH_UINTMAX], 1, + AC_DEFINE_UNQUOTED([HAVE_INTTYPES_H_WITH_UINTMAX], [1], [Define if <inttypes.h> exists, doesn't clash with <sys/types.h>, and declares uintmax_t. ]) fi diff --git a/lib/gl/m4/lcmessage.m4 b/lib/gl/m4/lcmessage.m4 index b7c4730272..fa8e4167ac 100644 --- a/lib/gl/m4/lcmessage.m4 +++ b/lib/gl/m4/lcmessage.m4 @@ -1,5 +1,5 @@ -# lcmessage.m4 serial 5 (gettext-0.18) -dnl Copyright (C) 1995-2002, 2004-2005, 2008 Free Software Foundation, Inc. +# lcmessage.m4 serial 6 (gettext-0.18) +dnl Copyright (C) 1995-2002, 2004-2005, 2008, 2009 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -24,7 +24,7 @@ AC_DEFUN([gt_LC_MESSAGES], [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES], [gt_cv_val_LC_MESSAGES=yes], [gt_cv_val_LC_MESSAGES=no])]) if test $gt_cv_val_LC_MESSAGES = yes; then - AC_DEFINE([HAVE_LC_MESSAGES], 1, + AC_DEFINE([HAVE_LC_MESSAGES], [1], [Define if your <locale.h> file defines LC_MESSAGES.]) fi ]) diff --git a/lib/gl/m4/lib-ld.m4 b/lib/gl/m4/lib-ld.m4 index 96c4e2c339..e4863f2c9b 100644 --- a/lib/gl/m4/lib-ld.m4 +++ b/lib/gl/m4/lib-ld.m4 @@ -1,5 +1,5 @@ -# lib-ld.m4 serial 3 (gettext-0.13) -dnl Copyright (C) 1996-2003 Free Software Foundation, Inc. +# lib-ld.m4 serial 4 (gettext-0.18) +dnl Copyright (C) 1996-2003, 2009 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -10,7 +10,7 @@ dnl with libtool.m4. dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no. AC_DEFUN([AC_LIB_PROG_LD_GNU], -[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld, +[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], [acl_cv_prog_gnu_ld], [# I'd rather use --version here, but apparently some GNU ld's only accept -v. case `$LD -v 2>&1 </dev/null` in *GNU* | *'with BFD'*) @@ -23,7 +23,7 @@ with_gnu_ld=$acl_cv_prog_gnu_ld dnl From libtool-1.4. Sets the variable LD. AC_DEFUN([AC_LIB_PROG_LD], -[AC_ARG_WITH(gnu-ld, +[AC_ARG_WITH([gnu-ld], [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]], test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no) AC_REQUIRE([AC_PROG_CC])dnl @@ -77,7 +77,7 @@ elif test "$with_gnu_ld" = yes; then else AC_MSG_CHECKING([for non-GNU ld]) fi -AC_CACHE_VAL(acl_cv_path_LD, +AC_CACHE_VAL([acl_cv_path_LD], [if test -z "$LD"; then IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" for ac_dir in $PATH; do @@ -101,9 +101,9 @@ else fi]) LD="$acl_cv_path_LD" if test -n "$LD"; then - AC_MSG_RESULT($LD) + AC_MSG_RESULT([$LD]) else - AC_MSG_RESULT(no) + AC_MSG_RESULT([no]) fi test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) AC_LIB_PROG_LD_GNU diff --git a/lib/gl/m4/lib-link.m4 b/lib/gl/m4/lib-link.m4 index e29eead276..fcd3391bbc 100644 --- a/lib/gl/m4/lib-link.m4 +++ b/lib/gl/m4/lib-link.m4 @@ -1,12 +1,12 @@ -# lib-link.m4 serial 17 (gettext-0.18) -dnl Copyright (C) 2001-2008 Free Software Foundation, Inc. +# lib-link.m4 serial 18 (gettext-0.18) +dnl Copyright (C) 2001-2009 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. -AC_PREREQ(2.54) +AC_PREREQ([2.54]) dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and dnl the libraries corresponding to explicit and implicit dependencies. @@ -114,7 +114,7 @@ AC_DEFUN([AC_LIB_RPATH], AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir - AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [ + AC_CACHE_CHECK([for shared library run path origin], [acl_cv_rpath], [ CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh . ./conftest.sh @@ -131,7 +131,7 @@ AC_DEFUN([AC_LIB_RPATH], acl_hardcode_direct="$acl_cv_hardcode_direct" acl_hardcode_minus_L="$acl_cv_hardcode_minus_L" dnl Determine whether the user wants rpath handling at all. - AC_ARG_ENABLE(rpath, + AC_ARG_ENABLE([rpath], [ --disable-rpath do not hardcode runtime library paths], :, enable_rpath=yes) ]) diff --git a/lib/gl/m4/lock.m4 b/lib/gl/m4/lock.m4 index 9fec570dcd..b416e31a35 100644 --- a/lib/gl/m4/lock.m4 +++ b/lib/gl/m4/lock.m4 @@ -1,5 +1,5 @@ -# lock.m4 serial 9 (gettext-0.18) -dnl Copyright (C) 2005-2008 Free Software Foundation, Inc. +# lock.m4 serial 10 (gettext-0.18) +dnl Copyright (C) 2005-2009 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -13,7 +13,7 @@ AC_DEFUN([gl_LOCK], # OSF/1 4.0 and MacOS X 10.1 lack the pthread_rwlock_t type and the # pthread_rwlock_* functions. AC_CHECK_TYPE([pthread_rwlock_t], - [AC_DEFINE([HAVE_PTHREAD_RWLOCK], 1, + [AC_DEFINE([HAVE_PTHREAD_RWLOCK], [1], [Define if the POSIX multithreading library has read/write locks.])], [], [#include <pthread.h>]) @@ -25,7 +25,7 @@ error "No, in FreeBSD 4.0 recursive mutexes actually don't work." int x = (int)PTHREAD_MUTEX_RECURSIVE; return !x; #endif], - [AC_DEFINE([HAVE_PTHREAD_MUTEX_RECURSIVE], 1, + [AC_DEFINE([HAVE_PTHREAD_MUTEX_RECURSIVE], [1], [Define if the <pthread.h> defines PTHREAD_MUTEX_RECURSIVE.])]) fi gl_PREREQ_LOCK diff --git a/lib/gl/m4/longlong.m4 b/lib/gl/m4/longlong.m4 index 15bf9dacad..eedc8d5682 100644 --- a/lib/gl/m4/longlong.m4 +++ b/lib/gl/m4/longlong.m4 @@ -1,5 +1,5 @@ -# longlong.m4 serial 13 -dnl Copyright (C) 1999-2007 Free Software Foundation, Inc. +# longlong.m4 serial 14 +dnl Copyright (C) 1999-2007, 2009 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -46,7 +46,7 @@ AC_DEFUN([AC_TYPE_LONG_LONG_INT], [ac_cv_type_long_long_int=yes])], [ac_cv_type_long_long_int=no])]) if test $ac_cv_type_long_long_int = yes; then - AC_DEFINE([HAVE_LONG_LONG_INT], 1, + AC_DEFINE([HAVE_LONG_LONG_INT], [1], [Define to 1 if the system has the type `long long int'.]) fi ]) @@ -69,7 +69,7 @@ AC_DEFUN([AC_TYPE_UNSIGNED_LONG_LONG_INT], [ac_cv_type_unsigned_long_long_int=yes], [ac_cv_type_unsigned_long_long_int=no])]) if test $ac_cv_type_unsigned_long_long_int = yes; then - AC_DEFINE([HAVE_UNSIGNED_LONG_LONG_INT], 1, + AC_DEFINE([HAVE_UNSIGNED_LONG_LONG_INT], [1], [Define to 1 if the system has the type `unsigned long long int'.]) fi ]) diff --git a/lib/gl/m4/malloc.m4 b/lib/gl/m4/malloc.m4 index 764f2a9fa1..807017166b 100644 --- a/lib/gl/m4/malloc.m4 +++ b/lib/gl/m4/malloc.m4 @@ -1,5 +1,5 @@ -# malloc.m4 serial 8 -dnl Copyright (C) 2007 Free Software Foundation, Inc. +# malloc.m4 serial 9 +dnl Copyright (C) 2007, 2009 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -13,7 +13,7 @@ AC_DEFUN([gl_FUNC_MALLOC_POSIX], AC_REQUIRE([gl_CHECK_MALLOC_POSIX]) if test $gl_cv_func_malloc_posix = yes; then HAVE_MALLOC_POSIX=1 - AC_DEFINE([HAVE_MALLOC_POSIX], 1, + AC_DEFINE([HAVE_MALLOC_POSIX], [1], [Define if the 'malloc' function is POSIX compliant.]) else AC_LIBOBJ([malloc]) diff --git a/lib/gl/m4/memmem.m4 b/lib/gl/m4/memmem.m4 index 87ab66319f..9e3d3d956d 100644 --- a/lib/gl/m4/memmem.m4 +++ b/lib/gl/m4/memmem.m4 @@ -1,5 +1,5 @@ -# memmem.m4 serial 13 -dnl Copyright (C) 2002, 2003, 2004, 2007, 2008 Free Software Foundation, Inc. +# memmem.m4 serial 14 +dnl Copyright (C) 2002, 2003, 2004, 2007, 2008, 2009 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -11,8 +11,8 @@ AC_DEFUN([gl_FUNC_MEMMEM_SIMPLE], AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS]) - AC_REPLACE_FUNCS(memmem) - AC_CHECK_DECLS_ONCE(memmem) + AC_REPLACE_FUNCS([memmem]) + AC_CHECK_DECLS_ONCE([memmem]) if test $ac_cv_have_decl_memmem = no; then HAVE_DECL_MEMMEM=0 fi diff --git a/lib/gl/m4/memmove.m4 b/lib/gl/m4/memmove.m4 index 66054e4416..0b01cc6c0c 100644 --- a/lib/gl/m4/memmove.m4 +++ b/lib/gl/m4/memmove.m4 @@ -1,12 +1,12 @@ -# memmove.m4 serial 2 -dnl Copyright (C) 2002 Free Software Foundation, Inc. +# memmove.m4 serial 3 +dnl Copyright (C) 2002, 2009 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_FUNC_MEMMOVE], [ - AC_REPLACE_FUNCS(memmove) + AC_REPLACE_FUNCS([memmove]) if test $ac_cv_func_memmove = no; then gl_PREREQ_MEMMOVE fi diff --git a/lib/gl/m4/minmax.m4 b/lib/gl/m4/minmax.m4 index bbd1ba0b84..d2993fbaf7 100644 --- a/lib/gl/m4/minmax.m4 +++ b/lib/gl/m4/minmax.m4 @@ -1,10 +1,10 @@ -# minmax.m4 serial 2 -dnl Copyright (C) 2005 Free Software Foundation, Inc. +# minmax.m4 serial 3 +dnl Copyright (C) 2005, 2009 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. -AC_PREREQ(2.52) +AC_PREREQ([2.52]) AC_DEFUN([gl_MINMAX], [ diff --git a/lib/gl/m4/nls.m4 b/lib/gl/m4/nls.m4 index 5f155f01a2..0b36434215 100644 --- a/lib/gl/m4/nls.m4 +++ b/lib/gl/m4/nls.m4 @@ -1,5 +1,5 @@ -# nls.m4 serial 4 (gettext-0.18) -dnl Copyright (C) 1995-2003, 2005-2006, 2008 Free Software Foundation, Inc. +# nls.m4 serial 5 (gettext-0.18) +dnl Copyright (C) 1995-2003, 2005-2006, 2008, 2009 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -17,15 +17,15 @@ dnl Authors: dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000. dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003. -AC_PREREQ(2.50) +AC_PREREQ([2.50]) AC_DEFUN([AM_NLS], [ AC_MSG_CHECKING([whether NLS is requested]) dnl Default is enabled NLS - AC_ARG_ENABLE(nls, + AC_ARG_ENABLE([nls], [ --disable-nls do not use Native Language Support], USE_NLS=$enableval, USE_NLS=yes) - AC_MSG_RESULT($USE_NLS) + AC_MSG_RESULT([$USE_NLS]) AC_SUBST([USE_NLS]) ]) diff --git a/lib/gl/m4/po.m4 b/lib/gl/m4/po.m4 index 818143e713..2284fa5054 100644 --- a/lib/gl/m4/po.m4 +++ b/lib/gl/m4/po.m4 @@ -1,5 +1,5 @@ -# po.m4 serial 16 (gettext-0.18) -dnl Copyright (C) 1995-2008 Free Software Foundation, Inc. +# po.m4 serial 17 (gettext-0.18) +dnl Copyright (C) 1995-2009 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -17,7 +17,7 @@ dnl Authors: dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000. dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003. -AC_PREREQ(2.50) +AC_PREREQ([2.50]) dnl Checks for all prerequisites of the po subdirectory. AC_DEFUN([AM_PO_SUBDIRS], diff --git a/lib/gl/m4/printf-posix.m4 b/lib/gl/m4/printf-posix.m4 index 8933ee399d..5922d27891 100644 --- a/lib/gl/m4/printf-posix.m4 +++ b/lib/gl/m4/printf-posix.m4 @@ -1,5 +1,5 @@ -# printf-posix.m4 serial 4 (gettext-0.18) -dnl Copyright (C) 2003, 2007 Free Software Foundation, Inc. +# printf-posix.m4 serial 5 (gettext-0.18) +dnl Copyright (C) 2003, 2007, 2009 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -27,7 +27,7 @@ int main () return (strcmp (buf, "55 33") != 0); }], gt_cv_func_printf_posix=yes, gt_cv_func_printf_posix=no, [ - AC_EGREP_CPP(notposix, [ + AC_EGREP_CPP([notposix], [ #if defined __NetBSD__ || defined __BEOS__ || defined _MSC_VER || defined __MINGW32__ || defined __CYGWIN__ notposix #endif @@ -38,7 +38,7 @@ int main () ]) case $gt_cv_func_printf_posix in *yes) - AC_DEFINE([HAVE_POSIX_PRINTF], 1, + AC_DEFINE([HAVE_POSIX_PRINTF], [1], [Define if your printf() function supports format strings with positions.]) ;; esac diff --git a/lib/gl/m4/printf.m4 b/lib/gl/m4/printf.m4 index 474a635575..a1d4dadd7b 100644 --- a/lib/gl/m4/printf.m4 +++ b/lib/gl/m4/printf.m4 @@ -1,5 +1,5 @@ -# printf.m4 serial 25 -dnl Copyright (C) 2003, 2007-2008 Free Software Foundation, Inc. +# printf.m4 serial 28 +dnl Copyright (C) 2003, 2007-2009 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -225,12 +225,12 @@ AC_DEFUN([gl_PRINTF_INFINITE_LONG_DOUBLE], [ AC_REQUIRE([gl_PRINTF_LONG_DOUBLE]) AC_REQUIRE([AC_PROG_CC]) - AC_REQUIRE([AC_C_BIGENDIAN]) + AC_REQUIRE([gl_BIGENDIAN]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles dnl The user can set or unset the variable gl_printf_safe to indicate dnl that he wishes a safe handling of non-IEEE-754 'long double' values. if test -n "$gl_printf_safe"; then - AC_DEFINE([CHECK_PRINTF_SAFE], 1, + AC_DEFINE([CHECK_PRINTF_SAFE], [1], [Define if you wish *printf() functions that have a safe handling of non-IEEE-754 'long double' values.]) fi @@ -1142,7 +1142,7 @@ AC_DEFUN([gl_SNPRINTF_SIZE1], #include <stdio.h> int main() { - static char buf[8] = "DEADBEEF"; + static char buf[8] = { 'D', 'E', 'A', 'D', 'B', 'E', 'E', 'F' }; snprintf (buf, 1, "%d", 12345); return buf[1] != 'E'; }], @@ -1160,7 +1160,7 @@ dnl --------------------------------------------------------------------- dnl #include <stdio.h> dnl int main() dnl { -dnl static char buf[8] = "DEADBEEF"; +dnl static char buf[8] = { 'D', 'E', 'A', 'D', 'B', 'E', 'E', 'F' }; dnl snprintf (buf, 0, "%d", 12345); dnl return buf[0] != 'D'; dnl } @@ -1181,7 +1181,7 @@ dnl return ret; dnl } dnl int main() dnl { -dnl static char buf[8] = "DEADBEEF"; +dnl static char buf[8] = { 'D', 'E', 'A', 'D', 'B', 'E', 'E', 'F' }; dnl my_snprintf (buf, 0, "%d", 12345); dnl return buf[0] != 'D'; dnl } @@ -1209,7 +1209,7 @@ static int my_snprintf (char *buf, int size, const char *format, ...) } int main() { - static char buf[8] = "DEADBEEF"; + static char buf[8] = { 'D', 'E', 'A', 'D', 'B', 'E', 'E', 'F' }; my_snprintf (buf, 0, "%d", 12345); return buf[0] != 'D'; }], diff --git a/lib/gl/m4/progtest.m4 b/lib/gl/m4/progtest.m4 index 9b55f75120..e1d445d267 100644 --- a/lib/gl/m4/progtest.m4 +++ b/lib/gl/m4/progtest.m4 @@ -1,5 +1,5 @@ -# progtest.m4 serial 5 (gettext-0.18) -dnl Copyright (C) 1996-2003, 2005, 2008 Free Software Foundation, Inc. +# progtest.m4 serial 6 (gettext-0.18) +dnl Copyright (C) 1996-2003, 2005, 2008, 2009 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -16,7 +16,7 @@ dnl They are *not* in the public domain. dnl Authors: dnl Ulrich Drepper <drepper@cygnus.com>, 1996. -AC_PREREQ(2.50) +AC_PREREQ([2.50]) # Search path for a program which passes the given test. @@ -88,5 +88,5 @@ if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then else AC_MSG_RESULT([no]) fi -AC_SUBST($1)dnl +AC_SUBST([$1])dnl ]) diff --git a/lib/gl/m4/realloc.m4 b/lib/gl/m4/realloc.m4 index f9fd935dbb..5925796864 100644 --- a/lib/gl/m4/realloc.m4 +++ b/lib/gl/m4/realloc.m4 @@ -1,5 +1,5 @@ -# realloc.m4 serial 8 -dnl Copyright (C) 2007 Free Software Foundation, Inc. +# realloc.m4 serial 9 +dnl Copyright (C) 2007, 2009 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -13,7 +13,7 @@ AC_DEFUN([gl_FUNC_REALLOC_POSIX], AC_REQUIRE([gl_CHECK_MALLOC_POSIX]) if test $gl_cv_func_malloc_posix = yes; then HAVE_REALLOC_POSIX=1 - AC_DEFINE([HAVE_REALLOC_POSIX], 1, + AC_DEFINE([HAVE_REALLOC_POSIX], [1], [Define if the 'realloc' function is POSIX compliant.]) else AC_LIBOBJ([realloc]) diff --git a/lib/gl/m4/sockets.m4 b/lib/gl/m4/sockets.m4 index 124e777a5e..d5a7dbfb4b 100644 --- a/lib/gl/m4/sockets.m4 +++ b/lib/gl/m4/sockets.m4 @@ -1,5 +1,5 @@ -# sockets.m4 serial 3 -dnl Copyright (C) 2008 Free Software Foundation, Inc. +# sockets.m4 serial 4 +dnl Copyright (C) 2008, 2009 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -26,7 +26,7 @@ AC_DEFUN([gl_SOCKETS], LIBS="$gl_save_LIBS" ]) if test "$gl_cv_func_wsastartup" = "yes"; then - AC_DEFINE([WINDOWS_SOCKETS], 1, [Define if WSAStartup is needed.]) + AC_DEFINE([WINDOWS_SOCKETS], [1], [Define if WSAStartup is needed.]) LIBSOCKET='-lws2_32' fi else diff --git a/lib/gl/m4/sockpfaf.m4 b/lib/gl/m4/sockpfaf.m4 index 25d9755c5e..99ea06f96f 100644 --- a/lib/gl/m4/sockpfaf.m4 +++ b/lib/gl/m4/sockpfaf.m4 @@ -1,5 +1,5 @@ -# sockpfaf.m4 serial 5 -dnl Copyright (C) 2004, 2006 Free Software Foundation, Inc. +# sockpfaf.m4 serial 6 +dnl Copyright (C) 2004, 2006, 2009 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -16,8 +16,8 @@ AC_DEFUN([gl_SOCKET_FAMILIES], AC_REQUIRE([gl_HEADER_SYS_SOCKET]) AC_CHECK_HEADERS_ONCE([netinet/in.h]) - AC_MSG_CHECKING(for IPv4 sockets) - AC_CACHE_VAL(gl_cv_socket_ipv4, + AC_MSG_CHECKING([for IPv4 sockets]) + AC_CACHE_VAL([gl_cv_socket_ipv4], [AC_TRY_COMPILE([#include <sys/types.h> #ifdef HAVE_SYS_SOCKET_H #include <sys/socket.h> @@ -31,13 +31,13 @@ AC_DEFUN([gl_SOCKET_FAMILIES], [int x = AF_INET; struct in_addr y; struct sockaddr_in z; if (&x && &y && &z) return 0;], gl_cv_socket_ipv4=yes, gl_cv_socket_ipv4=no)]) - AC_MSG_RESULT($gl_cv_socket_ipv4) + AC_MSG_RESULT([$gl_cv_socket_ipv4]) if test $gl_cv_socket_ipv4 = yes; then - AC_DEFINE(HAVE_IPV4, 1, [Define to 1 if <sys/socket.h> defines AF_INET.]) + AC_DEFINE([HAVE_IPV4], [1], [Define to 1 if <sys/socket.h> defines AF_INET.]) fi - AC_MSG_CHECKING(for IPv6 sockets) - AC_CACHE_VAL(gl_cv_socket_ipv6, + AC_MSG_CHECKING([for IPv6 sockets]) + AC_CACHE_VAL([gl_cv_socket_ipv6], [AC_TRY_COMPILE([#include <sys/types.h> #ifdef HAVE_SYS_SOCKET_H #include <sys/socket.h> @@ -51,8 +51,8 @@ AC_DEFUN([gl_SOCKET_FAMILIES], [int x = AF_INET6; struct in6_addr y; struct sockaddr_in6 z; if (&x && &y && &z) return 0;], gl_cv_socket_ipv6=yes, gl_cv_socket_ipv6=no)]) - AC_MSG_RESULT($gl_cv_socket_ipv6) + AC_MSG_RESULT([$gl_cv_socket_ipv6]) if test $gl_cv_socket_ipv6 = yes; then - AC_DEFINE(HAVE_IPV6, 1, [Define to 1 if <sys/socket.h> defines AF_INET6.]) + AC_DEFINE([HAVE_IPV6], [1], [Define to 1 if <sys/socket.h> defines AF_INET6.]) fi ]) diff --git a/lib/gl/m4/stdbool.m4 b/lib/gl/m4/stdbool.m4 index 2204ecd984..57c804a80f 100644 --- a/lib/gl/m4/stdbool.m4 +++ b/lib/gl/m4/stdbool.m4 @@ -1,6 +1,6 @@ # Check for stdbool.h that conforms to C99. -dnl Copyright (C) 2002-2006 Free Software Foundation, Inc. +dnl Copyright (C) 2002-2006, 2009 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -111,5 +111,5 @@ AC_DEFUN([AC_HEADER_STDBOOL], [ac_cv_header_stdbool_h=no])]) AC_CHECK_TYPES([_Bool]) if test $ac_cv_header_stdbool_h = yes; then - AC_DEFINE(HAVE_STDBOOL_H, 1, [Define to 1 if stdbool.h conforms to C99.]) + AC_DEFINE([HAVE_STDBOOL_H], [1], [Define to 1 if stdbool.h conforms to C99.]) fi]) diff --git a/lib/gl/m4/stdint.m4 b/lib/gl/m4/stdint.m4 index e507a02eb8..b4194c8adc 100644 --- a/lib/gl/m4/stdint.m4 +++ b/lib/gl/m4/stdint.m4 @@ -1,5 +1,5 @@ -# stdint.m4 serial 32 -dnl Copyright (C) 2001-2008 Free Software Foundation, Inc. +# stdint.m4 serial 33 +dnl Copyright (C) 2001-2009 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -9,7 +9,7 @@ dnl Test whether <stdint.h> is supported or must be substituted. AC_DEFUN([gl_STDINT_H], [ - AC_PREREQ(2.59)dnl + AC_PREREQ([2.59])dnl dnl Check for long long int and unsigned long long int. AC_REQUIRE([AC_TYPE_LONG_LONG_INT]) @@ -229,7 +229,7 @@ struct s { gl_STDINT_TYPE_PROPERTIES STDINT_H=stdint.h fi - AC_SUBST(STDINT_H) + AC_SUBST([STDINT_H]) ]) dnl gl_STDINT_BITSIZEOF(TYPES, INCLUDES) @@ -292,7 +292,7 @@ AC_DEFUN([gl_CHECK_TYPES_SIGNED], eval result=\$gl_cv_type_${gltype}_signed GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` if test "$result" = yes; then - AC_DEFINE_UNQUOTED([HAVE_SIGNED_${GLTYPE}], 1) + AC_DEFINE_UNQUOTED([HAVE_SIGNED_${GLTYPE}], [1]) eval HAVE_SIGNED_${GLTYPE}=1 else eval HAVE_SIGNED_${GLTYPE}=0 @@ -348,7 +348,7 @@ AC_DEFUN([gl_INTEGER_TYPE_SUFFIX], eval result=\$gl_cv_type_${gltype}_suffix test "$result" = no && result= eval ${GLTYPE}_SUFFIX=\$result - AC_DEFINE_UNQUOTED([${GLTYPE}_SUFFIX], $result) + AC_DEFINE_UNQUOTED([${GLTYPE}_SUFFIX], [$result]) done m4_foreach_w([gltype], [$1], [AC_SUBST(translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_])[_SUFFIX])]) diff --git a/lib/gl/m4/stdint_h.m4 b/lib/gl/m4/stdint_h.m4 index 2c8e649799..82f0c244c8 100644 --- a/lib/gl/m4/stdint_h.m4 +++ b/lib/gl/m4/stdint_h.m4 @@ -1,5 +1,5 @@ -# stdint_h.m4 serial 7 -dnl Copyright (C) 1997-2004, 2006, 2008 Free Software Foundation, Inc. +# stdint_h.m4 serial 8 +dnl Copyright (C) 1997-2004, 2006, 2008, 2009 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -19,7 +19,7 @@ AC_DEFUN([gl_AC_HEADER_STDINT_H], [gl_cv_header_stdint_h=yes], [gl_cv_header_stdint_h=no])]) if test $gl_cv_header_stdint_h = yes; then - AC_DEFINE_UNQUOTED([HAVE_STDINT_H_WITH_UINTMAX], 1, + AC_DEFINE_UNQUOTED([HAVE_STDINT_H_WITH_UINTMAX], [1], [Define if <stdint.h> exists, doesn't clash with <sys/types.h>, and declares uintmax_t. ]) fi diff --git a/lib/gl/m4/stdio_h.m4 b/lib/gl/m4/stdio_h.m4 index 60b4bd791a..846b65d302 100644 --- a/lib/gl/m4/stdio_h.m4 +++ b/lib/gl/m4/stdio_h.m4 @@ -1,5 +1,5 @@ -# stdio_h.m4 serial 14 -dnl Copyright (C) 2007-2008 Free Software Foundation, Inc. +# stdio_h.m4 serial 15 +dnl Copyright (C) 2007-2009 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -53,6 +53,8 @@ AC_DEFUN([gl_STDIO_H_DEFAULTS], GNULIB_VPRINTF_POSIX=0; AC_SUBST([GNULIB_VPRINTF_POSIX]) GNULIB_VSNPRINTF=0; AC_SUBST([GNULIB_VSNPRINTF]) GNULIB_VSPRINTF_POSIX=0; AC_SUBST([GNULIB_VSPRINTF_POSIX]) + GNULIB_DPRINTF=0; AC_SUBST([GNULIB_DPRINTF]) + GNULIB_VDPRINTF=0; AC_SUBST([GNULIB_VDPRINTF]) GNULIB_VASPRINTF=0; AC_SUBST([GNULIB_VASPRINTF]) GNULIB_OBSTACK_PRINTF=0; AC_SUBST([GNULIB_OBSTACK_PRINTF]) GNULIB_OBSTACK_PRINTF_POSIX=0; AC_SUBST([GNULIB_OBSTACK_PRINTF_POSIX]) @@ -86,6 +88,10 @@ AC_DEFUN([gl_STDIO_H_DEFAULTS], HAVE_DECL_VSNPRINTF=1; AC_SUBST([HAVE_DECL_VSNPRINTF]) REPLACE_SPRINTF=0; AC_SUBST([REPLACE_SPRINTF]) REPLACE_VSPRINTF=0; AC_SUBST([REPLACE_VSPRINTF]) + HAVE_DPRINTF=1; AC_SUBST([HAVE_DPRINTF]) + REPLACE_DPRINTF=0; AC_SUBST([REPLACE_DPRINTF]) + HAVE_VDPRINTF=1; AC_SUBST([HAVE_VDPRINTF]) + REPLACE_VDPRINTF=0; AC_SUBST([REPLACE_VDPRINTF]) HAVE_VASPRINTF=1; AC_SUBST([HAVE_VASPRINTF]) REPLACE_VASPRINTF=0; AC_SUBST([REPLACE_VASPRINTF]) HAVE_DECL_OBSTACK_PRINTF=1; AC_SUBST([HAVE_DECL_OBSTACK_PRINTF]) diff --git a/lib/gl/m4/strcase.m4 b/lib/gl/m4/strcase.m4 index 79c525c110..0dfdb1a181 100644 --- a/lib/gl/m4/strcase.m4 +++ b/lib/gl/m4/strcase.m4 @@ -1,5 +1,5 @@ -# strcase.m4 serial 9 -dnl Copyright (C) 2002, 2005-2008 Free Software Foundation, Inc. +# strcase.m4 serial 10 +dnl Copyright (C) 2002, 2005-2009 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -13,7 +13,7 @@ AC_DEFUN([gl_STRCASE], AC_DEFUN([gl_FUNC_STRCASECMP], [ AC_REQUIRE([gl_HEADER_STRINGS_H_DEFAULTS]) - AC_REPLACE_FUNCS(strcasecmp) + AC_REPLACE_FUNCS([strcasecmp]) if test $ac_cv_func_strcasecmp = no; then HAVE_STRCASECMP=0 gl_PREREQ_STRCASECMP @@ -23,11 +23,11 @@ AC_DEFUN([gl_FUNC_STRCASECMP], AC_DEFUN([gl_FUNC_STRNCASECMP], [ AC_REQUIRE([gl_HEADER_STRINGS_H_DEFAULTS]) - AC_REPLACE_FUNCS(strncasecmp) + AC_REPLACE_FUNCS([strncasecmp]) if test $ac_cv_func_strncasecmp = no; then gl_PREREQ_STRNCASECMP fi - AC_CHECK_DECLS(strncasecmp) + AC_CHECK_DECLS([strncasecmp]) if test $ac_cv_have_decl_strncasecmp = no; then HAVE_DECL_STRNCASECMP=0 fi diff --git a/lib/gl/m4/strverscmp.m4 b/lib/gl/m4/strverscmp.m4 index a3f9aff4b6..becce2bb17 100644 --- a/lib/gl/m4/strverscmp.m4 +++ b/lib/gl/m4/strverscmp.m4 @@ -1,6 +1,5 @@ -# strverscmp.m4 serial 6 -dnl Copyright (C) 2002, 2005, 2006, 2007, 2008 Free Software -dnl Foundation, Inc. +# strverscmp.m4 serial 7 +dnl Copyright (C) 2002, 2005-2009 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -11,7 +10,7 @@ AC_DEFUN([gl_FUNC_STRVERSCMP], AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS]) - AC_REPLACE_FUNCS(strverscmp) + AC_REPLACE_FUNCS([strverscmp]) if test $ac_cv_func_strverscmp = no; then gl_PREREQ_STRVERSCMP HAVE_STRVERSCMP=0 diff --git a/lib/gl/m4/threadlib.m4 b/lib/gl/m4/threadlib.m4 index 51caf576b3..3dd38aa877 100644 --- a/lib/gl/m4/threadlib.m4 +++ b/lib/gl/m4/threadlib.m4 @@ -1,5 +1,5 @@ -# threadlib.m4 serial 2 (gettext-0.18) -dnl Copyright (C) 2005-2008 Free Software Foundation, Inc. +# threadlib.m4 serial 3 (gettext-0.18) +dnl Copyright (C) 2005-2009 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -45,7 +45,7 @@ AC_DEFUN([gl_THREADLIB_EARLY_BODY], [AC_REQUIRE([AC_GNU_SOURCE])]) dnl Check for multithreading. m4_divert_text([DEFAULTS], [gl_use_threads_default=]) - AC_ARG_ENABLE(threads, + AC_ARG_ENABLE([threads], AC_HELP_STRING([--enable-threads={posix|solaris|pth|win32}], [specify multithreading API]) AC_HELP_STRING([--disable-threads], [build without multithread safety]), [gl_use_threads=$enableval], @@ -131,7 +131,7 @@ AC_DEFUN([gl_THREADLIB_BODY], # pthread_create will actually create a thread. case "$host_os" in solaris* | hpux*) - AC_DEFINE([PTHREAD_IN_USE_DETECTION_HARD], 1, + AC_DEFINE([PTHREAD_IN_USE_DETECTION_HARD], [1], [Define if the pthread_in_use() detection is hard.]) esac ]) @@ -151,11 +151,11 @@ AC_DEFUN([gl_THREADLIB_BODY], fi if test -n "$gl_have_pthread"; then gl_threads_api=posix - AC_DEFINE([USE_POSIX_THREADS], 1, + AC_DEFINE([USE_POSIX_THREADS], [1], [Define if the POSIX multithreading library can be used.]) if test -n "$LIBMULTITHREAD" || test -n "$LTLIBMULTITHREAD"; then if test $gl_have_weak = yes; then - AC_DEFINE([USE_POSIX_THREADS_WEAK], 1, + AC_DEFINE([USE_POSIX_THREADS_WEAK], [1], [Define if references to the POSIX multithreading library should be made weak.]) LIBTHREAD= LTLIBTHREAD= @@ -180,10 +180,10 @@ AC_DEFUN([gl_THREADLIB_BODY], LTLIBTHREAD=-lthread LIBMULTITHREAD="$LIBTHREAD" LTLIBMULTITHREAD="$LTLIBTHREAD" - AC_DEFINE([USE_SOLARIS_THREADS], 1, + AC_DEFINE([USE_SOLARIS_THREADS], [1], [Define if the old Solaris multithreading library can be used.]) if test $gl_have_weak = yes; then - AC_DEFINE([USE_SOLARIS_THREADS_WEAK], 1, + AC_DEFINE([USE_SOLARIS_THREADS_WEAK], [1], [Define if references to the old Solaris multithreading library should be made weak.]) LIBTHREAD= LTLIBTHREAD= @@ -205,11 +205,11 @@ AC_DEFUN([gl_THREADLIB_BODY], LTLIBTHREAD="$LTLIBPTH" LIBMULTITHREAD="$LIBTHREAD" LTLIBMULTITHREAD="$LTLIBTHREAD" - AC_DEFINE([USE_PTH_THREADS], 1, + AC_DEFINE([USE_PTH_THREADS], [1], [Define if the GNU Pth multithreading library can be used.]) if test -n "$LIBMULTITHREAD" || test -n "$LTLIBMULTITHREAD"; then if test $gl_have_weak = yes; then - AC_DEFINE([USE_PTH_THREADS_WEAK], 1, + AC_DEFINE([USE_PTH_THREADS_WEAK], [1], [Define if references to the GNU Pth multithreading library should be made weak.]) LIBTHREAD= LTLIBTHREAD= @@ -227,7 +227,7 @@ AC_DEFUN([gl_THREADLIB_BODY], esac }; then gl_threads_api=win32 - AC_DEFINE([USE_WIN32_THREADS], 1, + AC_DEFINE([USE_WIN32_THREADS], [1], [Define if the Win32 multithreading API can be used.]) fi fi diff --git a/lib/gl/m4/uintmax_t.m4 b/lib/gl/m4/uintmax_t.m4 index cde46d2e8f..734b6933e2 100644 --- a/lib/gl/m4/uintmax_t.m4 +++ b/lib/gl/m4/uintmax_t.m4 @@ -1,12 +1,12 @@ -# uintmax_t.m4 serial 11 -dnl Copyright (C) 1997-2004, 2007-2008 Free Software Foundation, Inc. +# uintmax_t.m4 serial 12 +dnl Copyright (C) 1997-2004, 2007-2009 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Paul Eggert. -AC_PREREQ(2.13) +AC_PREREQ([2.13]) # Define uintmax_t to 'unsigned long' or 'unsigned long long' # if it is not already defined in <stdint.h> or <inttypes.h>. @@ -24,7 +24,7 @@ AC_DEFUN([gl_AC_TYPE_UINTMAX_T], [Define to unsigned long or unsigned long long if <stdint.h> and <inttypes.h> don't define.]) else - AC_DEFINE([HAVE_UINTMAX_T], 1, + AC_DEFINE([HAVE_UINTMAX_T], [1], [Define if you have the 'uintmax_t' type in <stdint.h> or <inttypes.h>.]) fi ]) diff --git a/lib/gl/m4/unistd_h.m4 b/lib/gl/m4/unistd_h.m4 index 5685273656..ff9a4ea0a5 100644 --- a/lib/gl/m4/unistd_h.m4 +++ b/lib/gl/m4/unistd_h.m4 @@ -1,5 +1,5 @@ -# unistd_h.m4 serial 16 -dnl Copyright (C) 2006-2008 Free Software Foundation, Inc. +# unistd_h.m4 serial 17 +dnl Copyright (C) 2006-2009 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -48,6 +48,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS], GNULIB_GETPAGESIZE=0; AC_SUBST([GNULIB_GETPAGESIZE]) GNULIB_GETUSERSHELL=0; AC_SUBST([GNULIB_GETUSERSHELL]) GNULIB_LCHOWN=0; AC_SUBST([GNULIB_LCHOWN]) + GNULIB_LINK=0; AC_SUBST([GNULIB_LINK]) GNULIB_LSEEK=0; AC_SUBST([GNULIB_LSEEK]) GNULIB_READLINK=0; AC_SUBST([GNULIB_READLINK]) GNULIB_SLEEP=0; AC_SUBST([GNULIB_SLEEP]) @@ -63,6 +64,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS], HAVE_GETHOSTNAME=1; AC_SUBST([HAVE_GETHOSTNAME]) HAVE_GETPAGESIZE=1; AC_SUBST([HAVE_GETPAGESIZE]) HAVE_GETUSERSHELL=1; AC_SUBST([HAVE_GETUSERSHELL]) + HAVE_LINK=1; AC_SUBST([HAVE_LINK]) HAVE_READLINK=1; AC_SUBST([HAVE_READLINK]) HAVE_SLEEP=1; AC_SUBST([HAVE_SLEEP]) HAVE_DECL_ENVIRON=1; AC_SUBST([HAVE_DECL_ENVIRON]) diff --git a/lib/gl/m4/vasnprintf.m4 b/lib/gl/m4/vasnprintf.m4 index 536258c06b..9e839d2bc8 100644 --- a/lib/gl/m4/vasnprintf.m4 +++ b/lib/gl/m4/vasnprintf.m4 @@ -1,5 +1,5 @@ -# vasnprintf.m4 serial 25 -dnl Copyright (C) 2002-2004, 2006-2008 Free Software Foundation, Inc. +# vasnprintf.m4 serial 26 +dnl Copyright (C) 2002-2004, 2006-2009 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -20,7 +20,7 @@ AC_DEFUN([gl_REPLACE_VASNPRINTF], AC_LIBOBJ([printf-parse]) AC_LIBOBJ([asnprintf]) if test $ac_cv_func_vasnprintf = yes; then - AC_DEFINE([REPLACE_VASNPRINTF], 1, + AC_DEFINE([REPLACE_VASNPRINTF], [1], [Define if vasnprintf exists but is overridden by gnulib.]) fi gl_PREREQ_PRINTF_ARGS @@ -58,7 +58,7 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF], AC_REQUIRE([AC_TYPE_LONG_LONG_INT]) AC_REQUIRE([gt_TYPE_WCHAR_T]) AC_REQUIRE([gt_TYPE_WINT_T]) - AC_CHECK_FUNCS(snprintf wcslen) + AC_CHECK_FUNCS([snprintf wcslen]) dnl Use the _snprintf function only if it is declared (because on NetBSD it dnl is defined as a weak alias of snprintf; we prefer to use the latter). AC_CHECK_DECLS([_snprintf], , , [#include <stdio.h>]) @@ -73,7 +73,7 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF_LONG_DOUBLE], *yes) ;; *) - AC_DEFINE([NEED_PRINTF_LONG_DOUBLE], 1, + AC_DEFINE([NEED_PRINTF_LONG_DOUBLE], [1], [Define if the vasnprintf implementation needs special code for 'long double' arguments.]) ;; @@ -89,7 +89,7 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF_INFINITE_DOUBLE], *yes) ;; *) - AC_DEFINE([NEED_PRINTF_INFINITE_DOUBLE], 1, + AC_DEFINE([NEED_PRINTF_INFINITE_DOUBLE], [1], [Define if the vasnprintf implementation needs special code for infinite 'double' arguments.]) ;; @@ -110,7 +110,7 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF_INFINITE_LONG_DOUBLE], *yes) ;; *) - AC_DEFINE([NEED_PRINTF_INFINITE_LONG_DOUBLE], 1, + AC_DEFINE([NEED_PRINTF_INFINITE_LONG_DOUBLE], [1], [Define if the vasnprintf implementation needs special code for infinite 'long double' arguments.]) ;; @@ -127,7 +127,7 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF_DIRECTIVE_A], *yes) ;; *) - AC_DEFINE([NEED_PRINTF_DIRECTIVE_A], 1, + AC_DEFINE([NEED_PRINTF_DIRECTIVE_A], [1], [Define if the vasnprintf implementation needs special code for the 'a' and 'A' directives.]) AC_CHECK_FUNCS([nl_langinfo]) @@ -143,7 +143,7 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF_DIRECTIVE_F], *yes) ;; *) - AC_DEFINE([NEED_PRINTF_DIRECTIVE_F], 1, + AC_DEFINE([NEED_PRINTF_DIRECTIVE_F], [1], [Define if the vasnprintf implementation needs special code for the 'F' directive.]) ;; @@ -158,7 +158,7 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF_FLAG_GROUPING], *yes) ;; *) - AC_DEFINE([NEED_PRINTF_FLAG_GROUPING], 1, + AC_DEFINE([NEED_PRINTF_FLAG_GROUPING], [1], [Define if the vasnprintf implementation needs special code for the ' flag.]) ;; @@ -173,7 +173,7 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF_FLAG_LEFTADJUST], *yes) ;; *) - AC_DEFINE([NEED_PRINTF_FLAG_LEFTADJUST], 1, + AC_DEFINE([NEED_PRINTF_FLAG_LEFTADJUST], [1], [Define if the vasnprintf implementation needs special code for the '-' flag.]) ;; @@ -188,7 +188,7 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF_FLAG_ZERO], *yes) ;; *) - AC_DEFINE([NEED_PRINTF_FLAG_ZERO], 1, + AC_DEFINE([NEED_PRINTF_FLAG_ZERO], [1], [Define if the vasnprintf implementation needs special code for the 0 flag.]) ;; @@ -203,13 +203,13 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF_PRECISION], *yes) ;; *) - AC_DEFINE([NEED_PRINTF_UNBOUNDED_PRECISION], 1, + AC_DEFINE([NEED_PRINTF_UNBOUNDED_PRECISION], [1], [Define if the vasnprintf implementation needs special code for supporting large precisions without arbitrary bounds.]) - AC_DEFINE([NEED_PRINTF_DOUBLE], 1, + AC_DEFINE([NEED_PRINTF_DOUBLE], [1], [Define if the vasnprintf implementation needs special code for 'double' arguments.]) - AC_DEFINE([NEED_PRINTF_LONG_DOUBLE], 1, + AC_DEFINE([NEED_PRINTF_LONG_DOUBLE], [1], [Define if the vasnprintf implementation needs special code for 'long double' arguments.]) ;; @@ -225,13 +225,13 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF_ENOMEM], *yes) ;; *) - AC_DEFINE([NEED_PRINTF_ENOMEM], 1, + AC_DEFINE([NEED_PRINTF_ENOMEM], [1], [Define if the vasnprintf implementation needs special code for surviving out-of-memory conditions.]) - AC_DEFINE([NEED_PRINTF_DOUBLE], 1, + AC_DEFINE([NEED_PRINTF_DOUBLE], [1], [Define if the vasnprintf implementation needs special code for 'double' arguments.]) - AC_DEFINE([NEED_PRINTF_LONG_DOUBLE], 1, + AC_DEFINE([NEED_PRINTF_LONG_DOUBLE], [1], [Define if the vasnprintf implementation needs special code for 'long double' arguments.]) ;; diff --git a/lib/gl/m4/wchar_t.m4 b/lib/gl/m4/wchar_t.m4 index 3c81564adc..fb27a7f65f 100644 --- a/lib/gl/m4/wchar_t.m4 +++ b/lib/gl/m4/wchar_t.m4 @@ -1,5 +1,5 @@ -# wchar_t.m4 serial 2 (gettext-0.18) -dnl Copyright (C) 2002-2003, 2008 Free Software Foundation, Inc. +# wchar_t.m4 serial 3 (gettext-0.18) +dnl Copyright (C) 2002-2003, 2008, 2009 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -15,6 +15,6 @@ AC_DEFUN([gt_TYPE_WCHAR_T], wchar_t foo = (wchar_t)'\0';], , [gt_cv_c_wchar_t=yes], [gt_cv_c_wchar_t=no])]) if test $gt_cv_c_wchar_t = yes; then - AC_DEFINE([HAVE_WCHAR_T], 1, [Define if you have the 'wchar_t' type.]) + AC_DEFINE([HAVE_WCHAR_T], [1], [Define if you have the 'wchar_t' type.]) fi ]) diff --git a/lib/gl/m4/wint_t.m4 b/lib/gl/m4/wint_t.m4 index 0026a13188..47a4363d79 100644 --- a/lib/gl/m4/wint_t.m4 +++ b/lib/gl/m4/wint_t.m4 @@ -1,5 +1,5 @@ -# wint_t.m4 serial 3 (gettext-0.18) -dnl Copyright (C) 2003, 2007-2008 Free Software Foundation, Inc. +# wint_t.m4 serial 4 (gettext-0.18) +dnl Copyright (C) 2003, 2007-2009 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -23,6 +23,6 @@ AC_DEFUN([gt_TYPE_WINT_T], wint_t foo = (wchar_t)'\0';], , [gt_cv_c_wint_t=yes], [gt_cv_c_wint_t=no])]) if test $gt_cv_c_wint_t = yes; then - AC_DEFINE([HAVE_WINT_T], 1, [Define if you have the 'wint_t' type.]) + AC_DEFINE([HAVE_WINT_T], [1], [Define if you have the 'wint_t' type.]) fi ]) diff --git a/lib/gl/stdint.in.h b/lib/gl/stdint.in.h index 51ac462d95..7cbfc2cf7e 100644 --- a/lib/gl/stdint.in.h +++ b/lib/gl/stdint.in.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2001-2002, 2004-2008 Free Software Foundation, Inc. +/* Copyright (C) 2001-2002, 2004-2009 Free Software Foundation, Inc. Written by Paul Eggert, Bruno Haible, Sam Steingold, Peter Burwood. This file is part of gnulib. @@ -478,7 +478,9 @@ typedef int _verify_intmax_size[2 * (sizeof (intmax_t) == sizeof (uintmax_t)) - includes <wchar.h> -> <stdio.h> -> <getopt.h> -> <stdlib.h>, and the latter includes <stdint.h> and assumes its types are already defined. */ #if ! (defined WCHAR_MIN && defined WCHAR_MAX) +# define _GL_JUST_INCLUDE_SYSTEM_WCHAR_H # include <wchar.h> +# undef _GL_JUST_INCLUDE_SYSTEM_WCHAR_H #endif #undef WCHAR_MIN #undef WCHAR_MAX diff --git a/lib/gl/stdio.in.h b/lib/gl/stdio.in.h index 3b61879cda..6610fed54b 100644 --- a/lib/gl/stdio.in.h +++ b/lib/gl/stdio.in.h @@ -216,6 +216,38 @@ extern int vsprintf (char *str, const char *format, va_list args) vsprintf (b, f, a)) #endif +#if @GNULIB_DPRINTF@ +# if @REPLACE_DPRINTF@ +# define dprintf rpl_dprintf +# endif +# if @REPLACE_DPRINTF@ || !@HAVE_DPRINTF@ +extern int dprintf (int fd, const char *format, ...) + __attribute__ ((__format__ (__printf__, 2, 3))); +# endif +#elif defined GNULIB_POSIXCHECK +# undef dprintf +# define dprintf(d,f,a) \ + (GL_LINK_WARNING ("dprintf is unportable - " \ + "use gnulib module dprintf for portability"), \ + dprintf (d, f, a)) +#endif + +#if @GNULIB_VDPRINTF@ +# if @REPLACE_VDPRINTF@ +# define vdprintf rpl_vdprintf +# endif +# if @REPLACE_VDPRINTF@ || !@HAVE_VDPRINTF@ +extern int vdprintf (int fd, const char *format, va_list args) + __attribute__ ((__format__ (__printf__, 2, 0))); +# endif +#elif defined GNULIB_POSIXCHECK +# undef vdprintf +# define vdprintf(d,f,a) \ + (GL_LINK_WARNING ("vdprintf is unportable - " \ + "use gnulib module vdprintf for portability"), \ + vdprintf (d, f, a)) +#endif + #if @GNULIB_VASPRINTF@ # if @REPLACE_VASPRINTF@ # define asprintf rpl_asprintf diff --git a/lib/gl/sys_stat.in.h b/lib/gl/sys_stat.in.h index f46b4d77e9..c20df22bd1 100644 --- a/lib/gl/sys_stat.in.h +++ b/lib/gl/sys_stat.in.h @@ -1,5 +1,5 @@ /* Provide a more complete sys/stat header file. - Copyright (C) 2005-2008 Free Software Foundation, Inc. + Copyright (C) 2005-2009 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 @@ -35,6 +35,9 @@ #ifndef _GL_SYS_STAT_H +/* Get nlink_t. */ +#include <sys/types.h> + /* The include_next requires a split double-inclusion guard. */ #@INCLUDE_NEXT@ @NEXT_SYS_STAT_H@ diff --git a/lib/gl/tests/test-unistd.c b/lib/gl/tests/test-unistd.c index dc15bda0df..5fed15cf9f 100644 --- a/lib/gl/tests/test-unistd.c +++ b/lib/gl/tests/test-unistd.c @@ -1,5 +1,5 @@ /* Test of <unistd.h> substitute. - Copyright (C) 2007 Free Software Foundation, Inc. + Copyright (C) 2007, 2009 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -23,6 +23,12 @@ /* Check that the various SEEK_* macros are defined. */ int sk[] = { SEEK_CUR, SEEK_END, SEEK_SET }; +/* Check that the various *_FILENO macros are defined. */ +#if ! (defined STDIN_FILENO \ + && (STDIN_FILENO + STDOUT_FILENO + STDERR_FILENO == 3)) +missing or broken *_FILENO macros +#endif + /* Check that the types are all defined. */ size_t t1; ssize_t t2; diff --git a/lib/gl/unistd.in.h b/lib/gl/unistd.in.h index 4b6c4b901e..c1a2d2ba99 100644 --- a/lib/gl/unistd.in.h +++ b/lib/gl/unistd.in.h @@ -1,5 +1,5 @@ /* Substitute for and wrapper around <unistd.h>. - Copyright (C) 2003-2008 Free Software Foundation, Inc. + Copyright (C) 2003-2009 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 @@ -29,7 +29,7 @@ #ifndef _GL_UNISTD_H #define _GL_UNISTD_H -/* mingw doesn't define the SEEK_* macros in <unistd.h>. */ +/* mingw doesn't define the SEEK_* or *_FILENO macros in <unistd.h>. */ #if !(defined SEEK_CUR && defined SEEK_END && defined SEEK_SET) # include <stdio.h> #endif @@ -87,6 +87,17 @@ /* The definition of GL_LINK_WARNING is copied here. */ +/* OS/2 EMX lacks these macros. */ +#ifndef STDIN_FILENO +# define STDIN_FILENO 0 +#endif +#ifndef STDOUT_FILENO +# define STDOUT_FILENO 1 +#endif +#ifndef STDERR_FILENO +# define STDERR_FILENO 2 +#endif + /* Declare overridden functions. */ #ifdef __cplusplus @@ -475,6 +486,23 @@ extern int lchown (char const *file, uid_t owner, gid_t group); #endif +#if @GNULIB_LINK@ +/* Create a new hard link for an existing file. + Return 0 if successful, otherwise -1 and errno set. + See POSIX:2001 specification + <http://www.opengroup.org/susv3xsh/link.html>. */ +# if !@HAVE_LINK@ +extern int link (const char *path1, const char *path2); +# endif +#elif defined GNULIB_POSIXCHECK +# undef link +# define link(path1,path2) \ + (GL_LINK_WARNING ("link is unportable - " \ + "use gnulib module link for portability"), \ + link (path1, path2)) +#endif + + #if @GNULIB_LSEEK@ # if @REPLACE_LSEEK@ /* Set the offset of FD relative to SEEK_SET, SEEK_CUR, or SEEK_END. diff --git a/lib/gl/wchar.in.h b/lib/gl/wchar.in.h index 09fc326905..89d6036c31 100644 --- a/lib/gl/wchar.in.h +++ b/lib/gl/wchar.in.h @@ -1,6 +1,6 @@ /* A substitute for ISO C99 <wchar.h>, for platforms that have issues. - Copyright (C) 2007-2008 Free Software Foundation, Inc. + Copyright (C) 2007-2009 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 @@ -30,8 +30,18 @@ @PRAGMA_SYSTEM_HEADER@ #endif -#ifdef __need_mbstate_t -/* Special invocation convention inside uClibc header files. */ +#if defined __need_mbstate_t || (defined __hpux && ((defined _INTTYPES_INCLUDED && !defined strtoimax) || defined _GL_JUST_INCLUDE_SYSTEM_WCHAR_H)) || defined _GL_ALREADY_INCLUDING_WCHAR_H +/* Special invocation convention: + - Inside uClibc header files. + - On HP-UX 11.00 we have a sequence of nested includes + <wchar.h> -> <stdlib.h> -> <stdint.h>, and the latter includes <wchar.h>, + once indirectly <stdint.h> -> <sys/types.h> -> <inttypes.h> -> <wchar.h> + and once directly. In both situations 'wint_t' is not yet defined, + therefore we cannot provide the function overrides; instead include only + the system's <wchar.h>. + - On IRIX 6.5, similarly, we have an include <wchar.h> -> <wctype.h>, and + the latter includes <wchar.h>. But here, we have no way to detect whether + <wctype.h> is completely included or is still being included. */ #@INCLUDE_NEXT@ @NEXT_WCHAR_H@ @@ -40,6 +50,8 @@ #ifndef _GL_WCHAR_H +#define _GL_ALREADY_INCLUDING_WCHAR_H + /* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before <wchar.h>. BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be @@ -55,6 +67,8 @@ # @INCLUDE_NEXT@ @NEXT_WCHAR_H@ #endif +#undef _GL_ALREADY_INCLUDING_WCHAR_H + #ifndef _GL_WCHAR_H #define _GL_WCHAR_H |