]> xenbits.xensource.com Git - libvirt.git/commitdiff
update from gnulib
authorJim Meyering <meyering@redhat.com>
Tue, 29 Apr 2008 19:52:26 +0000 (19:52 +0000)
committerJim Meyering <meyering@redhat.com>
Tue, 29 Apr 2008 19:52:26 +0000 (19:52 +0000)
* gnulib/lib/inet_ntop.h: Remove file.
* gnulib/m4/onceonly_2_57.m4: Remove file.
* build-aux/useless-if-before-free: Update.
* build-aux/vc-list-files: Update.
* gnulib/lib/.cvsignore: Update.
* gnulib/lib/Makefile.am: Update.
* gnulib/lib/fseeko.c: Update.
* gnulib/lib/getaddrinfo.c: Update.
* gnulib/lib/getdelim.c: Update.
* gnulib/lib/inet_ntop.c: Update.
* gnulib/lib/inet_ntop.h: Update.
* gnulib/lib/poll.c: Update.
* gnulib/lib/snprintf.c: Update.
* gnulib/lib/stdlib.in.h: Update.
* gnulib/lib/string.in.h: Update.
* gnulib/lib/sys_socket.in.h: Update.
* gnulib/lib/sys_stat.in.h: Update.
* gnulib/lib/vasnprintf.c: Update.
* gnulib/lib/vasprintf.c: Update.
* gnulib/lib/wchar.in.h: Update.
* gnulib/m4/arpa_inet_h.m4: Update.
* gnulib/m4/extensions.m4: Update.
* gnulib/m4/gnulib-common.m4: Update.
* gnulib/m4/gnulib-comp.m4: Update.
* gnulib/m4/include_next.m4: Update.
* gnulib/m4/inet_ntop.m4: Update.
* gnulib/m4/netinet_in_h.m4: Update.
* gnulib/m4/onceonly_2_57.m4: Update.
* gnulib/m4/physmem.m4: Update.
* gnulib/m4/snprintf.m4: Update.
* gnulib/m4/stdint.m4: Update.
* gnulib/m4/stdio_h.m4: Update.
* gnulib/m4/stdlib_h.m4: Update.
* gnulib/m4/string_h.m4: Update.
* gnulib/m4/strndup.m4: Update.
* gnulib/m4/sys_select_h.m4: Update.
* gnulib/m4/sys_socket_h.m4: Update.
* gnulib/m4/sys_stat_h.m4: Update.
* gnulib/m4/vasnprintf.m4: Update.
* gnulib/tests/Makefile.am: Update.
* gnulib/tests/test-fseeko.c: Update.
* gnulib/tests/test-getaddrinfo.c: Update.
* gnulib/tests/test-getdelim.c: Update.
* gnulib/tests/test-getline.c: Update.
* gnulib/tests/test-lseek.c: Update.
* gnulib/tests/test-snprintf.c: Update.
* gnulib/tests/test-sys_stat.c: Update.
* gnulib/tests/test-vasnprintf.c: Update.
* gnulib/tests/test-vasprintf.c: Update.

48 files changed:
ChangeLog
build-aux/useless-if-before-free
build-aux/vc-list-files
gnulib/lib/.cvsignore
gnulib/lib/Makefile.am
gnulib/lib/fseeko.c
gnulib/lib/getaddrinfo.c
gnulib/lib/getdelim.c
gnulib/lib/inet_ntop.c
gnulib/lib/inet_ntop.h [deleted file]
gnulib/lib/poll.c
gnulib/lib/snprintf.c
gnulib/lib/stdlib.in.h
gnulib/lib/string.in.h
gnulib/lib/sys_socket.in.h
gnulib/lib/sys_stat.in.h
gnulib/lib/vasnprintf.c
gnulib/lib/vasprintf.c
gnulib/lib/wchar.in.h
gnulib/m4/arpa_inet_h.m4
gnulib/m4/extensions.m4
gnulib/m4/gnulib-common.m4
gnulib/m4/gnulib-comp.m4
gnulib/m4/include_next.m4
gnulib/m4/inet_ntop.m4
gnulib/m4/netinet_in_h.m4
gnulib/m4/onceonly_2_57.m4 [deleted file]
gnulib/m4/physmem.m4
gnulib/m4/snprintf.m4
gnulib/m4/stdint.m4
gnulib/m4/stdio_h.m4
gnulib/m4/stdlib_h.m4
gnulib/m4/string_h.m4
gnulib/m4/strndup.m4
gnulib/m4/sys_select_h.m4
gnulib/m4/sys_socket_h.m4
gnulib/m4/sys_stat_h.m4
gnulib/m4/vasnprintf.m4
gnulib/tests/Makefile.am
gnulib/tests/test-fseeko.c
gnulib/tests/test-getaddrinfo.c
gnulib/tests/test-getdelim.c
gnulib/tests/test-getline.c
gnulib/tests/test-lseek.c
gnulib/tests/test-snprintf.c
gnulib/tests/test-sys_stat.c
gnulib/tests/test-vasnprintf.c
gnulib/tests/test-vasprintf.c

index 43a6f19f80835ce72cf422a74a69d5cbda37cb6d..401a72499bfdbccfab0c80d18a5b1f6c808fb1e9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,56 @@
 Tue Apr 29 21:43:28 CEST 2008 Jim Meyering <meyering@redhat.com>
 
+       update from gnulib
+       * gnulib/lib/inet_ntop.h: Remove file.
+       * gnulib/m4/onceonly_2_57.m4: Remove file.
+       * build-aux/useless-if-before-free: Update.
+       * build-aux/vc-list-files: Update.
+       * gnulib/lib/.cvsignore: Update.
+       * gnulib/lib/Makefile.am: Update.
+       * gnulib/lib/fseeko.c: Update.
+       * gnulib/lib/getaddrinfo.c: Update.
+       * gnulib/lib/getdelim.c: Update.
+       * gnulib/lib/inet_ntop.c: Update.
+       * gnulib/lib/inet_ntop.h: Update.
+       * gnulib/lib/poll.c: Update.
+       * gnulib/lib/snprintf.c: Update.
+       * gnulib/lib/stdlib.in.h: Update.
+       * gnulib/lib/string.in.h: Update.
+       * gnulib/lib/sys_socket.in.h: Update.
+       * gnulib/lib/sys_stat.in.h: Update.
+       * gnulib/lib/vasnprintf.c: Update.
+       * gnulib/lib/vasprintf.c: Update.
+       * gnulib/lib/wchar.in.h: Update.
+       * gnulib/m4/arpa_inet_h.m4: Update.
+       * gnulib/m4/extensions.m4: Update.
+       * gnulib/m4/gnulib-common.m4: Update.
+       * gnulib/m4/gnulib-comp.m4: Update.
+       * gnulib/m4/include_next.m4: Update.
+       * gnulib/m4/inet_ntop.m4: Update.
+       * gnulib/m4/netinet_in_h.m4: Update.
+       * gnulib/m4/onceonly_2_57.m4: Update.
+       * gnulib/m4/physmem.m4: Update.
+       * gnulib/m4/snprintf.m4: Update.
+       * gnulib/m4/stdint.m4: Update.
+       * gnulib/m4/stdio_h.m4: Update.
+       * gnulib/m4/stdlib_h.m4: Update.
+       * gnulib/m4/string_h.m4: Update.
+       * gnulib/m4/strndup.m4: Update.
+       * gnulib/m4/sys_select_h.m4: Update.
+       * gnulib/m4/sys_socket_h.m4: Update.
+       * gnulib/m4/sys_stat_h.m4: Update.
+       * gnulib/m4/vasnprintf.m4: Update.
+       * gnulib/tests/Makefile.am: Update.
+       * gnulib/tests/test-fseeko.c: Update.
+       * gnulib/tests/test-getaddrinfo.c: Update.
+       * gnulib/tests/test-getdelim.c: Update.
+       * gnulib/tests/test-getline.c: Update.
+       * gnulib/tests/test-lseek.c: Update.
+       * gnulib/tests/test-snprintf.c: Update.
+       * gnulib/tests/test-sys_stat.c: Update.
+       * gnulib/tests/test-vasnprintf.c: Update.
+       * gnulib/tests/test-vasprintf.c: Update.
+
        remove useless tests before xmlFree
        * src/qemu_conf.c (qemudParseDiskXML, qemudParseInterfaceXML):
        (qemudParseInputXML, qemudParseDhcpRangesXML):
index 626d19ab2b57763c1ce6e56c015778cebae33ef3..89e785962616540c28077bf5906cc54cb7a3f248 100755 (executable)
@@ -2,7 +2,7 @@
 # Detect instances of "if (p) free (p);".
 # Likewise for "if (p != NULL) free (p);".  And with braces.
 
-my $VERSION = '2008-03-12 13:06'; # UTC
+my $VERSION = '2008-04-29 17:55'; # UTC
 # The definition above must lie within the first 8 lines in order
 # for the Emacs time-stamp write hook (at end) to update it.
 # If you change this file with Emacs, please let the write hook
@@ -123,8 +123,8 @@ EOF
         {
           if ($line =~
               /\b(if\s*\(\s*(\S+?)(?:\s*!=\s*NULL)?\s*\)
-               (?:   \s*$regexp\s*\((?:\s*\([^)]+\))\s*\2\s*\)|
-                \s*\{\s*$regexp\s*\((?:\s*\([^)]+\))\s*\2\s*\)\s*;\s*\}))/sx)
+               (?:   \s*$regexp\s*\((?:\s*\([^)]+\))?\s*\2\s*\)|
+                \s*\{\s*$regexp\s*\((?:\s*\([^)]+\))?\s*\2\s*\)\s*;\s*\}))/sx)
             {
               $found_match = 1;
               $list
index 1e158bb521e219fa4dfa0327ee40e9c826eba563..762d7eeb366487d169d2e513280d6b0893d6985c 100755 (executable)
@@ -1,6 +1,9 @@
 #!/bin/sh
 # List version-controlled file names.
 
+# Print a version string.
+scriptversion=2008-04-03.17
+
 # Copyright (C) 2006-2008 Free Software Foundation, Inc.
 
 # This program is free software: you can redistribute it and/or modify
 # List the specified version-controlled files.
 # With no argument, list them all.  With a single DIRECTORY argument,
 # list the version-controlled files in that directory.
-# This script must be run solely from the top of a $srcdir build directory.
 
 # If there's an argument, it must be a single, "."-relative directory name.
 # cvsu is part of the cvsutils package: http://www.red-bean.com/cvsutils/
 
+postprocess=
+case $1 in
+  --help) cat <<EOF
+Usage: $0 [-C SRCDIR] [DIR]
+
+Output a list of version-controlled files in DIR (default .), relative to
+SRCDIR (default .).  SRCDIR must be the top directory of a checkout.
+
+Options:
+  --help     print this help, then exit
+  --version  print version number, then exit
+  -C SRCDIR  change directory to SRCDIR before generating list
+
+Report bugs and patches to <bug-gnulib@gnu.org>.
+EOF
+    exit ;;
+
+  --version)
+    year=`echo "$scriptversion" | sed 's/[^0-9].*//'`
+    cat <<EOF
+vc-list-files $scriptversion
+Copyright (C) $year Free Software Foundation, Inc,
+License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
+This is free software: you are free to change and redistribute it.
+There is NO WARRANTY, to the extent permitted by law.
+EOF
+    exit ;;
+
+  -C)
+    test "$2" = . || postprocess="| sed 's|^|$2/|'"
+    cd "$2" || exit 1
+    shift; shift ;;
+esac
+
 dir=
 case $# in
   0) ;;
   1) dir=$1 ;;
   *) echo "$0: too many arguments" 1>&2
-     echo "Usage: $0 [DIR]" 1>&2; exit 1;;
+     echo "Usage: $0 [-C srcdir] [DIR]" 1>&2; exit 1;;
 esac
 
 test "x$dir" = x && dir=.
 
 if test -d .git; then
-  exec git ls-files "$dir"
+  eval exec git ls-files '"$dir"' $postprocess
 elif test -d .hg; then
-  exec hg locate "$dir/*"
+  eval exec hg locate '"$dir/*"' $postprocess
 elif test -d CVS; then
   if test -x build-aux/cvsu; then
-    build-aux/cvsu --find --types=AFGM "$dir"
+    eval build-aux/cvsu --find --types=AFGM '"$dir"' $postprocess
+  elif (cvsu --help) >/dev/null 2>&1; then
+    eval cvsu --find --types=AFGM '"$dir"' $postprocess
   else
-    awk -F/ '{                         \
+    eval awk -F/ \''{                  \
        if (!$1 && $3 !~ /^-/) {        \
          f=FILENAME;                   \
          sub(/CVS\/Entries/, "", f);   \
          print f $2;                   \
-       }}'                             \
-      $(find ${*-*} -name Entries -print) /dev/null;
+       }}'\''                          \
+      $(find ${*-*} -name Entries -print) /dev/null' $postprocess
   fi
 else
-  echo "$0: Failed to determine type of version control used in "`pwd` 1>&2
+  echo "$0: Failed to determine type of version control used in `pwd`" 1>&2
   exit 1
 fi
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
index 0f10d7fbb0244e465843b4c346125fab052a98e6..315947a2e8f1e9b59ad6d801ba096e987ee8a8db 100644 (file)
@@ -5,6 +5,7 @@
 Makefile
 Makefile.in
 alloca.h
+arpa_inet.h
 float.h
 netinet_in.h
 poll.h
index 0321687d9dc08f272e74bce13e71d1afcc52a48d..ad0a92f7fb5895217ecff33e631c5e0df4c58f20 100644 (file)
@@ -62,12 +62,21 @@ arpa/inet.h:
        @MKDIR_P@ arpa
        rm -f $@-t $@
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
-         echo '#include <sys/socket.h>'; \
+         sed -e 's/@''INCLUDE_NEXT''@/$(INCLUDE_NEXT)/g' \
+             -e 's|@''NEXT_ARPA_INET_H''@|$(NEXT_ARPA_INET_H)|g' \
+             -e 's|@''HAVE_ARPA_INET_H''@|$(HAVE_ARPA_INET_H)|g' \
+             -e 's|@''GNULIB_INET_NTOP''@|$(GNULIB_INET_NTOP)|g' \
+             -e 's|@''GNULIB_INET_PTON''@|$(GNULIB_INET_PTON)|g' \
+             -e 's|@''HAVE_DECL_INET_NTOP''@|$(HAVE_DECL_INET_NTOP)|g' \
+             -e 's|@''HAVE_DECL_INET_PTON''@|$(HAVE_DECL_INET_PTON)|g' \
+             < $(srcdir)/arpa_inet.in.h; \
        } > $@-t
        mv $@-t $@
 MOSTLYCLEANFILES += arpa/inet.h arpa/inet.h-t
 MOSTLYCLEANDIRS += arpa
 
+EXTRA_DIST += arpa_inet.in.h
+
 ## end   gnulib module arpa_inet
 
 ## begin gnulib module float
@@ -93,7 +102,7 @@ EXTRA_DIST += float.in.h
 ## begin gnulib module fseeko
 
 
-EXTRA_DIST += fseeko.c
+EXTRA_DIST += fseeko.c stdio-impl.h
 
 EXTRA_libgnu_la_SOURCES += fseeko.c
 
@@ -167,7 +176,7 @@ EXTRA_DIST += $(top_srcdir)/build-aux/config.rpath
 ## begin gnulib module inet_ntop
 
 
-EXTRA_DIST += inet_ntop.c inet_ntop.h
+EXTRA_DIST += inet_ntop.c
 
 EXTRA_libgnu_la_SOURCES += inet_ntop.c
 
@@ -433,17 +442,22 @@ stdlib.h: stdlib.in.h
              -e 's|@''GNULIB_MKDTEMP''@|$(GNULIB_MKDTEMP)|g' \
              -e 's|@''GNULIB_MKSTEMP''@|$(GNULIB_MKSTEMP)|g' \
              -e 's|@''GNULIB_PUTENV''@|$(GNULIB_PUTENV)|g' \
+             -e 's|@''GNULIB_RPMATCH''@|$(GNULIB_RPMATCH)|g' \
              -e 's|@''GNULIB_SETENV''@|$(GNULIB_SETENV)|g' \
+             -e 's|@''GNULIB_STRTOD''@|$(GNULIB_STRTOD)|g' \
              -e 's|@''GNULIB_UNSETENV''@|$(GNULIB_UNSETENV)|g' \
              -e 's|@''HAVE_CALLOC_POSIX''@|$(HAVE_CALLOC_POSIX)|g' \
              -e 's|@''HAVE_GETSUBOPT''@|$(HAVE_GETSUBOPT)|g' \
              -e 's|@''HAVE_MALLOC_POSIX''@|$(HAVE_MALLOC_POSIX)|g' \
              -e 's|@''HAVE_MKDTEMP''@|$(HAVE_MKDTEMP)|g' \
              -e 's|@''HAVE_REALLOC_POSIX''@|$(HAVE_REALLOC_POSIX)|g' \
+             -e 's|@''HAVE_RPMATCH''@|$(HAVE_RPMATCH)|g' \
              -e 's|@''HAVE_SETENV''@|$(HAVE_SETENV)|g' \
+             -e 's|@''HAVE_STRTOD''@|$(HAVE_STRTOD)|g' \
              -e 's|@''HAVE_UNSETENV''@|$(HAVE_UNSETENV)|g' \
              -e 's|@''REPLACE_MKSTEMP''@|$(REPLACE_MKSTEMP)|g' \
              -e 's|@''REPLACE_PUTENV''@|$(REPLACE_PUTENV)|g' \
+             -e 's|@''REPLACE_STRTOD''@|$(REPLACE_STRTOD)|g' \
              -e 's|@''VOID_UNSETENV''@|$(VOID_UNSETENV)|g' \
              -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
              < $(srcdir)/stdlib.in.h; \
@@ -492,6 +506,7 @@ string.h: string.in.h
              -e 's|@''GNULIB_MEMMEM''@|$(GNULIB_MEMMEM)|g' \
              -e 's|@''GNULIB_MEMPCPY''@|$(GNULIB_MEMPCPY)|g' \
              -e 's|@''GNULIB_MEMRCHR''@|$(GNULIB_MEMRCHR)|g' \
+             -e 's|@''GNULIB_RAWMEMCHR''@|$(GNULIB_RAWMEMCHR)|g' \
              -e 's|@''GNULIB_STPCPY''@|$(GNULIB_STPCPY)|g' \
              -e 's|@''GNULIB_STPNCPY''@|$(GNULIB_STPNCPY)|g' \
              -e 's|@''GNULIB_STRCHRNUL''@|$(GNULIB_STRCHRNUL)|g' \
@@ -508,6 +523,7 @@ string.h: string.in.h
              -e 's|@''HAVE_DECL_MEMMEM''@|$(HAVE_DECL_MEMMEM)|g' \
              -e 's|@''HAVE_MEMPCPY''@|$(HAVE_MEMPCPY)|g' \
              -e 's|@''HAVE_DECL_MEMRCHR''@|$(HAVE_DECL_MEMRCHR)|g' \
+             -e 's|@''HAVE_RAWMEMCHR''@|$(HAVE_RAWMEMCHR)|g' \
              -e 's|@''HAVE_STPCPY''@|$(HAVE_STPCPY)|g' \
              -e 's|@''HAVE_STPNCPY''@|$(HAVE_STPNCPY)|g' \
              -e 's|@''HAVE_STRCHRNUL''@|$(HAVE_STRCHRNUL)|g' \
@@ -631,9 +647,8 @@ sys/stat.h: sys_stat.in.h
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
          sed -e 's/@''INCLUDE_NEXT''@/$(INCLUDE_NEXT)/g' \
              -e 's|@''NEXT_SYS_STAT_H''@|$(NEXT_SYS_STAT_H)|g' \
-             -e 's|@''HAVE_IO_H''@|$(HAVE_IO_H)|g' \
              -e 's|@''HAVE_LSTAT''@|$(HAVE_LSTAT)|g' \
-             -e 's|@''HAVE_DECL_MKDIR''@|$(HAVE_DECL_MKDIR)|g' \
+             -e 's|@''REPLACE_MKDIR''@|$(REPLACE_MKDIR)|g' \
              < $(srcdir)/sys_stat.in.h; \
        } > $@-t
        mv $@-t $@
index 8543d429edb485473f18c00c57bed5238d53222f..17e5f165d8a4f0a877dcaec2640c9ebfbcf52603 100644 (file)
@@ -1,5 +1,5 @@
 /* An fseeko() function that, together with fflush(), is POSIX compliant.
-   Copyright (C) 2007 Free Software Foundation, Inc.
+   Copyright (C) 2007-2008 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
@@ -23,6 +23,8 @@
 /* Get off_t and lseek.  */
 #include <unistd.h>
 
+#include "stdio-impl.h"
+
 #undef fseeko
 #if !HAVE_FSEEKO
 # undef fseek
@@ -39,18 +41,11 @@ rpl_fseeko (FILE *fp, off_t offset, int whence)
 #endif
 
   /* These tests are based on fpurge.c.  */
-#if defined _IO_ferror_unlocked     /* GNU libc, BeOS */
+#if defined _IO_ferror_unlocked || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Linux libc5 */
   if (fp->_IO_read_end == fp->_IO_read_ptr
       && fp->_IO_write_ptr == fp->_IO_write_base
       && fp->_IO_save_base == NULL)
-#elif defined __sferror             /* FreeBSD, NetBSD, OpenBSD, MacOS X, Cygwin */
-# if defined __NetBSD__ || defined __OpenBSD__ /* NetBSD, OpenBSD */
-   /* See <http://cvsweb.netbsd.org/bsdweb.cgi/src/lib/libc/stdio/fileext.h?rev=HEAD&content-type=text/x-cvsweb-markup>
-      and <http://www.openbsd.org/cgi-bin/cvsweb/src/lib/libc/stdio/fileext.h?rev=HEAD&content-type=text/x-cvsweb-markup> */
-#  define fp_ub ((struct { struct __sbuf _ub; } *) fp->_ext._base)->_ub
-# else                                         /* FreeBSD, MacOS X, Cygwin */
-#  define fp_ub fp->_ub
-# endif
+#elif defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, MacOS X, Cygwin */
 # if defined __SL64 && defined __SCLE /* Cygwin */
   if ((fp->_flags & __SL64) == 0)
     {
@@ -64,27 +59,20 @@ rpl_fseeko (FILE *fp, off_t offset, int whence)
       fclose (tmp);
     }
 # endif
-  if (fp->_p == fp->_bf._base
-      && fp->_r == 0
-      && fp->_w == ((fp->_flags & (__SLBF | __SNBF | __SRD)) == 0 /* fully buffered and not currently reading? */
-                   ? fp->_bf._size
-                   : 0)
+  if (fp_->_p == fp_->_bf._base
+      && fp_->_r == 0
+      && fp_->_w == ((fp_->_flags & (__SLBF | __SNBF | __SRD)) == 0 /* fully buffered and not currently reading? */
+                    ? fp_->_bf._size
+                    : 0)
       && fp_ub._base == NULL)
-#elif defined _IOERR                /* AIX, HP-UX, IRIX, OSF/1, Solaris, mingw */
-# if defined __sun && defined _LP64 /* Solaris/{SPARC,AMD64} 64-bit */
-#  define fp_ ((struct { unsigned char *_ptr; \
-                        unsigned char *_base; \
-                        unsigned char *_end; \
-                        long _cnt; \
-                        int _file; \
-                        unsigned int _flag; \
-                      } *) fp)
+#elif defined __EMX__               /* emx+gcc */
+  if (fp->_ptr == fp->_buffer
+      && fp->_rcount == 0
+      && fp->_wcount == 0
+      && fp->_ungetc_count == 0)
+#elif defined _IOERR                /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw */
   if (fp_->_ptr == fp_->_base
       && (fp_->_ptr == NULL || fp_->_cnt == 0))
-# else
-  if (fp->_ptr == fp->_base
-      && (fp->_ptr == NULL || fp->_cnt == 0))
-# endif
 #elif defined __UCLIBC__            /* uClibc */
   if (((fp->__modeflags & __FLAG_WRITING) == 0
        || fp->__bufpos == fp->__bufstart)
@@ -101,18 +89,20 @@ rpl_fseeko (FILE *fp, off_t offset, int whence)
       off_t pos = lseek (fileno (fp), offset, whence);
       if (pos == -1)
        {
-#if defined __sferror               /* FreeBSD, NetBSD, OpenBSD, MacOS X, Cygwin */
-         fp->_flags &= ~__SOFF;
+#if defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, MacOS X, Cygwin */
+         fp_->_flags &= ~__SOFF;
 #endif
          return -1;
        }
       else
        {
-#if defined __sferror               /* FreeBSD, NetBSD, OpenBSD, MacOS X, Cygwin */
-         fp->_offset = pos;
-         fp->_flags |= __SOFF;
-         fp->_flags &= ~__SEOF;
-#elif defined _IOERR                /* AIX, HP-UX, IRIX, OSF/1, Solaris, mingw */
+#if 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;
+#elif defined _IOERR                /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw */
           fp->_flag &= ~_IOEOF;
 #endif
          return 0;
index 56fd700649ffcb5f2a10a7de3c6a687ac791b69f..6066a8e678fab98608333509b20a319560a9a69a 100644 (file)
@@ -1,5 +1,5 @@
 /* Get address information (partial implementation).
-   Copyright (C) 1997, 2001, 2002, 2004, 2005, 2006, 2007 Free Software
+   Copyright (C) 1997, 2001, 2002, 2004, 2005, 2006, 2007, 2008 Free Software
    Foundation, Inc.
    Contributed by Simon Josefsson <simon@josefsson.org>.
 
@@ -25,6 +25,9 @@
 # include <netinet/in.h>
 #endif
 
+/* Get inet_ntop.  */
+#include <arpa/inet.h>
+
 /* Get calloc. */
 #include <stdlib.h>
 
@@ -40,8 +43,6 @@
 #define _(String) gettext (String)
 #define N_(String) String
 
-#include "inet_ntop.h"
-
 /* BeOS has AF_INET, but not PF_INET.  */
 #ifndef PF_INET
 # define PF_INET AF_INET
index 37cfdc101c108efa39245d60beee85d6209f2c66..b37538ae49ec11508620be6a14ec0f089a8e5bcf 100644 (file)
@@ -1,5 +1,5 @@
 /* getdelim.c --- Implementation of replacement getdelim function.
-   Copyright (C) 1994, 1996, 1997, 1998, 2001, 2003, 2005, 2006, 2007 Free
+   Copyright (C) 1994, 1996, 1997, 1998, 2001, 2003, 2005, 2006, 2007, 2008 Free
    Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or
 # define funlockfile(x) ((void) 0)
 #endif
 
-/* Some systems, like OSF/1 4.0 and Woe32, don't have EOVERFLOW.  */
-#ifndef EOVERFLOW
-# define EOVERFLOW E2BIG
-#endif
-
 /* Read up to (and including) a DELIMITER from FP into *LINEPTR (and
    NUL-terminate it).  *LINEPTR is a pointer returned from malloc (or
    NULL), pointing to *N characters of space.  It is realloc'ed as
index 4c7ff8823858406440b0882d5c653f87ba5b5d64..23b6cfc79a0817fc00451e982da1e14ae47a9aee 100644 (file)
@@ -1,6 +1,6 @@
 /* inet_ntop.c -- convert IPv4 and IPv6 addresses from binary to text form
 
-   Copyright (C) 2005, 2006  Free Software Foundation, Inc.
+   Copyright (C) 2005, 2006, 2008  Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
@@ -36,7 +36,7 @@
 #include <config.h>
 
 /* Specification.  */
-#include "inet_ntop.h"
+#include <arpa/inet.h>
 
 #include <stdio.h>
 #include <string.h>
diff --git a/gnulib/lib/inet_ntop.h b/gnulib/lib/inet_ntop.h
deleted file mode 100644 (file)
index 9cd6215..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/* Convert internet address from internal to printable, presentable format.
-   Copyright (C) 2005, 2006 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
-   the Free Software Foundation; either version 2.1, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public License
-   along with this program; if not, write to the Free Software Foundation,
-   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
-
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-
-/* Converts an internet address from internal format to a printable,
-   presentable format.
-   AF is an internet address family, such as AF_INET or AF_INET6.
-   SRC points to a 'struct in_addr' (for AF_INET) or 'struct in6_addr'
-   (for AF_INET6).
-   DST points to a buffer having room for CNT bytes.
-   The printable representation of the address (in numeric form, not
-   surrounded by [...], no reverse DNS is done) is placed in DST, and
-   DST is returned.  If an error occurs, the return value is NULL and
-   errno is set.  If CNT bytes are not sufficient to hold the result,
-   the return value is NULL and errno is set to ENOSPC.  A good value
-   for CNT is 46.
-
-   For more details, see the POSIX:2001 specification
-   <http://www.opengroup.org/susv3xsh/inet_ntop.html>.  */
-
-#if !HAVE_DECL_INET_NTOP
-extern const char *inet_ntop (int af, const void *restrict src,
-                             char *restrict dst, socklen_t cnt);
-#endif
index aa40d8cd71797dd743e9c2902b4f310af5bb0f74..b92c0f3f5c560f7bf841fbf313632a1964fad929 100644 (file)
 #define INFTIM (-1)
 #endif
 
-#ifndef EOVERFLOW
-#define EOVERFLOW EINVAL
-#endif
-
 /* BeOS does not have MSG_PEEK.  */
 #ifndef MSG_PEEK
 #define MSG_PEEK 0
index 5c45bdc5e563c13554ec6531f6e5e9134212c62f..65434a94c1679fd1c4b4dea1328c78fcc7a12a34 100644 (file)
@@ -1,5 +1,5 @@
 /* Formatted output to strings.
-   Copyright (C) 2004, 2006-2007 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2006-2008 Free Software Foundation, Inc.
    Written by Simon Josefsson and Paul Eggert.
 
    This program is free software; you can redistribute it and/or modify
 
 #include "vasnprintf.h"
 
-/* Some systems, like OSF/1 4.0 and Woe32, don't have EOVERFLOW.  */
-#ifndef EOVERFLOW
-# define EOVERFLOW E2BIG
-#endif
-
 /* Print formatted output to string STR.  Similar to sprintf, but
    additional length SIZE limit how much is written into STR.  Returns
    string length of formatted string (which may be larger than SIZE).
index bc7dc4f9a31bd227944a62d71047a32e26bbfaab..fc6004c1317a96520f1a6881911c3e32438ce9db 100644 (file)
@@ -1,6 +1,6 @@
 /* A GNU-like <stdlib.h>.
 
-   Copyright (C) 1995, 2001-2004, 2006-2007 Free Software Foundation, Inc.
+   Copyright (C) 1995, 2001-2004, 2006-2008 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
@@ -176,6 +176,21 @@ extern int putenv (char *string);
 #endif
 
 
+#if @GNULIB_RPMATCH@
+# if !@HAVE_RPMATCH@
+/* Test a user response to a question.
+   Return 1 if it is affirmative, 0 if it is negative, or -1 if not clear.  */
+extern int rpmatch (const char *response);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef rpmatch
+# define rpmatch(r) \
+    (GL_LINK_WARNING ("rpmatch is unportable - " \
+                      "use gnulib module rpmatch for portability"), \
+     rpmatch (r))
+#endif
+
+
 #if @GNULIB_SETENV@
 # if !@HAVE_SETENV@
 /* Set NAME to VALUE in the environment.
@@ -199,6 +214,23 @@ extern int unsetenv (const char *name);
 #endif
 
 
+#if @GNULIB_STRTOD@
+# if @REPLACE_STRTOD@
+#  define strtod rpl_strtod
+# endif
+# if !@HAVE_STRTOD@ || @REPLACE_STRTOD@
+ /* Parse a double from STRING, updating ENDP if appropriate.  */
+extern double strtod (const char *str, char **endp);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef strtod
+# define strtod(s, e)                           \
+    (GL_LINK_WARNING ("strtod is unportable - " \
+                      "use gnulib module strtod for portability"), \
+     strtod (s, e))
+#endif
+
+
 #ifdef __cplusplus
 }
 #endif
index b10a4914381959c6366feed2ec4b474753bb468a..e1086ca32c7be401ec97551035c5e734e42229de 100644 (file)
@@ -93,6 +93,22 @@ extern void *memrchr (void const *, int, size_t)
      memrchr (a, b, c))
 #endif
 
+/* Find the first occurrence of C in S.  More efficient than
+   memchr(S,C,N), at the expense of undefined behavior if C does not
+   occur within N bytes.  */
+#if @GNULIB_RAWMEMCHR@
+# if ! @HAVE_RAWMEMCHR@
+extern void *rawmemchr (void const *__s, int __c_in)
+  __attribute__ ((__pure__));
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef rawmemchr
+# define rawmemchr(a,b) \
+    (GL_LINK_WARNING ("rawmemchr is unportable - " \
+                      "use gnulib module rawmemchr for portability"), \
+     rawmemchr (a, b))
+#endif
+
 /* Copy SRC to DST, returning the address of the terminating '\0' in DST.  */
 #if @GNULIB_STPCPY@
 # if ! @HAVE_STPCPY@
index 35cde40b23c2369f258fd47dd3804d29b45d2224..4f58089cc76ffc526ae5dd082841aa9728fbb7e7 100644 (file)
@@ -1,5 +1,6 @@
-/* Provide a sys/socket header file for systems lacking it (read: MinGW).
-   Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
+/* Provide a sys/socket header file for systems lacking it (read: MinGW)
+   and for systems where it is incomplete.
+   Copyright (C) 2005-2008 Free Software Foundation, Inc.
    Written by Simon Josefsson.
 
    This program is free software; you can redistribute it and/or modify
@@ -16,8 +17,9 @@
    along with this program; if not, write to the Free Software Foundation,
    Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
 
-/* This file is supposed to be used on platforms that lack <sys/socket.h>
-   and on platforms where <sys/socket.h> cannot be included standalone.
+/* This file is supposed to be used on platforms that lack <sys/socket.h>,
+   on platforms where <sys/socket.h> cannot be included standalone, and on
+   platforms where <sys/socket.h> does not provide all necessary definitions.
    It is intended to provide definitions and prototypes needed by an
    application.  */
 
 #ifndef _GL_SYS_SOCKET_H
 #define _GL_SYS_SOCKET_H
 
-#if !@HAVE_SYS_SOCKET_H@
+#if @HAVE_SYS_SOCKET_H@
+
+/* A platform that has <sys/socket.h>.  */
+
+/* For shutdown().  */
+# if !defined SHUT_RD
+#  define SHUT_RD 0
+# endif
+# if !defined SHUT_WR
+#  define SHUT_WR 1
+# endif
+# if !defined SHUT_RDWR
+#  define SHUT_RDWR 2
+# endif
+
+#else
 
 /* A platform that lacks <sys/socket.h>.
 
 #  define ESHUTDOWN               WSAESHUTDOWN
 # endif
 
+# if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
+#  define setsockopt(a,b,c,d,e) rpl_setsockopt(a,b,c,d,e)
+static inline int
+rpl_setsockopt(int socket, int level, int optname, const void *optval,
+              socklen_t optlen)
+{
+  return (setsockopt)(socket, level, optname, optval, optlen);
+}
+# endif
+
 #endif /* HAVE_SYS_SOCKET_H */
 
 #endif /* _GL_SYS_SOCKET_H */
index ff2159f3e0c0ff0770c3bd1e454ac73067daed70..1ffefa18b9af01c1c565aa514ddf4643e349f6d8 100644 (file)
@@ -1,5 +1,5 @@
 /* Provide a more complete sys/stat header file.
-   Copyright (C) 2006, 2007 Free Software Foundation, Inc.
+   Copyright (C) 2006-2008 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
 #ifndef _GL_SYS_STAT_H
 #define _GL_SYS_STAT_H
 
+/* Before doing "#define mkdir rpl_mkdir" below, we need to include all
+   headers that may declare mkdir().  */
+#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+# include <io.h>
+#endif
+
 #ifndef S_IFMT
 # define S_IFMT 0170000
 #endif
 # define lstat stat
 #endif
 
+#if @REPLACE_MKDIR@
+# undef mkdir
+# define mkdir rpl_mkdir
+extern int mkdir (char const *name, mode_t mode);
+#else
 /* mingw's _mkdir() function has 1 argument, but we pass 2 arguments.
    Additionally, it declares _mkdir (and depending on compile flags, an
-   alias mkdir), only in the nonstandard io.h.  */
-#if ! @HAVE_DECL_MKDIR@ && @HAVE_IO_H@
-# include <io.h>
+   alias mkdir), only in the nonstandard <io.h>, which is included above.  */
+# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
 
 static inline int
 rpl_mkdir (char const *name, mode_t mode)
@@ -273,7 +283,8 @@ rpl_mkdir (char const *name, mode_t mode)
   return _mkdir (name);
 }
 
-# define mkdir rpl_mkdir
+#  define mkdir rpl_mkdir
+# endif
 #endif
 
 #endif /* _GL_SYS_STAT_H */
index ed579d34aa5f3327bf1f4ef8195688ca58dfbed1..4583f7d865337da3c24ceedc4f3481796149221d 100644 (file)
 # include "fpucw.h"
 #endif
 
-/* Some systems, like OSF/1 4.0 and Woe32, don't have EOVERFLOW.  */
-#ifndef EOVERFLOW
-# define EOVERFLOW E2BIG
-#endif
-
 #if HAVE_WCHAR_T
 # if HAVE_WCSLEN
 #  define local_wcslen wcslen
@@ -182,10 +177,12 @@ local_wcslen (const wchar_t *s)
 # endif
 #else
   /* TCHAR_T is char.  */
-# /* Use snprintf if it exists under the name 'snprintf' or '_snprintf'.
+  /* Use snprintf if it exists under the name 'snprintf' or '_snprintf'.
      But don't use it on BeOS, since BeOS snprintf produces no output if the
-     size argument is >= 0x3000000.  */
-# if (HAVE_DECL__SNPRINTF || HAVE_SNPRINTF) && !defined __BEOS__
+     size argument is >= 0x3000000.
+     Also don't use it on Linux libc5, since there snprintf with size = 1
+     writes any output without bounds, like sprintf.  */
+# if (HAVE_DECL__SNPRINTF || HAVE_SNPRINTF) && !defined __BEOS__ && !(__GNU_LIBRARY__ == 1)
 #  define USE_SNPRINTF 1
 # else
 #  define USE_SNPRINTF 0
@@ -1306,9 +1303,9 @@ floorlog10l (long double x)
     }
   /* Now 0.95 <= z <= 1.01.  */
   z = 1 - z;
-  /* log(1-z) = - z - z^2/2 - z^3/3 - z^4/4 - ...
+  /* log2(1-z) = 1/log(2) * (- z - z^2/2 - z^3/3 - z^4/4 - ...)
      Four terms are enough to get an approximation with error < 10^-7.  */
-  l -= z * (1.0 + z * (0.5 + z * ((1.0 / 3) + z * 0.25)));
+  l -= 1.4426950408889634074 * z * (1.0 + z * (0.5 + z * ((1.0 / 3) + z * 0.25)));
   /* Finally multiply with log(2)/log(10), yields an approximation for
      log10(x).  */
   l *= 0.30102999566398119523;
@@ -1397,9 +1394,9 @@ floorlog10 (double x)
     }
   /* Now 0.95 <= z <= 1.01.  */
   z = 1 - z;
-  /* log(1-z) = - z - z^2/2 - z^3/3 - z^4/4 - ...
+  /* log2(1-z) = 1/log(2) * (- z - z^2/2 - z^3/3 - z^4/4 - ...)
      Four terms are enough to get an approximation with error < 10^-7.  */
-  l -= z * (1.0 + z * (0.5 + z * ((1.0 / 3) + z * 0.25)));
+  l -= 1.4426950408889634074 * z * (1.0 + z * (0.5 + z * ((1.0 / 3) + z * 0.25)));
   /* Finally multiply with log(2)/log(10), yields an approximation for
      log10(x).  */
   l *= 0.30102999566398119523;
@@ -1409,6 +1406,20 @@ floorlog10 (double x)
 
 # endif
 
+/* Tests whether a string of digits consists of exactly PRECISION zeroes and
+   a single '1' digit.  */
+static int
+is_borderline (const char *digits, size_t precision)
+{
+  for (; precision > 0; precision--, digits++)
+    if (*digits != '0')
+      return 0;
+  if (*digits != '1')
+    return 0;
+  digits++;
+  return *digits == '\0';
+}
+
 #endif
 
 DCHAR_T *
@@ -2858,8 +2869,32 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                                          exponent += 1;
                                        adjusted = 1;
                                      }
-
                                    /* Here ndigits = precision+1.  */
+                                   if (is_borderline (digits, precision))
+                                     {
+                                       /* Maybe the exponent guess was too high
+                                          and a smaller exponent can be reached
+                                          by turning a 10...0 into 9...9x.  */
+                                       char *digits2 =
+                                         scale10_round_decimal_long_double (arg,
+                                                                            (int)precision - exponent + 1);
+                                       if (digits2 == NULL)
+                                         {
+                                           free (digits);
+                                           END_LONG_DOUBLE_ROUNDING ();
+                                           goto out_of_memory;
+                                         }
+                                       if (strlen (digits2) == precision + 1)
+                                         {
+                                           free (digits);
+                                           digits = digits2;
+                                           exponent -= 1;
+                                         }
+                                       else
+                                         free (digits2);
+                                     }
+                                   /* Here ndigits = precision+1.  */
+
                                    *p++ = digits[--ndigits];
                                    if ((flags & FLAG_ALT) || precision > 0)
                                      {
@@ -2971,6 +3006,30 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                                        adjusted = 1;
                                      }
                                    /* Here ndigits = precision.  */
+                                   if (is_borderline (digits, precision - 1))
+                                     {
+                                       /* Maybe the exponent guess was too high
+                                          and a smaller exponent can be reached
+                                          by turning a 10...0 into 9...9x.  */
+                                       char *digits2 =
+                                         scale10_round_decimal_long_double (arg,
+                                                                            (int)(precision - 1) - exponent + 1);
+                                       if (digits2 == NULL)
+                                         {
+                                           free (digits);
+                                           END_LONG_DOUBLE_ROUNDING ();
+                                           goto out_of_memory;
+                                         }
+                                       if (strlen (digits2) == precision)
+                                         {
+                                           free (digits);
+                                           digits = digits2;
+                                           exponent -= 1;
+                                         }
+                                       else
+                                         free (digits2);
+                                     }
+                                   /* Here ndigits = precision.  */
 
                                    /* Determine the number of trailing zeroes
                                       that have to be dropped.  */
@@ -3211,8 +3270,31 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                                          exponent += 1;
                                        adjusted = 1;
                                      }
-
                                    /* Here ndigits = precision+1.  */
+                                   if (is_borderline (digits, precision))
+                                     {
+                                       /* Maybe the exponent guess was too high
+                                          and a smaller exponent can be reached
+                                          by turning a 10...0 into 9...9x.  */
+                                       char *digits2 =
+                                         scale10_round_decimal_double (arg,
+                                                                       (int)precision - exponent + 1);
+                                       if (digits2 == NULL)
+                                         {
+                                           free (digits);
+                                           goto out_of_memory;
+                                         }
+                                       if (strlen (digits2) == precision + 1)
+                                         {
+                                           free (digits);
+                                           digits = digits2;
+                                           exponent -= 1;
+                                         }
+                                       else
+                                         free (digits2);
+                                     }
+                                   /* Here ndigits = precision+1.  */
+
                                    *p++ = digits[--ndigits];
                                    if ((flags & FLAG_ALT) || precision > 0)
                                      {
@@ -3337,6 +3419,29 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                                        adjusted = 1;
                                      }
                                    /* Here ndigits = precision.  */
+                                   if (is_borderline (digits, precision - 1))
+                                     {
+                                       /* Maybe the exponent guess was too high
+                                          and a smaller exponent can be reached
+                                          by turning a 10...0 into 9...9x.  */
+                                       char *digits2 =
+                                         scale10_round_decimal_double (arg,
+                                                                       (int)(precision - 1) - exponent + 1);
+                                       if (digits2 == NULL)
+                                         {
+                                           free (digits);
+                                           goto out_of_memory;
+                                         }
+                                       if (strlen (digits2) == precision)
+                                         {
+                                           free (digits);
+                                           digits = digits2;
+                                           exponent -= 1;
+                                         }
+                                       else
+                                         free (digits2);
+                                     }
+                                   /* Here ndigits = precision.  */
 
                                    /* Determine the number of trailing zeroes
                                       that have to be dropped.  */
@@ -3661,6 +3766,44 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                  }
 #endif
 
+               /* Decide whether to handle the precision ourselves.  */
+#if NEED_PRINTF_UNBOUNDED_PRECISION
+               switch (dp->conversion)
+                 {
+                 case 'd': case 'i': case 'u':
+                 case 'o':
+                 case 'x': case 'X': case 'p':
+                   prec_ourselves = has_precision && (precision > 0);
+                   break;
+                 default:
+                   prec_ourselves = 0;
+                   break;
+                 }
+#endif
+
+               /* Decide whether to perform the padding ourselves.  */
+#if !NEED_PRINTF_FLAG_LEFTADJUST && (!DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION)
+               switch (dp->conversion)
+                 {
+# if !DCHAR_IS_TCHAR || ENABLE_UNISTDIO
+                 /* If we need conversion from TCHAR_T[] to DCHAR_T[], we need
+                    to perform the padding after this conversion.  Functions
+                    with unistdio extensions perform the padding based on
+                    character count rather than element count.  */
+                 case 'c': case 's':
+# endif
+# if NEED_PRINTF_FLAG_ZERO
+                 case 'f': case 'F': case 'e': case 'E': case 'g': case 'G':
+                 case 'a': case 'A':
+# endif
+                   pad_ourselves = 1;
+                   break;
+                 default:
+                   pad_ourselves = prec_ourselves;
+                   break;
+                 }
+#endif
+
 #if !USE_SNPRINTF
                /* Allocate a temporary buffer of sufficient size for calling
                   sprintf.  */
@@ -3837,18 +3980,22 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                      abort ();
                    }
 
+                 if (!pad_ourselves)
+                   {
 # if ENABLE_UNISTDIO
-                 /* Padding considers the number of characters, therefore the
-                    number of elements after padding may be
-                      > max (tmp_length, width)
-                    but is certainly
-                      <= tmp_length + width.  */
-                 tmp_length = xsum (tmp_length, width);
+                     /* Padding considers the number of characters, therefore
+                        the number of elements after padding may be
+                          > max (tmp_length, width)
+                        but is certainly
+                          <= tmp_length + width.  */
+                     tmp_length = xsum (tmp_length, width);
 # else
-                 /* Padding considers the number of elements, says POSIX.  */
-                 if (tmp_length < width)
-                   tmp_length = width;
+                     /* Padding considers the number of elements,
+                        says POSIX.  */
+                     if (tmp_length < width)
+                       tmp_length = width;
 # endif
+                   }
 
                  tmp_length = xsum (tmp_length, 1); /* account for trailing NUL */
                }
@@ -3869,44 +4016,6 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                  }
 #endif
 
-               /* Decide whether to handle the precision ourselves.  */
-#if NEED_PRINTF_UNBOUNDED_PRECISION
-               switch (dp->conversion)
-                 {
-                 case 'd': case 'i': case 'u':
-                 case 'o':
-                 case 'x': case 'X': case 'p':
-                   prec_ourselves = has_precision && (precision > 0);
-                   break;
-                 default:
-                   prec_ourselves = 0;
-                   break;
-                 }
-#endif
-
-               /* Decide whether to perform the padding ourselves.  */
-#if !NEED_PRINTF_FLAG_LEFTADJUST && (!DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION)
-               switch (dp->conversion)
-                 {
-# if !DCHAR_IS_TCHAR || ENABLE_UNISTDIO
-                 /* If we need conversion from TCHAR_T[] to DCHAR_T[], we need
-                    to perform the padding after this conversion.  Functions
-                    with unistdio extensions perform the padding based on
-                    character count rather than element count.  */
-                 case 'c': case 's':
-# endif
-# if NEED_PRINTF_FLAG_ZERO
-                 case 'f': case 'F': case 'e': case 'E': case 'g': case 'G':
-                 case 'a': case 'A':
-# endif
-                   pad_ourselves = 1;
-                   break;
-                 default:
-                   pad_ourselves = prec_ourselves;
-                   break;
-                 }
-#endif
-
                /* Construct the format string for calling snprintf or
                   sprintf.  */
                fbp = buf;
@@ -4403,14 +4512,14 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                      }
 #endif
 
-#if !DCHAR_IS_TCHAR
-# if !USE_SNPRINTF
+#if !USE_SNPRINTF
                    if (count >= tmp_length)
                      /* tmp_length was incorrectly calculated - fix the
                         code above!  */
                      abort ();
-# endif
+#endif
 
+#if !DCHAR_IS_TCHAR
                    /* Convert from TCHAR_T[] to DCHAR_T[].  */
                    if (dp->conversion == 'c' || dp->conversion == 's')
                      {
@@ -4528,7 +4637,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                        if (w < width)
                          {
                            size_t pad = width - w;
-# if USE_SNPRINTF
+
                            /* Make room for the result.  */
                            if (xsum (count, pad) > allocated - length)
                              {
@@ -4538,12 +4647,16 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                                  xmax (xsum3 (length, count, pad),
                                        xtimes (allocated, 2));
 
+# if USE_SNPRINTF
                                length += count;
                                ENSURE_ALLOCATION (n);
                                length -= count;
+# else
+                               ENSURE_ALLOCATION (n);
+# endif
                              }
                            /* Here count + pad <= allocated - length.  */
-# endif
+
                            {
 # if !DCHAR_IS_TCHAR || USE_SNPRINTF
                              DCHAR_T * const rp = result + length;
@@ -4553,7 +4666,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                              DCHAR_T *p = rp + count;
                              DCHAR_T *end = p + pad;
                              DCHAR_T *pad_ptr;
-# if !DCHAR_IS_TCHAR
+# if !DCHAR_IS_TCHAR || ENABLE_UNISTDIO
                              if (dp->conversion == 'c'
                                  || dp->conversion == 's')
                                /* No zero-padding for string directives.  */
@@ -4604,13 +4717,6 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                      }
 #endif
 
-#if DCHAR_IS_TCHAR && !USE_SNPRINTF
-                   if (count >= tmp_length)
-                     /* tmp_length was incorrectly calculated - fix the
-                        code above!  */
-                     abort ();
-#endif
-
                    /* Here still count <= allocated - length.  */
 
 #if !DCHAR_IS_TCHAR || USE_SNPRINTF
index 7b645460ee8a4486052f2b6fa431badf55bce1fa..c74dc76e4f0a3342a0054e25a1689be28a36e3b4 100644 (file)
@@ -1,5 +1,5 @@
 /* Formatted output to strings.
-   Copyright (C) 1999, 2002, 2006-2007 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2002, 2006-2008 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
 
 #include "vasnprintf.h"
 
-/* Some systems, like OSF/1 4.0 and Woe32, don't have EOVERFLOW.  */
-#ifndef EOVERFLOW
-# define EOVERFLOW E2BIG
-#endif
-
 int
 vasprintf (char **resultp, const char *format, va_list args)
 {
index 0aba1cac107269fbac52a39e64d860536b300743..73588712bb7e0ec0cf355989ade6a80e2cfcf68a 100644 (file)
@@ -1,6 +1,6 @@
 /* A substitute for ISO C99 <wchar.h>, for platforms that have issues.
 
-   Copyright (C) 2007 Free Software Foundation, Inc.
+   Copyright (C) 2007-2008 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
  * the declaration of wcwidth().
  */
 
+#ifdef __need_mbstate_t
+/* Special invocation convention inside uClibc header files.  */
+
+#@INCLUDE_NEXT@ @NEXT_WCHAR_H@
+
+#else
+/* Normal invocation convention.  */
+
 #ifndef _GL_WCHAR_H
 
 /* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
@@ -80,3 +88,4 @@ extern int wcwidth (int /* actually wchar_t */);
 
 #endif /* _GL_WCHAR_H */
 #endif /* _GL_WCHAR_H */
+#endif
index d01d0984e305ed76f8318605e32b96d048895f7b..20bd3bc6f5b81287f9d6e539c623158be0f5ee12 100644 (file)
@@ -1,18 +1,43 @@
-# arpa_inet_h.m4 serial 1
-dnl Copyright (C) 2006 Free Software Foundation, Inc.
+# arpa_inet_h.m4 serial 4
+dnl Copyright (C) 2006, 2008 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
 
-dnl Written by Simon Josefsson
+dnl Written by Simon Josefsson and Bruno Haible
 
 AC_DEFUN([gl_HEADER_ARPA_INET],
 [
+  dnl Use AC_REQUIRE here, so that the default behavior below is expanded
+  dnl once only, before all statements that occur in other macros.
+  AC_REQUIRE([gl_ARPA_INET_H_DEFAULTS])
+
   AC_CHECK_HEADERS_ONCE([arpa/inet.h])
   if test $ac_cv_header_arpa_inet_h = yes; then
-    ARPA_INET_H=''
+    HAVE_ARPA_INET_H=1
   else
     ARPA_INET_H='arpa/inet.h'
+    HAVE_ARPA_INET_H=0
   fi
-  AC_SUBST(ARPA_INET_H)
+  AC_SUBST([HAVE_ARPA_INET_H])
+  dnl Execute this unconditionally, because ARPA_INET_H may be set by other
+  dnl modules, after this code is executed.
+  gl_CHECK_NEXT_HEADERS([arpa/inet.h])
+])
+
+AC_DEFUN([gl_ARPA_INET_MODULE_INDICATOR],
+[
+  dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
+  AC_REQUIRE([gl_ARPA_INET_H_DEFAULTS])
+  GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1
+])
+
+AC_DEFUN([gl_ARPA_INET_H_DEFAULTS],
+[
+  GNULIB_INET_NTOP=0;     AC_SUBST([GNULIB_INET_NTOP])
+  GNULIB_INET_PTON=0;     AC_SUBST([GNULIB_INET_PTON])
+  dnl Assume proper GNU behavior unless another module says otherwise.
+  HAVE_DECL_INET_NTOP=1;  AC_SUBST([HAVE_DECL_INET_NTOP])
+  HAVE_DECL_INET_PTON=1;  AC_SUBST([HAVE_DECL_INET_PTON])
+  ARPA_INET_H='';         AC_SUBST([ARPA_INET_H])
 ])
index bcbb3ceee2c30bd23176dcd1e55af74185b7ec1b..917af9480549ed985f0d4a1e84b9e19a8f2a83ee 100644 (file)
@@ -1,7 +1,7 @@
 # serial 5  -*- Autoconf -*-
 # Enable extensions on systems that normally disable them.
 
-# Copyright (C) 2003, 2006, 2007 Free Software Foundation, Inc.
+# Copyright (C) 2003, 2006-2008 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.
@@ -61,9 +61,9 @@ AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
   AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__],
     [ac_cv_safe_to_define___extensions__],
     [AC_COMPILE_IFELSE(
-       [AC_LANG_PROGRAM([
+       [AC_LANG_PROGRAM([[
 #        define __EXTENSIONS__ 1
-         AC_INCLUDES_DEFAULT])],
+         ]AC_INCLUDES_DEFAULT])],
        [ac_cv_safe_to_define___extensions__=yes],
        [ac_cv_safe_to_define___extensions__=no])])
   test $ac_cv_safe_to_define___extensions__ = yes &&
index 9336d726055452aa81a4e2ceee265ce08a0deffb..3edfc120f81f9a135aeab6c15994b2327f414f1c 100644 (file)
@@ -1,9 +1,28 @@
-# gnulib-common.m4 serial 3
-dnl Copyright (C) 2007 Free Software Foundation, Inc.
+# gnulib-common.m4 serial 4
+dnl Copyright (C) 2007-2008 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
 
+# gl_COMMON
+# is expanded unconditionally through gnulib-tool magic.
+AC_DEFUN([gl_COMMON], [
+  dnl Use AC_REQUIRE here, so that the code is expanded once only.
+  AC_REQUIRE([gl_COMMON_BODY])
+])
+AC_DEFUN([gl_COMMON_BODY], [
+  AH_VERBATIM([isoc99_inline],
+[/* Work around a bug in Apple GCC 4.0.1 build 5465: In C99 mode, it supports
+   the ISO C 99 semantics of 'extern inline' (unlike the GNU C semantics of
+   earlier versions), but does not display it by setting __GNUC_STDC_INLINE__.
+   __APPLE__ && __MACH__ test for MacOS X.
+   __APPLE_CC__ tests for the Apple compiler and its version.
+   __STDC_VERSION__ tests for the C99 mode.  */
+#if defined __APPLE__ && defined __MACH__ && __APPLE_CC__ >= 5465 && !defined __cplusplus && __STDC_VERSION__ >= 199901L && !defined __GNUC_STDC_INLINE__
+# define __GNUC_STDC_INLINE__ 1
+#endif])
+])
+
 # gl_MODULE_INDICATOR([modulename])
 # defines a C macro indicating the presence of the given module.
 AC_DEFUN([gl_MODULE_INDICATOR],
index 465df3c40f90ea19044389ca5e400afb461def62..444531d77c9d5f400851771a68016113d3a00130 100644 (file)
@@ -39,7 +39,9 @@ AC_DEFUN([gl_INIT],
   m4_pushdef([AC_LIBOBJ], m4_defn([gl_LIBOBJ]))
   m4_pushdef([AC_REPLACE_FUNCS], m4_defn([gl_REPLACE_FUNCS]))
   m4_pushdef([AC_LIBSOURCES], m4_defn([gl_LIBSOURCES]))
+  gl_COMMON
   gl_source_base='gnulib/lib'
+  gl_EOVERFLOW
   gl_FUNC_ALLOCA
   gl_HEADER_ARPA_INET
   AC_PROG_MKDIR_P
@@ -57,6 +59,7 @@ AC_DEFUN([gl_INIT],
   AC_SUBST([LIBINTL])
   AC_SUBST([LTLIBINTL])
   gl_INET_NTOP
+  gl_ARPA_INET_MODULE_INDICATOR([inet_ntop])
   gl_FUNC_LSEEK
   gl_UNISTD_MODULE_INDICATOR([lseek])
   gl_FUNC_MALLOC_POSIX
@@ -126,6 +129,7 @@ AC_DEFUN([gl_INIT],
   m4_pushdef([AC_LIBOBJ], m4_defn([gltests_LIBOBJ]))
   m4_pushdef([AC_REPLACE_FUNCS], m4_defn([gltests_REPLACE_FUNCS]))
   m4_pushdef([AC_LIBSOURCES], m4_defn([gltests_LIBSOURCES]))
+  gl_COMMON
   gl_source_base='gnulib/tests'
   gt_TYPE_WCHAR_T
   gt_TYPE_WINT_T
@@ -230,6 +234,7 @@ AC_DEFUN([gl_FILE_LIST], [
   build-aux/useless-if-before-free
   build-aux/vc-list-files
   lib/alloca.in.h
+  lib/arpa_inet.in.h
   lib/asnprintf.c
   lib/asprintf.c
   lib/dummy.c
@@ -245,7 +250,6 @@ AC_DEFUN([gl_FILE_LIST], [
   lib/getpass.h
   lib/gettext.h
   lib/inet_ntop.c
-  lib/inet_ntop.h
   lib/lseek.c
   lib/malloc.c
   lib/netinet_in.in.h
@@ -262,6 +266,7 @@ AC_DEFUN([gl_FILE_LIST], [
   lib/snprintf.c
   lib/stdbool.in.h
   lib/stdint.in.h
+  lib/stdio-impl.h
   lib/stdio.in.h
   lib/stdlib.in.h
   lib/strdup.c
@@ -316,12 +321,13 @@ AC_DEFUN([gl_FILE_LIST], [
   m4/malloc.m4
   m4/netinet_in_h.m4
   m4/nls.m4
-  m4/onceonly_2_57.m4
+  m4/onceonly.m4
   m4/physmem.m4
   m4/po.m4
   m4/poll.m4
   m4/posix-shell.m4
   m4/printf-posix.m4
+  m4/printf.m4
   m4/progtest.m4
   m4/realloc.m4
   m4/size_max.m4
@@ -352,6 +358,7 @@ AC_DEFUN([gl_FILE_LIST], [
   m4/wchar_t.m4
   m4/wint_t.m4
   m4/xsize.m4
+  tests/test-EOVERFLOW.c
   tests/test-alloca-opt.c
   tests/test-arpa_inet.c
   tests/test-fseeko.c
index 7c08e9319bf83cdb3ca6ee3b16ad679fc292fe3f..a842e2a23682bd0bea8a73ea22b58533c33ad97c 100644 (file)
@@ -1,4 +1,4 @@
-# include_next.m4 serial 5
+# include_next.m4 serial 6
 dnl Copyright (C) 2006-2008 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -71,7 +71,7 @@ AC_DEFUN([gl_CHECK_NEXT_HEADERS],
   AC_REQUIRE([gl_INCLUDE_NEXT])
   AC_CHECK_HEADERS_ONCE([$1])
 
-  AC_FOREACH([gl_HEADER_NAME], [$1],
+  m4_foreach_w([gl_HEADER_NAME], [$1],
     [AS_VAR_PUSHDEF([gl_next_header],
                    [gl_cv_next_]m4_quote(m4_defn([gl_HEADER_NAME])))
      if test $gl_cv_have_include_next = yes; then
index bb02d2298b9ad34079228dee5a4ccfabe07a1fdc..ee7ba5196c7d8e9236d43b266a7436780e6730ff 100644 (file)
@@ -1,18 +1,20 @@
-# inet_ntop.m4 serial 3
-dnl Copyright (C) 2005, 2006 Free Software Foundation, Inc.
+# inet_ntop.m4 serial 5
+dnl Copyright (C) 2005, 2006, 2008 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
 
 AC_DEFUN([gl_INET_NTOP],
 [
+  AC_REQUIRE([gl_ARPA_INET_H_DEFAULTS])
+  ARPA_INET_H='arpa/inet.h'
+
   AC_REPLACE_FUNCS(inet_ntop)
   gl_PREREQ_INET_NTOP
 ])
 
-# Prerequisites of lib/inet_ntop.h and lib/inet_ntop.c.
+# Prerequisites of lib/inet_ntop.c.
 AC_DEFUN([gl_PREREQ_INET_NTOP], [
-  AC_CHECK_HEADERS_ONCE([netinet/in.h arpa/inet.h])
   AC_CHECK_DECLS([inet_ntop],,,[#include <arpa/inet.h>])
   AC_REQUIRE([gl_SOCKET_FAMILIES])
   AC_REQUIRE([AC_C_RESTRICT])
index 096be740da7f4ab3c91116678b27c8d72a532b9d..47fd9cc3175099f4e5479ac17f1ea8d44bb3da40 100644 (file)
@@ -1,5 +1,5 @@
-# netinet_in_h.m4 serial 3
-dnl Copyright (C) 2006-2007 Free Software Foundation, Inc.
+# netinet_in_h.m4 serial 4
+dnl Copyright (C) 2006-2008 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -9,7 +9,7 @@ AC_DEFUN([gl_HEADER_NETINET_IN],
   AC_CACHE_CHECK([whether <netinet/in.h> is self-contained],
     [gl_cv_header_netinet_in_h_selfcontained],
     [
-      AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <netinet/in.h>], [])],
+      AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <netinet/in.h>]], [[]])],
         [gl_cv_header_netinet_in_h_selfcontained=yes],
         [gl_cv_header_netinet_in_h_selfcontained=no])
     ])
diff --git a/gnulib/m4/onceonly_2_57.m4 b/gnulib/m4/onceonly_2_57.m4
deleted file mode 100644 (file)
index 15884b3..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-# onceonly_2_57.m4 serial 4
-dnl Copyright (C) 2002-2003, 2005-2006 Free Software Foundation, Inc.
-dnl This file is free software, distributed under the terms of the GNU
-dnl General Public License.  As a special exception to the GNU General
-dnl Public License, this file may be distributed as part of a program
-dnl that contains a configuration script generated by Autoconf, under
-dnl the same distribution terms as the rest of that program.
-
-dnl This file defines some "once only" variants of standard autoconf macros.
-dnl   AC_CHECK_HEADERS_ONCE          like  AC_CHECK_HEADERS
-dnl   AC_CHECK_FUNCS_ONCE            like  AC_CHECK_FUNCS
-dnl   AC_CHECK_DECLS_ONCE            like  AC_CHECK_DECLS
-dnl   AC_REQUIRE([AC_FUNC_STRCOLL])  like  AC_FUNC_STRCOLL
-dnl The advantage is that the check for each of the headers/functions/decls
-dnl will be put only once into the 'configure' file. It keeps the size of
-dnl the 'configure' file down, and avoids redundant output when 'configure'
-dnl is run.
-dnl The drawback is that the checks cannot be conditionalized. If you write
-dnl   if some_condition; then gl_CHECK_HEADERS(stdlib.h); fi
-dnl inside an AC_DEFUNed function, the gl_CHECK_HEADERS macro call expands to
-dnl empty, and the check will be inserted before the body of the AC_DEFUNed
-dnl function.
-
-dnl This is like onceonly.m4, except that it uses diversions to named sections
-dnl DEFAULTS and INIT_PREPARE in order to check all requested headers at once,
-dnl thus reducing the size of 'configure'. Works with autoconf-2.57. The
-dnl size reduction is ca. 9%.
-
-dnl Autoconf version 2.57 or newer is recommended.
-AC_PREREQ(2.57)
-
-# AC_CHECK_HEADERS_ONCE(HEADER1 HEADER2 ...) is a once-only variant of
-# AC_CHECK_HEADERS(HEADER1 HEADER2 ...).
-AC_DEFUN([AC_CHECK_HEADERS_ONCE], [
-  :
-  AC_FOREACH([gl_HEADER_NAME], [$1], [
-    AC_DEFUN([gl_CHECK_HEADER_]m4_quote(translit(gl_HEADER_NAME,
-                                                 [./-], [___])), [
-      m4_divert_text([INIT_PREPARE],
-        [gl_header_list="$gl_header_list gl_HEADER_NAME"])
-      gl_HEADERS_EXPANSION
-      AH_TEMPLATE(AS_TR_CPP([HAVE_]m4_defn([gl_HEADER_NAME])),
-        [Define to 1 if you have the <]m4_defn([gl_HEADER_NAME])[> header file.])
-    ])
-    AC_REQUIRE([gl_CHECK_HEADER_]m4_quote(translit(gl_HEADER_NAME,
-                                                   [./-], [___])))
-  ])
-])
-m4_define([gl_HEADERS_EXPANSION], [
-  m4_divert_text([DEFAULTS], [gl_header_list=])
-  AC_CHECK_HEADERS([$gl_header_list])
-  m4_define([gl_HEADERS_EXPANSION], [])
-])
-
-# AC_CHECK_FUNCS_ONCE(FUNC1 FUNC2 ...) is a once-only variant of
-# AC_CHECK_FUNCS(FUNC1 FUNC2 ...).
-AC_DEFUN([AC_CHECK_FUNCS_ONCE], [
-  :
-  AC_FOREACH([gl_FUNC_NAME], [$1], [
-    AC_DEFUN([gl_CHECK_FUNC_]m4_defn([gl_FUNC_NAME]), [
-      m4_divert_text([INIT_PREPARE],
-        [gl_func_list="$gl_func_list gl_FUNC_NAME"])
-      gl_FUNCS_EXPANSION
-      AH_TEMPLATE(AS_TR_CPP([HAVE_]m4_defn([gl_FUNC_NAME])),
-        [Define to 1 if you have the `]m4_defn([gl_FUNC_NAME])[' function.])
-    ])
-    AC_REQUIRE([gl_CHECK_FUNC_]m4_defn([gl_FUNC_NAME]))
-  ])
-])
-m4_define([gl_FUNCS_EXPANSION], [
-  m4_divert_text([DEFAULTS], [gl_func_list=])
-  AC_CHECK_FUNCS([$gl_func_list])
-  m4_define([gl_FUNCS_EXPANSION], [])
-])
-
-# AC_CHECK_DECLS_ONCE(DECL1 DECL2 ...) is a once-only variant of
-# AC_CHECK_DECLS(DECL1, DECL2, ...).
-AC_DEFUN([AC_CHECK_DECLS_ONCE], [
-  :
-  AC_FOREACH([gl_DECL_NAME], [$1], [
-    AC_DEFUN([gl_CHECK_DECL_]m4_defn([gl_DECL_NAME]), [
-      AC_CHECK_DECLS(m4_defn([gl_DECL_NAME]))
-    ])
-    AC_REQUIRE([gl_CHECK_DECL_]m4_defn([gl_DECL_NAME]))
-  ])
-])
index 456bb3711f39c44e3ece129e3489823d492212be..b5001e1fc918fa5f56631e87bb1fd0ae6a1b8ce0 100644 (file)
@@ -1,5 +1,5 @@
-# physmem.m4 serial 7
-dnl Copyright (C) 2002, 2003, 2005, 2006 Free Software Foundation, Inc.
+# physmem.m4 serial 8
+dnl Copyright (C) 2002-2003, 2005-2006, 2008 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -12,8 +12,8 @@ AC_DEFUN([gl_SYS__SYSTEM_CONFIGURATION],
     [AC_LINK_IFELSE([AC_LANG_PROGRAM(
                      [[#include <sys/systemcfg.h>
                      ]],
-                     [double x = _system_configuration.physmem;
-                      if (x > 0.0) return 0;])],
+                     [[double x = _system_configuration.physmem;
+                       if (x > 0.0) return 0;]])],
       [gl_cv_var__system_configuration=yes],
       [gl_cv_var__system_configuration=no])])
 
index f21200dceae21545280f5edb354a10694c99f181..6021786ee146ea02ca697a1a90360dc95c6043d4 100644 (file)
@@ -1,5 +1,5 @@
-# snprintf.m4 serial 4
-dnl Copyright (C) 2002, 2003, 2004, 2007 Free Software Foundation, Inc.
+# snprintf.m4 serial 5
+dnl Copyright (C) 2002-2004, 2007-2008 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -7,8 +7,17 @@ dnl with or without modifications, as long as this notice is preserved.
 AC_DEFUN([gl_FUNC_SNPRINTF],
 [
   AC_REQUIRE([gl_STDIO_H_DEFAULTS])
+  gl_cv_func_snprintf_usable=no
   AC_CHECK_FUNCS([snprintf])
-  if test $ac_cv_func_snprintf = no; then
+  if test $ac_cv_func_snprintf = yes; then
+    gl_SNPRINTF_SIZE1
+    case "$gl_cv_func_snprintf_size1" in
+      *yes)
+        gl_cv_func_snprintf_usable=yes
+        ;;
+    esac
+  fi
+  if test $gl_cv_func_snprintf_usable = no; then
     gl_REPLACE_SNPRINTF
   fi
   AC_CHECK_DECLS_ONCE([snprintf])
index bb6c34fe1e9e78a6a733f3c94501a5c240dfe947..b2556925670ebb4b549342daecaf3ab677aa3f65 100644 (file)
@@ -1,5 +1,5 @@
-# stdint.m4 serial 29
-dnl Copyright (C) 2001-2007 Free Software Foundation, Inc.
+# stdint.m4 serial 31
+dnl Copyright (C) 2001-2008 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -240,7 +240,7 @@ AC_DEFUN([gl_STDINT_BITSIZEOF],
   dnl - extra AH_TEMPLATE calls, so that autoheader knows what to put into
   dnl   config.h.in,
   dnl - extra AC_SUBST calls, so that the right substitutions are made.
-  AC_FOREACH([gltype], [$1],
+  m4_foreach_w([gltype], [$1],
     [AH_TEMPLATE([BITSIZEOF_]translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]),
        [Define to the number of bits in type ']gltype['.])])
   for gltype in $1 ; do
@@ -265,7 +265,7 @@ AC_DEFUN([gl_STDINT_BITSIZEOF],
     AC_DEFINE_UNQUOTED([BITSIZEOF_${GLTYPE}], [$result])
     eval BITSIZEOF_${GLTYPE}=\$result
   done
-  AC_FOREACH([gltype], [$1],
+  m4_foreach_w([gltype], [$1],
     [AC_SUBST([BITSIZEOF_]translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]))])
 ])
 
@@ -278,7 +278,7 @@ AC_DEFUN([gl_CHECK_TYPES_SIGNED],
   dnl - extra AH_TEMPLATE calls, so that autoheader knows what to put into
   dnl   config.h.in,
   dnl - extra AC_SUBST calls, so that the right substitutions are made.
-  AC_FOREACH([gltype], [$1],
+  m4_foreach_w([gltype], [$1],
     [AH_TEMPLATE([HAVE_SIGNED_]translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]),
        [Define to 1 if ']gltype[' is a signed integer type.])])
   for gltype in $1 ; do
@@ -298,7 +298,7 @@ AC_DEFUN([gl_CHECK_TYPES_SIGNED],
       eval HAVE_SIGNED_${GLTYPE}=0
     fi
   done
-  AC_FOREACH([gltype], [$1],
+  m4_foreach_w([gltype], [$1],
     [AC_SUBST([HAVE_SIGNED_]translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]))])
 ])
 
@@ -311,7 +311,7 @@ AC_DEFUN([gl_INTEGER_TYPE_SUFFIX],
   dnl - extra AH_TEMPLATE calls, so that autoheader knows what to put into
   dnl   config.h.in,
   dnl - extra AC_SUBST calls, so that the right substitutions are made.
-  AC_FOREACH([gltype], [$1],
+  m4_foreach_w([gltype], [$1],
     [AH_TEMPLATE(translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_])[_SUFFIX],
        [Define to l, ll, u, ul, ull, etc., as suitable for
         constants of type ']gltype['.])])
@@ -337,9 +337,9 @@ AC_DEFUN([gl_INTEGER_TYPE_SUFFIX],
            ui64)gltype1='unsigned __int64';;
          esac
          AC_COMPILE_IFELSE(
-           [AC_LANG_PROGRAM([$2
+           [AC_LANG_PROGRAM([$2[
               extern $gltype foo;
-              extern $gltype1 foo;])],
+              extern $gltype1 foo;]])],
            [eval gl_cv_type_${gltype}_suffix=\$glsuf])
          eval result=\$gl_cv_type_${gltype}_suffix
          test "$result" != no && break
@@ -350,7 +350,7 @@ AC_DEFUN([gl_INTEGER_TYPE_SUFFIX],
     eval ${GLTYPE}_SUFFIX=\$result
     AC_DEFINE_UNQUOTED([${GLTYPE}_SUFFIX], $result)
   done
-  AC_FOREACH([gltype], [$1],
+  m4_foreach_w([gltype], [$1],
     [AC_SUBST(translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_])[_SUFFIX])])
 ])
 
index a40d41804199e9d99c7d6bac761ea02cde36f4c5..fa262e359c304269ca78c289559f3e07aa5dca5c 100644 (file)
@@ -1,5 +1,5 @@
-# stdio_h.m4 serial 9
-dnl Copyright (C) 2007 Free Software Foundation, Inc.
+# stdio_h.m4 serial 10
+dnl Copyright (C) 2007-2008 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -70,8 +70,8 @@ AC_DEFUN([gl_STDIN_LARGE_OFFSET],
   [
     AC_CACHE_CHECK([whether stdin defaults to large file offsets],
       [gl_cv_var_stdin_large_offset],
-      [AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <stdio.h>],
-[#if defined __SL64 && defined __SCLE /* cygwin */
+      [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>]],
+[[#if defined __SL64 && defined __SCLE /* cygwin */
   /* Cygwin 1.5.24 and earlier fail to put stdin in 64-bit mode, making
      fseeko/ftello needlessly fail.  This bug was fixed in 1.5.25, and
      it is easier to do a version check than building a runtime test.  */
@@ -79,7 +79,7 @@ AC_DEFUN([gl_STDIN_LARGE_OFFSET],
 # if CYGWIN_VERSION_DLL_COMBINED < CYGWIN_VERSION_DLL_MAKE_COMBINED (1005, 25)
   choke me
 # endif
-#endif])],
+#endif]])],
        [gl_cv_var_stdin_large_offset=yes],
        [gl_cv_var_stdin_large_offset=no])])
 ])
index fe4ce122e9fd6208b66887a6fa4cce06db8914d6..95e679f7971d8b33e40f4a6160cb3f2a8614cfb3 100644 (file)
@@ -1,5 +1,5 @@
-# stdlib_h.m4 serial 5
-dnl Copyright (C) 2007 Free Software Foundation, Inc.
+# stdlib_h.m4 serial 7
+dnl Copyright (C) 2007, 2008 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -26,7 +26,9 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS],
   GNULIB_MKDTEMP=0;       AC_SUBST([GNULIB_MKDTEMP])
   GNULIB_MKSTEMP=0;       AC_SUBST([GNULIB_MKSTEMP])
   GNULIB_PUTENV=0;        AC_SUBST([GNULIB_PUTENV])
+  GNULIB_RPMATCH=0;       AC_SUBST([GNULIB_RPMATCH])
   GNULIB_SETENV=0;        AC_SUBST([GNULIB_SETENV])
+  GNULIB_STRTOD=0;        AC_SUBST([GNULIB_STRTOD])
   GNULIB_UNSETENV=0;      AC_SUBST([GNULIB_UNSETENV])
   dnl Assume proper GNU behavior unless another module says otherwise.
   HAVE_CALLOC_POSIX=1;    AC_SUBST([HAVE_CALLOC_POSIX])
@@ -34,9 +36,12 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS],
   HAVE_MALLOC_POSIX=1;    AC_SUBST([HAVE_MALLOC_POSIX])
   HAVE_MKDTEMP=1;         AC_SUBST([HAVE_MKDTEMP])
   HAVE_REALLOC_POSIX=1;   AC_SUBST([HAVE_REALLOC_POSIX])
+  HAVE_RPMATCH=1;         AC_SUBST([HAVE_RPMATCH])
   HAVE_SETENV=1;          AC_SUBST([HAVE_SETENV])
+  HAVE_STRTOD=1;          AC_SUBST([HAVE_STRTOD])
   HAVE_UNSETENV=1;        AC_SUBST([HAVE_UNSETENV])
   REPLACE_MKSTEMP=0;      AC_SUBST([REPLACE_MKSTEMP])
   REPLACE_PUTENV=0;       AC_SUBST([REPLACE_PUTENV])
+  REPLACE_STRTOD=0;       AC_SUBST([REPLACE_STRTOD])
   VOID_UNSETENV=0;        AC_SUBST([VOID_UNSETENV])
 ])
index 766d7e984948bb6bf9cc80e18bbc01e18cd8f8ea..7143690ebf695725b2f776a6d394e340704fc8c3 100644 (file)
@@ -35,6 +35,7 @@ AC_DEFUN([gl_HEADER_STRING_H_DEFAULTS],
   GNULIB_MEMMEM=0;      AC_SUBST([GNULIB_MEMMEM])
   GNULIB_MEMPCPY=0;     AC_SUBST([GNULIB_MEMPCPY])
   GNULIB_MEMRCHR=0;     AC_SUBST([GNULIB_MEMRCHR])
+  GNULIB_RAWMEMCHR=0;   AC_SUBST([GNULIB_RAWMEMCHR])
   GNULIB_STPCPY=0;      AC_SUBST([GNULIB_STPCPY])
   GNULIB_STPNCPY=0;     AC_SUBST([GNULIB_STPNCPY])
   GNULIB_STRCHRNUL=0;   AC_SUBST([GNULIB_STRCHRNUL])
@@ -66,6 +67,7 @@ AC_DEFUN([gl_HEADER_STRING_H_DEFAULTS],
   HAVE_DECL_MEMMEM=1;          AC_SUBST([HAVE_DECL_MEMMEM])
   HAVE_MEMPCPY=1;              AC_SUBST([HAVE_MEMPCPY])
   HAVE_DECL_MEMRCHR=1;         AC_SUBST([HAVE_DECL_MEMRCHR])
+  HAVE_RAWMEMCHR=1;            AC_SUBST([HAVE_RAWMEMCHR])
   HAVE_STPCPY=1;               AC_SUBST([HAVE_STPCPY])
   HAVE_STPNCPY=1;              AC_SUBST([HAVE_STPNCPY])
   HAVE_STRCHRNUL=1;            AC_SUBST([HAVE_STRCHRNUL])
index f7934ef820a21a18a09e6dfe6f202813e065d47f..1be2a85c5e6c53ab065c1669784b806828efc77e 100644 (file)
@@ -1,5 +1,5 @@
-# strndup.m4 serial 14
-dnl Copyright (C) 2002-2003, 2005-2007 Free Software Foundation, Inc.
+# strndup.m4 serial 15
+dnl Copyright (C) 2002-2003, 2005-2008 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -18,8 +18,8 @@ AC_DEFUN([gl_FUNC_STRNDUP],
   # AIX 4.3.3, AIX 5.1 have a function that fails to add the terminating '\0'.
   AC_CACHE_CHECK([for working strndup], gl_cv_func_strndup,
     [AC_RUN_IFELSE([
-       AC_LANG_PROGRAM([#include <string.h>
-                       #include <stdlib.h>], [[
+       AC_LANG_PROGRAM([[#include <string.h>
+                        #include <stdlib.h>]], [[
 #ifndef HAVE_DECL_STRNDUP
   extern char *strndup (const char *, size_t);
 #endif
index 1d48bcc9b4db821709bf934c920f662acb27a741..8d1c36c124c024c6d06134afdb0bf0f585ff9bf7 100644 (file)
@@ -1,5 +1,5 @@
-# sys_select_h.m4 serial 3
-dnl Copyright (C) 2006-2007 Free Software Foundation, Inc.
+# sys_select_h.m4 serial 4
+dnl Copyright (C) 2006-2008 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -9,7 +9,7 @@ AC_DEFUN([gl_HEADER_SYS_SELECT],
   AC_CACHE_CHECK([whether <sys/select.h> is self-contained],
     [gl_cv_header_sys_select_h_selfcontained],
     [
-      AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <sys/select.h>], [])],
+      AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/select.h>]], [[]])],
         [gl_cv_header_sys_select_h_selfcontained=yes],
         [gl_cv_header_sys_select_h_selfcontained=no])
     ])
index d9659c2d75eee465474b20db7b34996fafed0389..2e4e2f6835c5872d65e4ae7a2aad8f0260bfebb6 100644 (file)
@@ -1,5 +1,5 @@
-# sys_socket_h.m4 serial 4
-dnl Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
+# sys_socket_h.m4 serial 6
+dnl Copyright (C) 2005-2008 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -8,18 +8,39 @@ dnl From Simon Josefsson.
 
 AC_DEFUN([gl_HEADER_SYS_SOCKET],
 [
+  AC_REQUIRE([AC_C_INLINE])
+
   AC_CACHE_CHECK([whether <sys/socket.h> is self-contained],
     [gl_cv_header_sys_socket_h_selfcontained],
     [
-      AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <sys/socket.h>], [])],
+      AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/socket.h>]], [[]])],
         [gl_cv_header_sys_socket_h_selfcontained=yes],
         [gl_cv_header_sys_socket_h_selfcontained=no])
     ])
   if test $gl_cv_header_sys_socket_h_selfcontained = yes; then
     SYS_SOCKET_H=''
+    dnl If the shutdown function exists, <sys/socket.h> should define
+    dnl SHUT_RD, SHUT_WR, SHUT_RDWR.
+    AC_CHECK_FUNCS([shutdown])
+    if test $ac_cv_func_shutdown = yes; then
+      AC_CACHE_CHECK([whether <sys/socket.h> defines the SHUT_* macros],
+        [gl_cv_header_sys_socket_h_shut],
+        [
+          AC_COMPILE_IFELSE(
+            [AC_LANG_PROGRAM([[#include <sys/socket.h>]],
+               [[int a[] = { SHUT_RD, SHUT_WR, SHUT_RDWR };]])],
+            [gl_cv_header_sys_socket_h_shut=yes],
+            [gl_cv_header_sys_socket_h_shut=no])
+        ])
+      if test $gl_cv_header_sys_socket_h_shut = no; then
+        SYS_SOCKET_H='sys/socket.h'
+      fi
+    fi
   else
     SYS_SOCKET_H='sys/socket.h'
-
+  fi
+  if test -n "$SYS_SOCKET_H"; then
+    dnl Check prerequisites of the <sys/socket.h> replacement.
     gl_CHECK_NEXT_HEADERS([sys/socket.h])
     if test $ac_cv_header_sys_socket_h = yes; then
       HAVE_SYS_SOCKET_H=1
index 1bc08a17261f8785e7352a9b1c1a91ce48e48cbb..cfe80110c64665a4dc3d819669c687461cd314c3 100644 (file)
@@ -1,5 +1,5 @@
-# sys_stat_h.m4 serial 6   -*- Autoconf -*-
-dnl Copyright (C) 2006-2007 Free Software Foundation, Inc.
+# sys_stat_h.m4 serial 8   -*- Autoconf -*-
+dnl Copyright (C) 2006-2008 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -9,6 +9,8 @@ dnl Test whether <sys/stat.h> contains lstat and mkdir or must be substituted.
 
 AC_DEFUN([gl_HEADER_SYS_STAT_H],
 [
+  AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS])
+
   dnl Check for lstat.  Systems that lack it (mingw) also lack symlinks, so
   dnl stat is a good replacement.
   AC_CHECK_FUNCS_ONCE([lstat])
@@ -19,24 +21,7 @@ AC_DEFUN([gl_HEADER_SYS_STAT_H],
   fi
   AC_SUBST([HAVE_LSTAT])
 
-  dnl Check for mkdir.  Mingw has _mkdir(name) in the nonstandard <io.h>
-  dnl instead.
-  AC_CHECK_DECLS([mkdir],
-    [],
-    [AC_CHECK_HEADERS([io.h])],
-    [#include <sys/stat.h>])
-  if test $ac_cv_have_decl_mkdir = yes; then
-    HAVE_DECL_MKDIR=1
-  else
-    HAVE_DECL_MKDIR=0
-  fi
-  AC_SUBST([HAVE_DECL_MKDIR])
-  if test "$ac_cv_header_io_h" = yes; then
-    HAVE_IO_H=1
-  else
-    HAVE_IO_H=0
-  fi
-  AC_SUBST([HAVE_IO_H])
+  dnl For the mkdir substitute.
   AC_REQUIRE([AC_C_INLINE])
 
   dnl Check for broken stat macros.
@@ -45,4 +30,26 @@ AC_DEFUN([gl_HEADER_SYS_STAT_H],
   gl_CHECK_NEXT_HEADERS([sys/stat.h])
   SYS_STAT_H='sys/stat.h'
   AC_SUBST([SYS_STAT_H])
+
+  dnl Define types that are supposed to be defined in <sys/types.h> or
+  dnl <sys/stat.h>.
+  AC_CHECK_TYPE([nlink_t], [],
+    [AC_DEFINE([nlink_t], [int],
+       [Define to the type of st_nlink in struct stat, or a supertype.])],
+    [#include <sys/types.h>
+     #include <sys/stat.h>])
+
 ]) # gl_HEADER_SYS_STAT_H
+
+AC_DEFUN([gl_SYS_STAT_MODULE_INDICATOR],
+[
+  dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
+  AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS])
+  GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1
+])
+
+AC_DEFUN([gl_SYS_STAT_H_DEFAULTS],
+[
+  dnl Assume proper GNU behavior unless another module says otherwise.
+  REPLACE_MKDIR=0; AC_SUBST([REPLACE_MKDIR])
+])
index c4d3f4fa07187d7898b2adb76a79cdc1917be8ea..536258c06b3ccfca2192956674bfc2df9e867285 100644 (file)
@@ -1,4 +1,4 @@
-# vasnprintf.m4 serial 24
+# vasnprintf.m4 serial 25
 dnl Copyright (C) 2002-2004, 2006-2008 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -6,7 +6,6 @@ dnl with or without modifications, as long as this notice is preserved.
 
 AC_DEFUN([gl_FUNC_VASNPRINTF],
 [
-  AC_REQUIRE([gl_EOVERFLOW])
   AC_CHECK_FUNCS_ONCE([vasnprintf])
   if test $ac_cv_func_vasnprintf = no; then
     gl_REPLACE_VASNPRINTF
index 7dec1df362122b19f913e993feac2dd9f46bad35..3a50a19694cf20a3a3c6fd9f9dd94418387412f4 100644 (file)
@@ -42,6 +42,14 @@ libtests_a_DEPENDENCIES = $(gltests_LIBOBJS)
 EXTRA_libtests_a_SOURCES =
 AM_LIBTOOLFLAGS = --preserve-dup-deps
 
+## begin gnulib module EOVERFLOW-tests
+
+TESTS += test-EOVERFLOW
+check_PROGRAMS += test-EOVERFLOW
+EXTRA_DIST += test-EOVERFLOW.c
+
+## end   gnulib module EOVERFLOW-tests
+
 ## begin gnulib module alloca-opt-tests
 
 TESTS += test-alloca-opt
@@ -73,6 +81,7 @@ EXTRA_DIST += test-fseeko.c test-fseeko.sh
 
 TESTS += test-getaddrinfo
 check_PROGRAMS += test-getaddrinfo
+test_getaddrinfo_LDADD = $(LDADD) @LIBINTL@
 
 EXTRA_DIST += test-getaddrinfo.c
 
index 25289cef06c9d5d94b7c2261330d5631be1ebfaa..3a1383b3d335ac31a23d89485402b9684aba1cb1 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of fseeko() function.
-   Copyright (C) 2007 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2008 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
 #include <config.h>
 
 #include <stdio.h>
+#include <stdlib.h>
 
-/* Get off_t.  */
-#include <sys/types.h>
+#define ASSERT(expr) \
+  do                                                                        \
+    {                                                                       \
+      if (!(expr))                                                          \
+        {                                                                   \
+          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+          fflush (stderr);                                                  \
+          abort ();                                                         \
+        }                                                                   \
+    }                                                                       \
+  while (0)
 
 int
 main (int argc, char **argv)
 {
-  /* Assume stdin is non-empty and seekable iff argc > 1.  */
+  /* Assume stdin is non-empty, seekable, and starts with '#!/bin/sh'
+     iff argc > 1.  */
   int expected = argc > 1 ? 0 : -1;
   /* Exit with success only if fseek/fseeko agree.  */
-  int r1 = fseeko (stdin, (off_t)0, SEEK_CUR);
-  int r2 = fseek (stdin, (long)0, SEEK_CUR);
-  if (r1 != r2 || r1 != expected)
-    return 1;
+  int r1 = fseeko (stdin, 0, SEEK_CUR);
+  int r2 = fseek (stdin, 0, SEEK_CUR);
+  ASSERT (r1 == r2 && r1 == expected);
   if (argc > 1)
     {
-      /* Test that fseek discards ungetc data.  */
+      /* Test that fseek discards previously read ungetc data.  */
       int ch = fgetc (stdin);
-      if (ch == EOF)
-        return 1;
-      if (ungetc (ch ^ 0xff, stdin) != (ch ^ 0xff))
-        return 1;
-      if (fseeko (stdin, (off_t) 0, SEEK_END))
-        return 1;
-      if (fgetc (stdin) != EOF)
-        return 1;
+      ASSERT (ch == '#');
+      ASSERT (ungetc (ch, stdin) == ch);
+      ASSERT (fseeko (stdin, 2, SEEK_SET) == 0);
+      /* Test that fseek discards random ungetc data.  */
+      ch = fgetc (stdin);
+      ASSERT (ch == '/');
+      ASSERT (ungetc (ch ^ 0xff, stdin) == (ch ^ 0xff));
+      ASSERT (fseeko (stdin, 0, SEEK_END) == 0);
+      ASSERT (fgetc (stdin) == EOF);
       /* Test that fseek resets end-of-file marker.  */
-      if (!feof (stdin))
-        return 1;
-      if (fseeko (stdin, (off_t) 0, SEEK_END))
-        return 1;
-      if (feof (stdin))
-        return 1;
+      ASSERT (feof (stdin));
+      ASSERT (fseeko (stdin, 0, SEEK_END) == 0);
+      ASSERT (!feof (stdin));
     }
   return 0;
 }
index 00a980b1bda2dc3e97e1d6406e89fbeb1b6c4913..8d487cb5bf48c90492710bee2c7ef01e4a2d9511 100644 (file)
@@ -19,7 +19,7 @@
 
 #include <config.h>
 #include "getaddrinfo.h"
-#include "inet_ntop.h"
+#include <arpa/inet.h>
 #include <stdio.h>
 #include <string.h>
 
@@ -54,10 +54,18 @@ int simple (char *host, char *service)
 
   if (res != 0)
     {
+      /* IRIX reports EAI_NONAME for "https".  Don't fail the test
+        merely because of this.  */
+      if (res == EAI_NONAME)
+       return 0;
       /* Solaris reports EAI_SERVICE for "http" and "https".  Don't
          fail the test merely because of this.  */
       if (res == EAI_SERVICE)
        return 0;
+      /* AIX reports EAI_NODATA for "https".  Don't fail the test
+        merely because of this.  */
+      if (res == EAI_NODATA)
+       return 0;
 
       return 1;
     }
index aca6d60fc1c63bd10fd46f1105588671095d392c..0c112f6bd5e4af61dbafea9c7435fc6a73bd1dcf 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of getdelim() function.
-   Copyright (C) 2007 Free Software Foundation, Inc.
+   Copyright (C) 2007-2008 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,6 +29,7 @@
       if (!(expr))                                                          \
         {                                                                   \
           fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+          fflush (stderr);                                                  \
           abort ();                                                         \
         }                                                                   \
     }                                                                       \
index cdfefd9095a227ab615a4ae05ca1bd94d2ae51c1..51fc8168660fa1fedec513e8c829202f37a42c75 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of getline() function.
-   Copyright (C) 2007 Free Software Foundation, Inc.
+   Copyright (C) 2007-2008 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,6 +29,7 @@
       if (!(expr))                                                          \
         {                                                                   \
           fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+          fflush (stderr);                                                  \
           abort ();                                                         \
         }                                                                   \
     }                                                                       \
index 01703bf4b5dfd39a0e04958320311de5264e21e0..ebba02ec6dc24350ef27a095d05efc88a8fc5092 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of lseek() function.
-   Copyright (C) 2007 Free Software Foundation, Inc.
+   Copyright (C) 2007-2008 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
@@ -28,6 +28,7 @@
       if (!(expr))                                                          \
         {                                                                   \
           fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+          fflush (stderr);                                                  \
           abort ();                                                         \
         }                                                                   \
     }                                                                       \
index eaac5329a3b352158b7243639d3590e6132f658a..790c999649465907f22fd1f78c0fc2d1e571119c 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of snprintf() function.
-   Copyright (C) 2007 Free Software Foundation, Inc.
+   Copyright (C) 2007-2008 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,6 +29,7 @@
       if (!(expr))                                                          \
         {                                                                   \
           fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+          fflush (stderr);                                                  \
           abort ();                                                         \
         }                                                                   \
     }                                                                       \
index 450fd51a2e8652dc2d6ca6eb8cc0f24f35f4535e..4b5eb767b7fd05bc37bdb9e7b203595f8b634fd3 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <sys/stat.h> substitute.
-   Copyright (C) 2007 Free Software Foundation, Inc.
+   Copyright (C) 2007-2008 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
@@ -253,6 +253,9 @@ verify (!S_ISWHT (S_IFLNK));
 verify (!S_ISWHT (S_IFSOCK));
 #endif
 
+/* Check the existence of some types.  */
+nlink_t t1;
+
 int
 main ()
 {
index 72f1f9587374ac4e98cd1e52398981df8c5c86d0..2f3f8900d797ba9a80c5d45ee4196991767abe16 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of vasnprintf() and asnprintf() functions.
-   Copyright (C) 2007 Free Software Foundation, Inc.
+   Copyright (C) 2007-2008 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
@@ -31,6 +31,7 @@
       if (!(expr))                                                          \
         {                                                                   \
           fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+          fflush (stderr);                                                  \
           abort ();                                                         \
         }                                                                   \
     }                                                                       \
index fc950a12d26ae439356c7d51d6bee39b43b5d43a..7c4a728b0545c36d24fb47f5362a63c7f65e0298 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of vasprintf() and asprintf() functions.
-   Copyright (C) 2007 Free Software Foundation, Inc.
+   Copyright (C) 2007-2008 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,6 +30,7 @@
       if (!(expr))                                                          \
         {                                                                   \
           fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+          fflush (stderr);                                                  \
           abort ();                                                         \
         }                                                                   \
     }                                                                       \