Update Gnulib; add new modules.
authorLudovic Courtès <ludo@gnu.org>
Mon, 14 Feb 2011 10:36:25 +0000 (11:36 +0100)
committerLudovic Courtès <ludo@gnu.org>
Mon, 14 Feb 2011 10:36:25 +0000 (11:36 +0100)
This updates Gnulib to v0.0-4889-ge375fe3.

* m4/gnulib-cache.m4: Add `accept', `bind', `close', `connect',
  `getpeername', `getsockname', `getsockopt', `listen', `malloc',
  `malloca', `recv', `recvfrom', `send', `sendto', `setsockopt',
  `shutdown', `socket', and `sockets', requested by
  Jan Nieuwenhuizen <janneke-list@xs4all.nl> for cross-MinGW32 builds.
  Add `trunc', requested by Mark H Weaver <mhw@netris.org>.

270 files changed:
GNUmakefile
build-aux/announce-gen
build-aux/arg-nonnull.h
build-aux/c++defs.h
build-aux/config.rpath
build-aux/git-version-gen
build-aux/gitlog-to-changelog
build-aux/gnu-web-doc-update
build-aux/unused-parameter.h
build-aux/useless-if-before-free
build-aux/vc-list-files
build-aux/warn-on-use.h
lib/Makefile.am
lib/accept.c [new file with mode: 0644]
lib/alignof.h
lib/alloca.in.h
lib/arpa_inet.in.h
lib/asnprintf.c
lib/bind.c [new file with mode: 0644]
lib/byteswap.in.h
lib/c-ctype.c
lib/c-ctype.h
lib/c-strcase.h
lib/c-strcasecmp.c
lib/c-strcaseeq.h
lib/c-strncasecmp.c
lib/canonicalize-lgpl.c
lib/close-hook.c
lib/close-hook.h
lib/close.c [moved from lib/mbrlen.c with 63% similarity]
lib/config.charset [deleted file]
lib/connect.c [new file with mode: 0644]
lib/duplocale.c
lib/errno.in.h
lib/fclose.c [new file with mode: 0644]
lib/float+.h
lib/float.in.h
lib/flock.c
lib/full-read.c
lib/full-read.h
lib/full-write.c
lib/full-write.h
lib/gai_strerror.c
lib/getaddrinfo.c
lib/getpeername.c [new file with mode: 0644]
lib/getsockname.c [new file with mode: 0644]
lib/getsockopt.c [new file with mode: 0644]
lib/gettext.h
lib/iconv.c
lib/iconv.in.h
lib/iconv_close.c
lib/iconv_open.c
lib/iconveh.h
lib/inet_ntop.c
lib/inet_pton.c
lib/isinf.c
lib/isnan.c
lib/isnand.c
lib/isnanf.c
lib/isnanl.c
lib/listen.c [new file with mode: 0644]
lib/localcharset.c [deleted file]
lib/localcharset.h [deleted file]
lib/locale.in.h
lib/lstat.c
lib/malloc.c
lib/malloca.c
lib/malloca.h
lib/math.in.h
lib/mbrtowc.c [deleted file]
lib/mbsinit.c [deleted file]
lib/memchr.c
lib/netdb.in.h
lib/netinet_in.in.h
lib/nproc.c
lib/nproc.h
lib/pathmax.h
lib/printf-args.c
lib/printf-args.h
lib/printf-parse.c
lib/printf-parse.h
lib/putenv.c
lib/readlink.c
lib/recv.c [new file with mode: 0644]
lib/recvfrom.c [new file with mode: 0644]
lib/ref-add.sin [deleted file]
lib/ref-del.sin [deleted file]
lib/safe-read.c
lib/safe-read.h
lib/safe-write.c
lib/safe-write.h
lib/send.c [new file with mode: 0644]
lib/sendto.c [new file with mode: 0644]
lib/setsockopt.c [new file with mode: 0644]
lib/shutdown.c [new file with mode: 0644]
lib/size_max.h
lib/snprintf.c
lib/socket.c [new file with mode: 0644]
lib/sockets.c
lib/sockets.h
lib/stat-time.h
lib/stat.c
lib/stdarg.in.h
lib/stdbool.in.h
lib/stddef.in.h
lib/stdint.in.h
lib/stdio-write.c
lib/stdio.in.h
lib/stdlib.in.h
lib/strcasecmp.c
lib/streq.h [deleted file]
lib/strftime.c
lib/strftime.h
lib/striconveh.c
lib/striconveh.h
lib/string.in.h
lib/strings.in.h
lib/strncasecmp.c
lib/sys_file.in.h
lib/sys_socket.in.h
lib/sys_stat.in.h
lib/sys_time.in.h [new file with mode: 0644]
lib/time.in.h
lib/time_r.c
lib/trunc.c [new file with mode: 0644]
lib/unistd.in.h
lib/unistr.in.h
lib/unistr/u8-mbtouc-aux.c
lib/unistr/u8-mbtouc-unsafe-aux.c
lib/unistr/u8-mbtouc-unsafe.c
lib/unistr/u8-mbtouc.c
lib/unistr/u8-mbtoucr.c
lib/unistr/u8-prev.c
lib/unistr/u8-uctomb-aux.c
lib/unistr/u8-uctomb.c
lib/unitypes.in.h
lib/vasnprintf.c
lib/vasnprintf.h
lib/verify.h
lib/version-etc-fsf.c
lib/version-etc.c
lib/version-etc.h
lib/vsnprintf.c
lib/w32sock.h
lib/wchar.in.h
lib/write.c
lib/xsize.h
m4/00gnulib.m4
m4/absolute-header.m4
m4/alloca.m4
m4/arpa_inet_h.m4
m4/asm-underscore.m4
m4/autobuild.m4
m4/byteswap.m4
m4/canonicalize.m4
m4/check-math-lib.m4
m4/close.m4 [new file with mode: 0644]
m4/codeset.m4 [deleted file]
m4/configmake.m4 [deleted file]
m4/dos.m4
m4/double-slash-root.m4
m4/duplocale.m4
m4/eealloc.m4
m4/environ.m4
m4/errno_h.m4
m4/exponentd.m4
m4/exponentf.m4
m4/exponentl.m4
m4/extensions.m4
m4/fclose.m4 [new file with mode: 0644]
m4/fcntl-o.m4 [deleted file]
m4/float_h.m4
m4/flock.m4
m4/fpieee.m4
m4/func.m4
m4/getaddrinfo.m4
m4/glibc21.m4 [deleted file]
m4/gnulib-cache.m4
m4/gnulib-common.m4
m4/gnulib-comp.m4
m4/gnulib-tool.m4
m4/hostent.m4
m4/iconv.m4
m4/iconv_h.m4
m4/iconv_open.m4
m4/include_next.m4
m4/inet_ntop.m4
m4/inet_pton.m4
m4/inline.m4
m4/intmax_t.m4
m4/inttypes_h.m4
m4/isinf.m4
m4/isnan.m4
m4/isnand.m4
m4/isnanf.m4
m4/isnanl.m4
m4/ld-version-script.m4
m4/lib-ld.m4
m4/lib-link.m4
m4/lib-prefix.m4
m4/libunistring-base.m4
m4/libunistring.m4
m4/localcharset.m4 [deleted file]
m4/locale-fr.m4 [deleted file]
m4/locale-ja.m4 [deleted file]
m4/locale-zh.m4 [deleted file]
m4/locale_h.m4
m4/longlong.m4
m4/lstat.m4
m4/malloc.m4
m4/malloca.m4
m4/math_h.m4
m4/mbrlen.m4 [deleted file]
m4/mbrtowc.m4 [deleted file]
m4/mbsinit.m4 [deleted file]
m4/mbstate_t.m4 [deleted file]
m4/memchr.m4
m4/mmap-anon.m4
m4/multiarch.m4
m4/netdb_h.m4
m4/netinet_in_h.m4
m4/nproc.m4
m4/pathmax.m4
m4/printf.m4
m4/putenv.m4
m4/readlink.m4
m4/safe-read.m4
m4/safe-write.m4
m4/servent.m4
m4/size_max.m4
m4/snprintf.m4
m4/socketlib.m4
m4/sockets.m4
m4/socklen.m4
m4/sockpfaf.m4
m4/ssize_t.m4
m4/stat-time.m4
m4/stat.m4
m4/stdarg.m4
m4/stdbool.m4
m4/stddef_h.m4
m4/stdint.m4
m4/stdint_h.m4
m4/stdio_h.m4
m4/stdlib_h.m4
m4/strcase.m4
m4/strftime.m4
m4/string_h.m4
m4/strings_h.m4
m4/sys_file_h.m4
m4/sys_socket_h.m4
m4/sys_stat_h.m4
m4/sys_time_h.m4 [new file with mode: 0644]
m4/time_h.m4
m4/time_r.m4
m4/tm_gmtoff.m4
m4/trunc.m4 [new file with mode: 0644]
m4/unistd_h.m4
m4/vasnprintf.m4
m4/version-etc.m4
m4/visibility.m4
m4/vsnprintf.m4
m4/warn-on-use.m4
m4/warnings.m4
m4/wchar_h.m4
m4/wchar_t.m4
m4/wint_t.m4
m4/write.m4
m4/xsize.m4
maint.mk

index 0394d98..6e00ec8 100644 (file)
@@ -5,7 +5,7 @@
 # It is necessary if you want to build targets usually of interest
 # only to the maintainer.
 
 # It is necessary if you want to build targets usually of interest
 # only to the maintainer.
 
-# Copyright (C) 2001, 2003, 2006-2010 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2003, 2006-2011 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
 
 # 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
index 7f9ec86..4886926 100755 (executable)
@@ -9,7 +9,7 @@ my $VERSION = '2010-05-03 20:17'; # UTC
 # If you change this file with Emacs, please let the write hook
 # do its job.  Otherwise, update this string manually.
 
 # If you change this file with Emacs, please let the write hook
 # do its job.  Otherwise, update this string manually.
 
-# Copyright (C) 2002-2010 Free Software Foundation, Inc.
+# Copyright (C) 2002-2011 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
 
 # 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
index 7e3e2db..6c2f1e8 100644 (file)
@@ -1,5 +1,5 @@
 /* A C macro for declaring that specific arguments must not be NULL.
 /* A C macro for declaring that specific arguments must not be NULL.
-   Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+   Copyright (C) 2009-2011 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
 
    This program is free software: you can redistribute it and/or modify it
    under the terms of the GNU General Public License as published
@@ -9,7 +9,7 @@
    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
    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.
+   General Public License for more details.
 
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
index 0c2fad7..b6821a6 100644 (file)
@@ -1,5 +1,5 @@
 /* C++ compatible function declaration macros.
 /* C++ compatible function declaration macros.
-   Copyright (C) 2010 Free Software Foundation, Inc.
+   Copyright (C) 2010-2011 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
 
    This program is free software: you can redistribute it and/or modify it
    under the terms of the GNU General Public License as published
@@ -9,7 +9,7 @@
    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
    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.
+   General Public License for more details.
 
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
index 17298f2..0e87769 100755 (executable)
@@ -2,7 +2,7 @@
 # Output a system dependent set of variables, describing how to set the
 # run time search path of shared libraries in an executable.
 #
 # Output a system dependent set of variables, describing how to set the
 # run time search path of shared libraries in an executable.
 #
-#   Copyright 1996-2010 Free Software Foundation, Inc.
+#   Copyright 1996-2011 Free Software Foundation, Inc.
 #   Taken from GNU libtool, 2001
 #   Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
 #
 #   Taken from GNU libtool, 2001
 #   Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
 #
@@ -357,9 +357,6 @@ else
     dgux*)
       hardcode_libdir_flag_spec='-L$libdir'
       ;;
     dgux*)
       hardcode_libdir_flag_spec='-L$libdir'
       ;;
-    freebsd1*)
-      ld_shlibs=no
-      ;;
     freebsd2.2*)
       hardcode_libdir_flag_spec='-R$libdir'
       hardcode_direct=yes
     freebsd2.2*)
       hardcode_libdir_flag_spec='-R$libdir'
       hardcode_direct=yes
@@ -534,8 +531,6 @@ case "$host_os" in
   dgux*)
     library_names_spec='$libname$shrext'
     ;;
   dgux*)
     library_names_spec='$libname$shrext'
     ;;
-  freebsd1*)
-    ;;
   freebsd* | dragonfly*)
     case "$host_os" in
       freebsd[123]*)
   freebsd* | dragonfly*)
     case "$host_os" in
       freebsd[123]*)
index 795a98b..68c7d64 100755 (executable)
@@ -1,8 +1,8 @@
 #!/bin/sh
 # Print a version string.
 #!/bin/sh
 # Print a version string.
-scriptversion=2010-10-13.20; # UTC
+scriptversion=2011-01-04.17; # UTC
 
 
-# Copyright (C) 2007-2010 Free Software Foundation, Inc.
+# Copyright (C) 2007-2011 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
 #
 # 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
@@ -85,14 +85,14 @@ v=
 # then try "git describe", then default.
 if test -f $tarball_version_file
 then
 # then try "git describe", then default.
 if test -f $tarball_version_file
 then
-    v=`cat $tarball_version_file` || exit 1
+    v=`cat $tarball_version_file` || v=
     case $v in
     case $v in
-       *$nl*) v= ;; # reject multi-line output
-       [0-9]*) ;;
-       *) v= ;;
+        *$nl*) v= ;; # reject multi-line output
+        [0-9]*) ;;
+        *) v= ;;
     esac
     test -z "$v" \
     esac
     test -z "$v" \
-       && echo "$0: WARNING: $tarball_version_file seems to be damaged" 1>&2
+        && echo "$0: WARNING: $tarball_version_file is missing or damaged" 1>&2
 fi
 
 if test -n "$v"
 fi
 
 if test -n "$v"
@@ -103,11 +103,11 @@ then
 # derive a version string.
 elif test "`git log -1 --pretty=format:x . 2>&1`" = x \
     && v=`git describe --abbrev=4 --match='v*' HEAD 2>/dev/null \
 # derive a version string.
 elif test "`git log -1 --pretty=format:x . 2>&1`" = x \
     && v=`git describe --abbrev=4 --match='v*' HEAD 2>/dev/null \
-         || git describe --abbrev=4 HEAD 2>/dev/null` \
+          || git describe --abbrev=4 HEAD 2>/dev/null` \
     && v=`printf '%s\n' "$v" | sed "$tag_sed_script"` \
     && case $v in
     && v=`printf '%s\n' "$v" | sed "$tag_sed_script"` \
     && case $v in
-        v[0-9]*) ;;
-        *) (exit 1) ;;
+         v[0-9]*) ;;
+         *) (exit 1) ;;
        esac
 then
     # Is this a new git that lists number of commits since the last
        esac
 then
     # Is this a new git that lists number of commits since the last
@@ -115,16 +115,20 @@ then
     #   Newer: v6.10-77-g0f8faeb
     #   Older: v6.10-g0f8faeb
     case $v in
     #   Newer: v6.10-77-g0f8faeb
     #   Older: v6.10-g0f8faeb
     case $v in
-       *-*-*) : git describe is okay three part flavor ;;
-       *-*)
-           : git describe is older two part flavor
-           # Recreate the number of commits and rewrite such that the
-           # result is the same as if we were using the newer version
-           # of git describe.
-           vtag=`echo "$v" | sed 's/-.*//'`
-           numcommits=`git rev-list "$vtag"..HEAD | wc -l`
-           v=`echo "$v" | sed "s/\(.*\)-\(.*\)/\1-$numcommits-\2/"`;
-           ;;
+        *-*-*) : git describe is okay three part flavor ;;
+        *-*)
+            : git describe is older two part flavor
+            # Recreate the number of commits and rewrite such that the
+            # result is the same as if we were using the newer version
+            # of git describe.
+            vtag=`echo "$v" | sed 's/-.*//'`
+            commit_list=`git rev-list "$vtag"..HEAD 2>/dev/null` \
+                || { commit_list=failed;
+                     echo "$0: WARNING: git rev-list failed" 1>&2; }
+            numcommits=`echo "$commit_list" | wc -l`
+            v=`echo "$v" | sed "s/\(.*\)-\(.*\)/\1-$numcommits-\2/"`;
+            test "$commit_list" = failed && v=UNKNOWN
+            ;;
     esac
 
     # Change the first '-' to a '.', so version-comparing tools work properly.
     esac
 
     # Change the first '-' to a '.', so version-comparing tools work properly.
@@ -139,14 +143,14 @@ v=`echo "$v" |sed 's/^v//'`
 # Don't declare a version "dirty" merely because a time stamp has changed.
 git update-index --refresh > /dev/null 2>&1
 
 # Don't declare a version "dirty" merely because a time stamp has changed.
 git update-index --refresh > /dev/null 2>&1
 
-dirty=`sh -c 'git diff-index --name-only HEAD' 2>/dev/null` || dirty=
+dirty=`exec 2>/dev/null;git diff-index --name-only HEAD` || dirty=
 case "$dirty" in
     '') ;;
     *) # Append the suffix only if there isn't one already.
 case "$dirty" in
     '') ;;
     *) # Append the suffix only if there isn't one already.
-       case $v in
-         *-dirty) ;;
-         *) v="$v-dirty" ;;
-       esac ;;
+        case $v in
+          *-dirty) ;;
+          *) v="$v-dirty" ;;
+        esac ;;
 esac
 
 # Omit the trailing newline, so that m4_esyscmd can use the result directly.
 esac
 
 # Omit the trailing newline, so that m4_esyscmd can use the result directly.
index 7660af5..4559704 100755 (executable)
@@ -9,7 +9,7 @@ my $VERSION = '2009-10-30 13:46'; # UTC
 # If you change this file with Emacs, please let the write hook
 # do its job.  Otherwise, update this string manually.
 
 # If you change this file with Emacs, please let the write hook
 # do its job.  Otherwise, update this string manually.
 
-# Copyright (C) 2008-2010 Free Software Foundation, Inc.
+# Copyright (C) 2008-2011 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
 
 # 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
index e834dcf..f6d0ee1 100755 (executable)
@@ -9,7 +9,7 @@
 
 VERSION=2009-07-21.16; # UTC
 
 
 VERSION=2009-07-21.16; # UTC
 
-# Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+# Copyright (C) 2009-2011 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
 
 # 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
index b6fa325..c8d2071 100644 (file)
@@ -1,5 +1,5 @@
 /* A C macro for declaring that specific function parameters are not used.
 /* A C macro for declaring that specific function parameters are not used.
-   Copyright (C) 2008-2010 Free Software Foundation, Inc.
+   Copyright (C) 2008-2011 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
 
    This program is free software: you can redistribute it and/or modify it
    under the terms of the GNU General Public License as published
@@ -9,7 +9,7 @@
    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
    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.
+   General Public License for more details.
 
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
index 6aa7d39..a6c228b 100755 (executable)
@@ -2,17 +2,15 @@ eval '(exit $?0)' && eval 'exec perl -wST "$0" ${1+"$@"}'
   & eval 'exec perl -wST "$0" $argv:q'
     if 0;
 # Detect instances of "if (p) free (p);".
   & eval 'exec perl -wST "$0" $argv:q'
     if 0;
 # Detect instances of "if (p) free (p);".
-# Likewise for "if (p != NULL) free (p);".  And with braces.
-# Also detect "if (NULL != p) free (p);".
-# And with 0 in place of NULL.
+# Likewise "if (p != 0)", "if (0 != p)", or with NULL; and with braces.
 
 
-my $VERSION = '2009-04-16 15:57'; # UTC
+my $VERSION = '2011-01-09 01:39'; # 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
 # do its job.  Otherwise, update this string manually.
 
 # 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
 # do its job.  Otherwise, update this string manually.
 
-# Copyright (C) 2008-2010 Free Software Foundation, Inc.
+# Copyright (C) 2008-2011 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
 
 # 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
@@ -63,7 +61,7 @@ detect free-like functions named FOO and BAR.
 
 OPTIONS:
 
 
 OPTIONS:
 
-   --list       print only the name of each matching FILE (\0-terminated)
+   --list       print only the name of each matching FILE (\\0-terminated)
    --name=N     add name N to the list of \`free\'-like functions to detect;
                   may be repeated
 
    --name=N     add name N to the list of \`free\'-like functions to detect;
                   may be repeated
 
index 48a33ee..9bb6fe6 100755 (executable)
@@ -4,7 +4,7 @@
 # Print a version string.
 scriptversion=2010-04-23.22; # UTC
 
 # Print a version string.
 scriptversion=2010-04-23.22; # UTC
 
-# Copyright (C) 2006-2010 Free Software Foundation, Inc.
+# Copyright (C) 2006-2011 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
 
 # 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
index 171e599..2cdeec3 100644 (file)
@@ -1,5 +1,5 @@
 /* A C macro for emitting warnings if a function is used.
 /* A C macro for emitting warnings if a function is used.
-   Copyright (C) 2010 Free Software Foundation, Inc.
+   Copyright (C) 2010-2011 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
 
    This program is free software: you can redistribute it and/or modify it
    under the terms of the GNU General Public License as published
@@ -9,7 +9,7 @@
    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
    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.
+   General Public License for more details.
 
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
index 7e2d4d4..6d59b8b 100644 (file)
@@ -1,6 +1,6 @@
 ## DO NOT EDIT! GENERATED AUTOMATICALLY!
 ## Process this file with automake to produce Makefile.in.
 ## DO NOT EDIT! GENERATED AUTOMATICALLY!
 ## Process this file with automake to produce Makefile.in.
-# Copyright (C) 2002-2010 Free Software Foundation, Inc.
+# Copyright (C) 2002-2011 Free Software Foundation, Inc.
 #
 # This file is free software, distributed under the terms of the GNU
 # General Public License.  As a special exception to the GNU General
 #
 # This file is free software, distributed under the terms of the GNU
 # General Public License.  As a special exception to the GNU General
@@ -9,7 +9,7 @@
 # the same distribution terms as the rest of that program.
 #
 # Generated by gnulib-tool.
 # the same distribution terms as the rest of that program.
 #
 # Generated by gnulib-tool.
-# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --lgpl=3 --libtool --macro-prefix=gl --no-vc-files alignof alloca-opt announce-gen autobuild byteswap canonicalize-lgpl duplocale environ extensions flock fpieee full-read full-write func gendocs getaddrinfo git-version-gen gitlog-to-changelog gnu-web-doc-update gnupload havelib iconv_open-utf inet_ntop inet_pton isinf isnan lib-symbol-versions lib-symbol-visibility libunistring locale maintainer-makefile nproc putenv stat-time stdlib strcase strftime striconveh string sys_stat verify version-etc-fsf vsnprintf warnings
+# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --lgpl=3 --libtool --macro-prefix=gl --no-vc-files accept alignof alloca-opt announce-gen autobuild bind byteswap canonicalize-lgpl close connect duplocale environ extensions flock fpieee full-read full-write func gendocs getaddrinfo getpeername getsockname getsockopt git-version-gen gitlog-to-changelog gnu-web-doc-update gnupload havelib iconv_open-utf inet_ntop inet_pton isinf isnan lib-symbol-versions lib-symbol-visibility libunistring listen locale maintainer-makefile malloc malloca nproc putenv recv recvfrom send sendto setsockopt shutdown socket sockets stat-time stdlib strcase strftime striconveh string sys_stat trunc verify version-etc-fsf vsnprintf warnings
 
 AUTOMAKE_OPTIONS = 1.5 gnits subdir-objects
 
 
 AUTOMAKE_OPTIONS = 1.5 gnits subdir-objects
 
@@ -49,6 +49,16 @@ libgnu_la_LDFLAGS += $(LTLIBICONV)
 libgnu_la_LDFLAGS += $(LTLIBINTL)
 libgnu_la_LDFLAGS += $(LTLIBUNISTRING)
 libgnu_la_LDFLAGS += $(SERVENT_LIB)
 libgnu_la_LDFLAGS += $(LTLIBINTL)
 libgnu_la_LDFLAGS += $(LTLIBUNISTRING)
 libgnu_la_LDFLAGS += $(SERVENT_LIB)
+libgnu_la_LDFLAGS += $(TRUNC_LIBM)
+
+## begin gnulib module accept
+
+
+EXTRA_DIST += accept.c w32sock.h
+
+EXTRA_libgnu_la_SOURCES += accept.c
+
+## end   gnulib module accept
 
 ## begin gnulib module alignof
 
 
 ## begin gnulib module alignof
 
@@ -112,7 +122,7 @@ BUILT_SOURCES += arpa/inet.h
 
 # We need the following in order to create <arpa/inet.h> when the system
 # doesn't have one.
 
 # We need the following in order to create <arpa/inet.h> when the system
 # doesn't have one.
-arpa/inet.h: arpa_inet.in.h $(WARN_ON_USE_H) $(ARG_NONNULL_H)
+arpa/inet.h: arpa_inet.in.h $(CXXDEFS_H) $(WARN_ON_USE_H) $(ARG_NONNULL_H)
        $(AM_V_at)$(MKDIR_P) arpa
        $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
        $(AM_V_at)$(MKDIR_P) arpa
        $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
@@ -126,6 +136,7 @@ arpa/inet.h: arpa_inet.in.h $(WARN_ON_USE_H) $(ARG_NONNULL_H)
              -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' \
              -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' \
+             -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
              -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
              -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
              < $(srcdir)/arpa_inet.in.h; \
              -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
              -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
              < $(srcdir)/arpa_inet.in.h; \
@@ -138,6 +149,15 @@ EXTRA_DIST += arpa_inet.in.h
 
 ## end   gnulib module arpa_inet
 
 
 ## end   gnulib module arpa_inet
 
+## begin gnulib module bind
+
+
+EXTRA_DIST += bind.c w32sock.h
+
+EXTRA_libgnu_la_SOURCES += bind.c
+
+## end   gnulib module bind
+
 ## begin gnulib module byteswap
 
 BUILT_SOURCES += $(BYTESWAP_H)
 ## begin gnulib module byteswap
 
 BUILT_SOURCES += $(BYTESWAP_H)
@@ -208,6 +228,15 @@ EXTRA_libgnu_la_SOURCES += canonicalize-lgpl.c
 
 ## end   gnulib module canonicalize-lgpl
 
 
 ## end   gnulib module canonicalize-lgpl
 
+## begin gnulib module close
+
+
+EXTRA_DIST += close.c
+
+EXTRA_libgnu_la_SOURCES += close.c
+
+## end   gnulib module close
+
 ## begin gnulib module close-hook
 
 libgnu_la_SOURCES += close-hook.c
 ## begin gnulib module close-hook
 
 libgnu_la_SOURCES += close-hook.c
@@ -216,67 +245,14 @@ EXTRA_DIST += close-hook.h
 
 ## end   gnulib module close-hook
 
 
 ## end   gnulib module close-hook
 
-## begin gnulib module configmake
+## begin gnulib module connect
 
 
-# Retrieve values of the variables through 'configure' followed by
-# 'make', not directly through 'configure', so that a user who
-# sets some of these variables consistently on the 'make' command
-# line gets correct results.
-#
-# One advantage of this approach, compared to the classical
-# approach of adding -DLIBDIR=\"$(libdir)\" etc. to AM_CPPFLAGS,
-# is that it protects against the use of undefined variables.
-# If, say, $(libdir) is not set in the Makefile, LIBDIR is not
-# defined by this module, and code using LIBDIR gives a
-# compilation error.
-#
-# Another advantage is that 'make' output is shorter.
-#
-# Listed in the same order as the GNU makefile conventions, and
-# provided by autoconf 2.59c+.
-# The Automake-defined pkg* macros are appended, in the order
-# listed in the Automake 1.10a+ documentation.
-configmake.h: Makefile
-       $(AM_V_GEN)rm -f $@-t && \
-       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
-         echo '#define PREFIX "$(prefix)"'; \
-         echo '#define EXEC_PREFIX "$(exec_prefix)"'; \
-         echo '#define BINDIR "$(bindir)"'; \
-         echo '#define SBINDIR "$(sbindir)"'; \
-         echo '#define LIBEXECDIR "$(libexecdir)"'; \
-         echo '#define DATAROOTDIR "$(datarootdir)"'; \
-         echo '#define DATADIR "$(datadir)"'; \
-         echo '#define SYSCONFDIR "$(sysconfdir)"'; \
-         echo '#define SHAREDSTATEDIR "$(sharedstatedir)"'; \
-         echo '#define LOCALSTATEDIR "$(localstatedir)"'; \
-         echo '#define INCLUDEDIR "$(includedir)"'; \
-         echo '#define OLDINCLUDEDIR "$(oldincludedir)"'; \
-         echo '#define DOCDIR "$(docdir)"'; \
-         echo '#define INFODIR "$(infodir)"'; \
-         echo '#define HTMLDIR "$(htmldir)"'; \
-         echo '#define DVIDIR "$(dvidir)"'; \
-         echo '#define PDFDIR "$(pdfdir)"'; \
-         echo '#define PSDIR "$(psdir)"'; \
-         echo '#define LIBDIR "$(libdir)"'; \
-         echo '#define LISPDIR "$(lispdir)"'; \
-         echo '#define LOCALEDIR "$(localedir)"'; \
-         echo '#define MANDIR "$(mandir)"'; \
-         echo '#define MANEXT "$(manext)"'; \
-         echo '#define PKGDATADIR "$(pkgdatadir)"'; \
-         echo '#define PKGINCLUDEDIR "$(pkgincludedir)"'; \
-         echo '#define PKGLIBDIR "$(pkglibdir)"'; \
-         echo '#define PKGLIBEXECDIR "$(pkglibexecdir)"'; \
-       } | sed '/""/d' > $@-t && \
-       if test -f $@ && cmp $@-t $@ > /dev/null; then \
-         rm -f $@-t; \
-       else \
-         rm -f $@; mv $@-t $@; \
-       fi
-
-BUILT_SOURCES += configmake.h
-CLEANFILES += configmake.h configmake.h-t
-
-## end   gnulib module configmake
+
+EXTRA_DIST += connect.c w32sock.h
+
+EXTRA_libgnu_la_SOURCES += connect.c
+
+## end   gnulib module connect
 
 ## begin gnulib module duplocale
 
 
 ## begin gnulib module duplocale
 
@@ -315,6 +291,15 @@ EXTRA_DIST += errno.in.h
 
 ## end   gnulib module errno
 
 
 ## end   gnulib module errno
 
+## begin gnulib module fclose
+
+
+EXTRA_DIST += fclose.c
+
+EXTRA_libgnu_la_SOURCES += fclose.c
+
+## end   gnulib module fclose
+
 ## begin gnulib module float
 
 BUILT_SOURCES += $(FLOAT_H)
 ## begin gnulib module float
 
 BUILT_SOURCES += $(FLOAT_H)
@@ -374,6 +359,33 @@ EXTRA_libgnu_la_SOURCES += gai_strerror.c getaddrinfo.c
 
 ## end   gnulib module getaddrinfo
 
 
 ## end   gnulib module getaddrinfo
 
+## begin gnulib module getpeername
+
+
+EXTRA_DIST += getpeername.c w32sock.h
+
+EXTRA_libgnu_la_SOURCES += getpeername.c
+
+## end   gnulib module getpeername
+
+## begin gnulib module getsockname
+
+
+EXTRA_DIST += getsockname.c w32sock.h
+
+EXTRA_libgnu_la_SOURCES += getsockname.c
+
+## end   gnulib module getsockname
+
+## begin gnulib module getsockopt
+
+
+EXTRA_DIST += getsockopt.c w32sock.h
+
+EXTRA_libgnu_la_SOURCES += getsockopt.c
+
+## end   gnulib module getsockopt
+
 ## begin gnulib module gettext-h
 
 libgnu_la_SOURCES += gettext.h
 ## begin gnulib module gettext-h
 
 libgnu_la_SOURCES += gettext.h
@@ -569,79 +581,14 @@ EXTRA_DIST += libunistring.valgrind
 
 ## end   gnulib module libunistring
 
 
 ## end   gnulib module libunistring
 
-## begin gnulib module localcharset
-
-libgnu_la_SOURCES += localcharset.h localcharset.c
-
-# We need the following in order to install a simple file in $(libdir)
-# which is shared with other installed packages. We use a list of referencing
-# packages so that "make uninstall" will remove the file if and only if it
-# is not used by another installed package.
-# On systems with glibc-2.1 or newer, the file is redundant, therefore we
-# avoid installing it.
-
-all-local: charset.alias ref-add.sed ref-del.sed
-
-charset_alias = $(DESTDIR)$(libdir)/charset.alias
-charset_tmp = $(DESTDIR)$(libdir)/charset.tmp
-install-exec-local: install-exec-localcharset
-install-exec-localcharset: all-local
-       if test $(GLIBC21) = no; then \
-         case '$(host_os)' in \
-           darwin[56]*) \
-             need_charset_alias=true ;; \
-           darwin* | cygwin* | mingw* | pw32* | cegcc*) \
-             need_charset_alias=false ;; \
-           *) \
-             need_charset_alias=true ;; \
-         esac ; \
-       else \
-         need_charset_alias=false ; \
-       fi ; \
-       if $$need_charset_alias; then \
-         $(mkinstalldirs) $(DESTDIR)$(libdir) ; \
-       fi ; \
-       if test -f $(charset_alias); then \
-         sed -f ref-add.sed $(charset_alias) > $(charset_tmp) ; \
-         $(INSTALL_DATA) $(charset_tmp) $(charset_alias) ; \
-         rm -f $(charset_tmp) ; \
-       else \
-         if $$need_charset_alias; then \
-           sed -f ref-add.sed charset.alias > $(charset_tmp) ; \
-           $(INSTALL_DATA) $(charset_tmp) $(charset_alias) ; \
-           rm -f $(charset_tmp) ; \
-         fi ; \
-       fi
-
-uninstall-local: uninstall-localcharset
-uninstall-localcharset: all-local
-       if test -f $(charset_alias); then \
-         sed -f ref-del.sed $(charset_alias) > $(charset_tmp); \
-         if grep '^# Packages using this file: $$' $(charset_tmp) \
-             > /dev/null; then \
-           rm -f $(charset_alias); \
-         else \
-           $(INSTALL_DATA) $(charset_tmp) $(charset_alias); \
-         fi; \
-         rm -f $(charset_tmp); \
-       fi
-
-charset.alias: config.charset
-       $(AM_V_GEN)rm -f t-$@ $@ && \
-       $(SHELL) $(srcdir)/config.charset '$(host)' > t-$@ && \
-       mv t-$@ $@
+## begin gnulib module listen
 
 
-SUFFIXES += .sed .sin
-.sin.sed:
-       $(AM_V_GEN)rm -f t-$@ $@ && \
-       sed -e '/^#/d' -e 's/@''PACKAGE''@/$(PACKAGE)/g' $< > t-$@ && \
-       mv t-$@ $@
 
 
-CLEANFILES += charset.alias ref-add.sed ref-del.sed
+EXTRA_DIST += listen.c w32sock.h
 
 
-EXTRA_DIST += config.charset ref-add.sin ref-del.sin
+EXTRA_libgnu_la_SOURCES += listen.c
 
 
-## end   gnulib module localcharset
+## end   gnulib module listen
 
 ## begin gnulib module locale
 
 
 ## begin gnulib module locale
 
@@ -656,9 +603,11 @@ locale.h: locale.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
              -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
              -e 's|@''NEXT_LOCALE_H''@|$(NEXT_LOCALE_H)|g' \
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
              -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
              -e 's|@''NEXT_LOCALE_H''@|$(NEXT_LOCALE_H)|g' \
+             -e 's|@''GNULIB_SETLOCALE''@|$(GNULIB_SETLOCALE)|g' \
              -e 's|@''GNULIB_DUPLOCALE''@|$(GNULIB_DUPLOCALE)|g' \
              -e 's|@''HAVE_DUPLOCALE''@|$(HAVE_DUPLOCALE)|g' \
              -e 's|@''HAVE_XLOCALE_H''@|$(HAVE_XLOCALE_H)|g' \
              -e 's|@''GNULIB_DUPLOCALE''@|$(GNULIB_DUPLOCALE)|g' \
              -e 's|@''HAVE_DUPLOCALE''@|$(HAVE_DUPLOCALE)|g' \
              -e 's|@''HAVE_XLOCALE_H''@|$(HAVE_XLOCALE_H)|g' \
+             -e 's|@''REPLACE_SETLOCALE''@|$(REPLACE_SETLOCALE)|g' \
              -e 's|@''REPLACE_DUPLOCALE''@|$(REPLACE_DUPLOCALE)|g' \
              -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
              -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
              -e 's|@''REPLACE_DUPLOCALE''@|$(REPLACE_DUPLOCALE)|g' \
              -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
              -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
@@ -687,6 +636,15 @@ EXTRA_DIST += $(top_srcdir)/maint.mk
 
 ## end   gnulib module maintainer-makefile
 
 
 ## end   gnulib module maintainer-makefile
 
+## begin gnulib module malloc-gnu
+
+
+EXTRA_DIST += malloc.c
+
+EXTRA_libgnu_la_SOURCES += malloc.c
+
+## end   gnulib module malloc-gnu
+
 ## begin gnulib module malloc-posix
 
 
 ## begin gnulib module malloc-posix
 
 
@@ -720,10 +678,12 @@ math.h: math.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
              -e 's|@''GNULIB_ACOSL''@|$(GNULIB_ACOSL)|g' \
              -e 's|@''GNULIB_ASINL''@|$(GNULIB_ASINL)|g' \
              -e 's|@''GNULIB_ATANL''@|$(GNULIB_ATANL)|g' \
              -e 's|@''GNULIB_ACOSL''@|$(GNULIB_ACOSL)|g' \
              -e 's|@''GNULIB_ASINL''@|$(GNULIB_ASINL)|g' \
              -e 's|@''GNULIB_ATANL''@|$(GNULIB_ATANL)|g' \
+             -e 's|@''GNULIB_CEIL''@|$(GNULIB_CEIL)|g' \
              -e 's|@''GNULIB_CEILF''@|$(GNULIB_CEILF)|g' \
              -e 's|@''GNULIB_CEILL''@|$(GNULIB_CEILL)|g' \
              -e 's|@''GNULIB_COSL''@|$(GNULIB_COSL)|g' \
              -e 's|@''GNULIB_EXPL''@|$(GNULIB_EXPL)|g' \
              -e 's|@''GNULIB_CEILF''@|$(GNULIB_CEILF)|g' \
              -e 's|@''GNULIB_CEILL''@|$(GNULIB_CEILL)|g' \
              -e 's|@''GNULIB_COSL''@|$(GNULIB_COSL)|g' \
              -e 's|@''GNULIB_EXPL''@|$(GNULIB_EXPL)|g' \
+             -e 's|@''GNULIB_FLOOR''@|$(GNULIB_FLOOR)|g' \
              -e 's|@''GNULIB_FLOORF''@|$(GNULIB_FLOORF)|g' \
              -e 's|@''GNULIB_FLOORL''@|$(GNULIB_FLOORL)|g' \
              -e 's|@''GNULIB_FREXP''@|$(GNULIB_FREXP)|g' \
              -e 's|@''GNULIB_FLOORF''@|$(GNULIB_FLOORF)|g' \
              -e 's|@''GNULIB_FLOORL''@|$(GNULIB_FLOORL)|g' \
              -e 's|@''GNULIB_FREXP''@|$(GNULIB_FREXP)|g' \
@@ -747,7 +707,8 @@ math.h: math.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
              -e 's|@''GNULIB_TRUNC''@|$(GNULIB_TRUNC)|g' \
              -e 's|@''GNULIB_TRUNCF''@|$(GNULIB_TRUNCF)|g' \
              -e 's|@''GNULIB_TRUNCL''@|$(GNULIB_TRUNCL)|g' \
              -e 's|@''GNULIB_TRUNC''@|$(GNULIB_TRUNC)|g' \
              -e 's|@''GNULIB_TRUNCF''@|$(GNULIB_TRUNCF)|g' \
              -e 's|@''GNULIB_TRUNCL''@|$(GNULIB_TRUNCL)|g' \
-             -e 's|@''HAVE_ACOSL''@|$(HAVE_ACOSL)|g' \
+             < $(srcdir)/math.in.h | \
+         sed -e 's|@''HAVE_ACOSL''@|$(HAVE_ACOSL)|g' \
              -e 's|@''HAVE_ASINL''@|$(HAVE_ASINL)|g' \
              -e 's|@''HAVE_ATANL''@|$(HAVE_ATANL)|g' \
              -e 's|@''HAVE_COSL''@|$(HAVE_COSL)|g' \
              -e 's|@''HAVE_ASINL''@|$(HAVE_ASINL)|g' \
              -e 's|@''HAVE_ATANL''@|$(HAVE_ATANL)|g' \
              -e 's|@''HAVE_COSL''@|$(HAVE_COSL)|g' \
@@ -781,8 +742,11 @@ math.h: math.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
              -e 's|@''HAVE_DECL_TRUNC''@|$(HAVE_DECL_TRUNC)|g' \
              -e 's|@''HAVE_DECL_TRUNCF''@|$(HAVE_DECL_TRUNCF)|g' \
              -e 's|@''HAVE_DECL_TRUNCL''@|$(HAVE_DECL_TRUNCL)|g' \
              -e 's|@''HAVE_DECL_TRUNC''@|$(HAVE_DECL_TRUNC)|g' \
              -e 's|@''HAVE_DECL_TRUNCF''@|$(HAVE_DECL_TRUNCF)|g' \
              -e 's|@''HAVE_DECL_TRUNCL''@|$(HAVE_DECL_TRUNCL)|g' \
+         | \
+         sed -e 's|@''REPLACE_CEIL''@|$(REPLACE_CEIL)|g' \
              -e 's|@''REPLACE_CEILF''@|$(REPLACE_CEILF)|g' \
              -e 's|@''REPLACE_CEILL''@|$(REPLACE_CEILL)|g' \
              -e 's|@''REPLACE_CEILF''@|$(REPLACE_CEILF)|g' \
              -e 's|@''REPLACE_CEILL''@|$(REPLACE_CEILL)|g' \
+             -e 's|@''REPLACE_FLOOR''@|$(REPLACE_FLOOR)|g' \
              -e 's|@''REPLACE_FLOORF''@|$(REPLACE_FLOORF)|g' \
              -e 's|@''REPLACE_FLOORL''@|$(REPLACE_FLOORL)|g' \
              -e 's|@''REPLACE_FREXP''@|$(REPLACE_FREXP)|g' \
              -e 's|@''REPLACE_FLOORF''@|$(REPLACE_FLOORF)|g' \
              -e 's|@''REPLACE_FLOORL''@|$(REPLACE_FLOORL)|g' \
              -e 's|@''REPLACE_FREXP''@|$(REPLACE_FREXP)|g' \
@@ -798,11 +762,12 @@ math.h: math.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
              -e 's|@''REPLACE_ROUNDL''@|$(REPLACE_ROUNDL)|g' \
              -e 's|@''REPLACE_SIGNBIT''@|$(REPLACE_SIGNBIT)|g' \
              -e 's|@''REPLACE_SIGNBIT_USING_GCC''@|$(REPLACE_SIGNBIT_USING_GCC)|g' \
              -e 's|@''REPLACE_ROUNDL''@|$(REPLACE_ROUNDL)|g' \
              -e 's|@''REPLACE_SIGNBIT''@|$(REPLACE_SIGNBIT)|g' \
              -e 's|@''REPLACE_SIGNBIT_USING_GCC''@|$(REPLACE_SIGNBIT_USING_GCC)|g' \
+             -e 's|@''REPLACE_TRUNC''@|$(REPLACE_TRUNC)|g' \
+             -e 's|@''REPLACE_TRUNCF''@|$(REPLACE_TRUNCF)|g' \
              -e 's|@''REPLACE_TRUNCL''@|$(REPLACE_TRUNCL)|g' \
              -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
              -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
              -e 's|@''REPLACE_TRUNCL''@|$(REPLACE_TRUNCL)|g' \
              -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
              -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
-             -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
-             < $(srcdir)/math.in.h; \
+             -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \
        } > $@-t && \
        mv $@-t $@
 MOSTLYCLEANFILES += math.h math.h-t
        } > $@-t && \
        mv $@-t $@
 MOSTLYCLEANFILES += math.h math.h-t
@@ -811,33 +776,6 @@ EXTRA_DIST += math.in.h
 
 ## end   gnulib module math
 
 
 ## end   gnulib module math
 
-## begin gnulib module mbrlen
-
-
-EXTRA_DIST += mbrlen.c
-
-EXTRA_libgnu_la_SOURCES += mbrlen.c
-
-## end   gnulib module mbrlen
-
-## begin gnulib module mbrtowc
-
-
-EXTRA_DIST += mbrtowc.c
-
-EXTRA_libgnu_la_SOURCES += mbrtowc.c
-
-## end   gnulib module mbrtowc
-
-## begin gnulib module mbsinit
-
-
-EXTRA_DIST += mbsinit.c
-
-EXTRA_libgnu_la_SOURCES += mbsinit.c
-
-## end   gnulib module mbsinit
-
 ## begin gnulib module memchr
 
 
 ## begin gnulib module memchr
 
 
@@ -936,6 +874,24 @@ EXTRA_libgnu_la_SOURCES += readlink.c
 
 ## end   gnulib module readlink
 
 
 ## end   gnulib module readlink
 
+## begin gnulib module recv
+
+
+EXTRA_DIST += recv.c w32sock.h
+
+EXTRA_libgnu_la_SOURCES += recv.c
+
+## end   gnulib module recv
+
+## begin gnulib module recvfrom
+
+
+EXTRA_DIST += recvfrom.c w32sock.h
+
+EXTRA_libgnu_la_SOURCES += recvfrom.c
+
+## end   gnulib module recvfrom
+
 ## begin gnulib module safe-read
 
 
 ## begin gnulib module safe-read
 
 
@@ -954,6 +910,42 @@ EXTRA_libgnu_la_SOURCES += safe-write.c
 
 ## end   gnulib module safe-write
 
 
 ## end   gnulib module safe-write
 
+## begin gnulib module send
+
+
+EXTRA_DIST += send.c w32sock.h
+
+EXTRA_libgnu_la_SOURCES += send.c
+
+## end   gnulib module send
+
+## begin gnulib module sendto
+
+
+EXTRA_DIST += sendto.c w32sock.h
+
+EXTRA_libgnu_la_SOURCES += sendto.c
+
+## end   gnulib module sendto
+
+## begin gnulib module setsockopt
+
+
+EXTRA_DIST += setsockopt.c w32sock.h
+
+EXTRA_libgnu_la_SOURCES += setsockopt.c
+
+## end   gnulib module setsockopt
+
+## begin gnulib module shutdown
+
+
+EXTRA_DIST += shutdown.c w32sock.h
+
+EXTRA_libgnu_la_SOURCES += shutdown.c
+
+## end   gnulib module shutdown
+
 ## begin gnulib module size_max
 
 libgnu_la_SOURCES += size_max.h
 ## begin gnulib module size_max
 
 libgnu_la_SOURCES += size_max.h
@@ -969,6 +961,15 @@ EXTRA_libgnu_la_SOURCES += snprintf.c
 
 ## end   gnulib module snprintf
 
 
 ## end   gnulib module snprintf
 
+## begin gnulib module socket
+
+
+EXTRA_DIST += socket.c w32sock.h
+
+EXTRA_libgnu_la_SOURCES += socket.c
+
+## end   gnulib module socket
+
 ## begin gnulib module sockets
 
 libgnu_la_SOURCES += sockets.h sockets.c
 ## begin gnulib module sockets
 
 libgnu_la_SOURCES += sockets.h sockets.c
@@ -1252,7 +1253,8 @@ stdlib.h: stdlib.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
              -e 's|@''GNULIB_SYSTEM_POSIX''@|$(GNULIB_SYSTEM_POSIX)|g' \
              -e 's|@''GNULIB_UNLOCKPT''@|$(GNULIB_UNLOCKPT)|g' \
              -e 's|@''GNULIB_UNSETENV''@|$(GNULIB_UNSETENV)|g' \
              -e 's|@''GNULIB_SYSTEM_POSIX''@|$(GNULIB_SYSTEM_POSIX)|g' \
              -e 's|@''GNULIB_UNLOCKPT''@|$(GNULIB_UNLOCKPT)|g' \
              -e 's|@''GNULIB_UNSETENV''@|$(GNULIB_UNSETENV)|g' \
-             -e 's|@''HAVE__EXIT''@|$(HAVE__EXIT)|g' \
+             < $(srcdir)/stdlib.in.h | \
+         sed -e 's|@''HAVE__EXIT''@|$(HAVE__EXIT)|g' \
              -e 's|@''HAVE_ATOLL''@|$(HAVE_ATOLL)|g' \
              -e 's|@''HAVE_CANONICALIZE_FILE_NAME''@|$(HAVE_CANONICALIZE_FILE_NAME)|g' \
              -e 's|@''HAVE_DECL_GETLOADAVG''@|$(HAVE_DECL_GETLOADAVG)|g' \
              -e 's|@''HAVE_ATOLL''@|$(HAVE_ATOLL)|g' \
              -e 's|@''HAVE_CANONICALIZE_FILE_NAME''@|$(HAVE_CANONICALIZE_FILE_NAME)|g' \
              -e 's|@''HAVE_DECL_GETLOADAVG''@|$(HAVE_DECL_GETLOADAVG)|g' \
@@ -1288,8 +1290,7 @@ stdlib.h: stdlib.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
              -e 's|@''REPLACE_UNSETENV''@|$(REPLACE_UNSETENV)|g' \
              -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
              -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
              -e 's|@''REPLACE_UNSETENV''@|$(REPLACE_UNSETENV)|g' \
              -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
              -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
-             -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
-             < $(srcdir)/stdlib.in.h; \
+             -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \
        } > $@-t && \
        mv $@-t $@
 MOSTLYCLEANFILES += stdlib.h stdlib.h-t
        } > $@-t && \
        mv $@-t $@
 MOSTLYCLEANFILES += stdlib.h stdlib.h-t
@@ -1307,13 +1308,6 @@ EXTRA_libgnu_la_SOURCES += strcasecmp.c strncasecmp.c
 
 ## end   gnulib module strcase
 
 
 ## end   gnulib module strcase
 
-## begin gnulib module streq
-
-
-EXTRA_DIST += streq.h
-
-## end   gnulib module streq
-
 ## begin gnulib module strftime
 
 
 ## begin gnulib module strftime
 
 
@@ -1591,6 +1585,37 @@ EXTRA_DIST += sys_stat.in.h
 
 ## end   gnulib module sys_stat
 
 
 ## end   gnulib module sys_stat
 
+## begin gnulib module sys_time
+
+BUILT_SOURCES += sys/time.h
+
+# We need the following in order to create <sys/time.h> when the system
+# doesn't have one that works with the given compiler.
+sys/time.h: sys_time.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+       $(AM_V_at)$(MKDIR_P) sys
+       $(AM_V_GEN)rm -f $@-t $@ && \
+       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+         sed -e 's/@''HAVE_SYS_TIME_H''@/$(HAVE_SYS_TIME_H)/g' \
+             -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+             -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+             -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+             -e 's|@''NEXT_SYS_TIME_H''@|$(NEXT_SYS_TIME_H)|g' \
+             -e 's/@''GNULIB_GETTIMEOFDAY''@/$(GNULIB_GETTIMEOFDAY)/g' \
+             -e 's/@''HAVE_GETTIMEOFDAY''@/$(HAVE_GETTIMEOFDAY)/g' \
+             -e 's/@''HAVE_STRUCT_TIMEVAL''@/$(HAVE_STRUCT_TIMEVAL)/g' \
+             -e 's/@''REPLACE_GETTIMEOFDAY''@/$(REPLACE_GETTIMEOFDAY)/g' \
+             -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+             -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+             -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+             < $(srcdir)/sys_time.in.h; \
+       } > $@-t && \
+       mv $@-t $@
+MOSTLYCLEANFILES += sys/time.h sys/time.h-t
+
+EXTRA_DIST += sys_time.in.h
+
+## end   gnulib module sys_time
+
 ## begin gnulib module time
 
 BUILT_SOURCES += time.h
 ## begin gnulib module time
 
 BUILT_SOURCES += time.h
@@ -1609,7 +1634,7 @@ time.h: time.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
              -e 's|@''GNULIB_STRPTIME''@|$(GNULIB_STRPTIME)|g' \
              -e 's|@''GNULIB_TIMEGM''@|$(GNULIB_TIMEGM)|g' \
              -e 's|@''GNULIB_TIME_R''@|$(GNULIB_TIME_R)|g' \
              -e 's|@''GNULIB_STRPTIME''@|$(GNULIB_STRPTIME)|g' \
              -e 's|@''GNULIB_TIMEGM''@|$(GNULIB_TIMEGM)|g' \
              -e 's|@''GNULIB_TIME_R''@|$(GNULIB_TIME_R)|g' \
-             -e 's|@''HAVE_LOCALTIME_R''@|$(HAVE_LOCALTIME_R)|g' \
+             -e 's|@''HAVE_DECL_LOCALTIME_R''@|$(HAVE_DECL_LOCALTIME_R)|g' \
              -e 's|@''HAVE_NANOSLEEP''@|$(HAVE_NANOSLEEP)|g' \
              -e 's|@''HAVE_STRPTIME''@|$(HAVE_STRPTIME)|g' \
              -e 's|@''HAVE_TIMEGM''@|$(HAVE_TIMEGM)|g' \
              -e 's|@''HAVE_NANOSLEEP''@|$(HAVE_NANOSLEEP)|g' \
              -e 's|@''HAVE_STRPTIME''@|$(HAVE_STRPTIME)|g' \
              -e 's|@''HAVE_TIMEGM''@|$(HAVE_TIMEGM)|g' \
@@ -1641,6 +1666,15 @@ EXTRA_libgnu_la_SOURCES += time_r.c
 
 ## end   gnulib module time_r
 
 
 ## end   gnulib module time_r
 
+## begin gnulib module trunc
+
+
+EXTRA_DIST += trunc.c
+
+EXTRA_libgnu_la_SOURCES += trunc.c
+
+## end   gnulib module trunc
+
 ## begin gnulib module unistd
 
 BUILT_SOURCES += unistd.h
 ## begin gnulib module unistd
 
 BUILT_SOURCES += unistd.h
@@ -1734,13 +1768,15 @@ unistd.h: unistd.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
              -e 's|@''HAVE_DECL_TTYNAME_R''@|$(HAVE_DECL_TTYNAME_R)|g' \
              -e 's|@''HAVE_OS_H''@|$(HAVE_OS_H)|g' \
              -e 's|@''HAVE_SYS_PARAM_H''@|$(HAVE_SYS_PARAM_H)|g' \
              -e 's|@''HAVE_DECL_TTYNAME_R''@|$(HAVE_DECL_TTYNAME_R)|g' \
              -e 's|@''HAVE_OS_H''@|$(HAVE_OS_H)|g' \
              -e 's|@''HAVE_SYS_PARAM_H''@|$(HAVE_SYS_PARAM_H)|g' \
-             -e 's|@''REPLACE_CHOWN''@|$(REPLACE_CHOWN)|g' \
+         | \
+         sed -e 's|@''REPLACE_CHOWN''@|$(REPLACE_CHOWN)|g' \
              -e 's|@''REPLACE_CLOSE''@|$(REPLACE_CLOSE)|g' \
              -e 's|@''REPLACE_DUP''@|$(REPLACE_DUP)|g' \
              -e 's|@''REPLACE_DUP2''@|$(REPLACE_DUP2)|g' \
              -e 's|@''REPLACE_FCHOWNAT''@|$(REPLACE_FCHOWNAT)|g' \
              -e 's|@''REPLACE_GETCWD''@|$(REPLACE_GETCWD)|g' \
              -e 's|@''REPLACE_GETDOMAINNAME''@|$(REPLACE_GETDOMAINNAME)|g' \
              -e 's|@''REPLACE_CLOSE''@|$(REPLACE_CLOSE)|g' \
              -e 's|@''REPLACE_DUP''@|$(REPLACE_DUP)|g' \
              -e 's|@''REPLACE_DUP2''@|$(REPLACE_DUP2)|g' \
              -e 's|@''REPLACE_FCHOWNAT''@|$(REPLACE_FCHOWNAT)|g' \
              -e 's|@''REPLACE_GETCWD''@|$(REPLACE_GETCWD)|g' \
              -e 's|@''REPLACE_GETDOMAINNAME''@|$(REPLACE_GETDOMAINNAME)|g' \
+             -e 's|@''REPLACE_GETLOGIN_R''@|$(REPLACE_GETLOGIN_R)|g' \
              -e 's|@''REPLACE_GETGROUPS''@|$(REPLACE_GETGROUPS)|g' \
              -e 's|@''REPLACE_GETPAGESIZE''@|$(REPLACE_GETPAGESIZE)|g' \
              -e 's|@''REPLACE_LCHOWN''@|$(REPLACE_LCHOWN)|g' \
              -e 's|@''REPLACE_GETGROUPS''@|$(REPLACE_GETGROUPS)|g' \
              -e 's|@''REPLACE_GETPAGESIZE''@|$(REPLACE_GETPAGESIZE)|g' \
              -e 's|@''REPLACE_LCHOWN''@|$(REPLACE_LCHOWN)|g' \
@@ -1963,7 +1999,36 @@ wchar.h: wchar.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
              -e 's|@''GNULIB_WCSRTOMBS''@|$(GNULIB_WCSRTOMBS)|g' \
              -e 's|@''GNULIB_WCSNRTOMBS''@|$(GNULIB_WCSNRTOMBS)|g' \
              -e 's|@''GNULIB_WCWIDTH''@|$(GNULIB_WCWIDTH)|g' \
              -e 's|@''GNULIB_WCSRTOMBS''@|$(GNULIB_WCSRTOMBS)|g' \
              -e 's|@''GNULIB_WCSNRTOMBS''@|$(GNULIB_WCSNRTOMBS)|g' \
              -e 's|@''GNULIB_WCWIDTH''@|$(GNULIB_WCWIDTH)|g' \
-             -e 's|@''HAVE_WINT_T''@|$(HAVE_WINT_T)|g' \
+             -e 's|@''GNULIB_WMEMCHR''@|$(GNULIB_WMEMCHR)|g' \
+             -e 's|@''GNULIB_WMEMCMP''@|$(GNULIB_WMEMCMP)|g' \
+             -e 's|@''GNULIB_WMEMCPY''@|$(GNULIB_WMEMCPY)|g' \
+             -e 's|@''GNULIB_WMEMMOVE''@|$(GNULIB_WMEMMOVE)|g' \
+             -e 's|@''GNULIB_WMEMSET''@|$(GNULIB_WMEMSET)|g' \
+             -e 's|@''GNULIB_WCSLEN''@|$(GNULIB_WCSLEN)|g' \
+             -e 's|@''GNULIB_WCSNLEN''@|$(GNULIB_WCSNLEN)|g' \
+             -e 's|@''GNULIB_WCSCPY''@|$(GNULIB_WCSCPY)|g' \
+             -e 's|@''GNULIB_WCPCPY''@|$(GNULIB_WCPCPY)|g' \
+             -e 's|@''GNULIB_WCSNCPY''@|$(GNULIB_WCSNCPY)|g' \
+             -e 's|@''GNULIB_WCPNCPY''@|$(GNULIB_WCPNCPY)|g' \
+             -e 's|@''GNULIB_WCSCAT''@|$(GNULIB_WCSCAT)|g' \
+             -e 's|@''GNULIB_WCSNCAT''@|$(GNULIB_WCSNCAT)|g' \
+             -e 's|@''GNULIB_WCSCMP''@|$(GNULIB_WCSCMP)|g' \
+             -e 's|@''GNULIB_WCSNCMP''@|$(GNULIB_WCSNCMP)|g' \
+             -e 's|@''GNULIB_WCSCASECMP''@|$(GNULIB_WCSCASECMP)|g' \
+             -e 's|@''GNULIB_WCSNCASECMP''@|$(GNULIB_WCSNCASECMP)|g' \
+             -e 's|@''GNULIB_WCSCOLL''@|$(GNULIB_WCSCOLL)|g' \
+             -e 's|@''GNULIB_WCSXFRM''@|$(GNULIB_WCSXFRM)|g' \
+             -e 's|@''GNULIB_WCSDUP''@|$(GNULIB_WCSDUP)|g' \
+             -e 's|@''GNULIB_WCSCHR''@|$(GNULIB_WCSCHR)|g' \
+             -e 's|@''GNULIB_WCSRCHR''@|$(GNULIB_WCSRCHR)|g' \
+             -e 's|@''GNULIB_WCSCSPN''@|$(GNULIB_WCSCSPN)|g' \
+             -e 's|@''GNULIB_WCSSPN''@|$(GNULIB_WCSSPN)|g' \
+             -e 's|@''GNULIB_WCSPBRK''@|$(GNULIB_WCSPBRK)|g' \
+             -e 's|@''GNULIB_WCSSTR''@|$(GNULIB_WCSSTR)|g' \
+             -e 's|@''GNULIB_WCSTOK''@|$(GNULIB_WCSTOK)|g' \
+             -e 's|@''GNULIB_WCSWIDTH''@|$(GNULIB_WCSWIDTH)|g' \
+             < $(srcdir)/wchar.in.h | \
+         sed -e 's|@''HAVE_WINT_T''@|$(HAVE_WINT_T)|g' \
              -e 's|@''HAVE_BTOWC''@|$(HAVE_BTOWC)|g' \
              -e 's|@''HAVE_MBSINIT''@|$(HAVE_MBSINIT)|g' \
              -e 's|@''HAVE_MBRTOWC''@|$(HAVE_MBRTOWC)|g' \
              -e 's|@''HAVE_BTOWC''@|$(HAVE_BTOWC)|g' \
              -e 's|@''HAVE_MBSINIT''@|$(HAVE_MBSINIT)|g' \
              -e 's|@''HAVE_MBRTOWC''@|$(HAVE_MBRTOWC)|g' \
@@ -1973,9 +2038,38 @@ wchar.h: wchar.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
              -e 's|@''HAVE_WCRTOMB''@|$(HAVE_WCRTOMB)|g' \
              -e 's|@''HAVE_WCSRTOMBS''@|$(HAVE_WCSRTOMBS)|g' \
              -e 's|@''HAVE_WCSNRTOMBS''@|$(HAVE_WCSNRTOMBS)|g' \
              -e 's|@''HAVE_WCRTOMB''@|$(HAVE_WCRTOMB)|g' \
              -e 's|@''HAVE_WCSRTOMBS''@|$(HAVE_WCSRTOMBS)|g' \
              -e 's|@''HAVE_WCSNRTOMBS''@|$(HAVE_WCSNRTOMBS)|g' \
+             -e 's|@''HAVE_WMEMCHR''@|$(HAVE_WMEMCHR)|g' \
+             -e 's|@''HAVE_WMEMCMP''@|$(HAVE_WMEMCMP)|g' \
+             -e 's|@''HAVE_WMEMCPY''@|$(HAVE_WMEMCPY)|g' \
+             -e 's|@''HAVE_WMEMMOVE''@|$(HAVE_WMEMMOVE)|g' \
+             -e 's|@''HAVE_WMEMSET''@|$(HAVE_WMEMSET)|g' \
+             -e 's|@''HAVE_WCSLEN''@|$(HAVE_WCSLEN)|g' \
+             -e 's|@''HAVE_WCSNLEN''@|$(HAVE_WCSNLEN)|g' \
+             -e 's|@''HAVE_WCSCPY''@|$(HAVE_WCSCPY)|g' \
+             -e 's|@''HAVE_WCPCPY''@|$(HAVE_WCPCPY)|g' \
+             -e 's|@''HAVE_WCSNCPY''@|$(HAVE_WCSNCPY)|g' \
+             -e 's|@''HAVE_WCPNCPY''@|$(HAVE_WCPNCPY)|g' \
+             -e 's|@''HAVE_WCSCAT''@|$(HAVE_WCSCAT)|g' \
+             -e 's|@''HAVE_WCSNCAT''@|$(HAVE_WCSNCAT)|g' \
+             -e 's|@''HAVE_WCSCMP''@|$(HAVE_WCSCMP)|g' \
+             -e 's|@''HAVE_WCSNCMP''@|$(HAVE_WCSNCMP)|g' \
+             -e 's|@''HAVE_WCSCASECMP''@|$(HAVE_WCSCASECMP)|g' \
+             -e 's|@''HAVE_WCSNCASECMP''@|$(HAVE_WCSNCASECMP)|g' \
+             -e 's|@''HAVE_WCSCOLL''@|$(HAVE_WCSCOLL)|g' \
+             -e 's|@''HAVE_WCSXFRM''@|$(HAVE_WCSXFRM)|g' \
+             -e 's|@''HAVE_WCSDUP''@|$(HAVE_WCSDUP)|g' \
+             -e 's|@''HAVE_WCSCHR''@|$(HAVE_WCSCHR)|g' \
+             -e 's|@''HAVE_WCSRCHR''@|$(HAVE_WCSRCHR)|g' \
+             -e 's|@''HAVE_WCSCSPN''@|$(HAVE_WCSCSPN)|g' \
+             -e 's|@''HAVE_WCSSPN''@|$(HAVE_WCSSPN)|g' \
+             -e 's|@''HAVE_WCSPBRK''@|$(HAVE_WCSPBRK)|g' \
+             -e 's|@''HAVE_WCSSTR''@|$(HAVE_WCSSTR)|g' \
+             -e 's|@''HAVE_WCSTOK''@|$(HAVE_WCSTOK)|g' \
+             -e 's|@''HAVE_WCSWIDTH''@|$(HAVE_WCSWIDTH)|g' \
              -e 's|@''HAVE_DECL_WCTOB''@|$(HAVE_DECL_WCTOB)|g' \
              -e 's|@''HAVE_DECL_WCWIDTH''@|$(HAVE_DECL_WCWIDTH)|g' \
              -e 's|@''HAVE_DECL_WCTOB''@|$(HAVE_DECL_WCTOB)|g' \
              -e 's|@''HAVE_DECL_WCWIDTH''@|$(HAVE_DECL_WCWIDTH)|g' \
-             -e 's|@''REPLACE_MBSTATE_T''@|$(REPLACE_MBSTATE_T)|g' \
+         | \
+         sed -e 's|@''REPLACE_MBSTATE_T''@|$(REPLACE_MBSTATE_T)|g' \
              -e 's|@''REPLACE_BTOWC''@|$(REPLACE_BTOWC)|g' \
              -e 's|@''REPLACE_WCTOB''@|$(REPLACE_WCTOB)|g' \
              -e 's|@''REPLACE_MBSINIT''@|$(REPLACE_MBSINIT)|g' \
              -e 's|@''REPLACE_BTOWC''@|$(REPLACE_BTOWC)|g' \
              -e 's|@''REPLACE_WCTOB''@|$(REPLACE_WCTOB)|g' \
              -e 's|@''REPLACE_MBSINIT''@|$(REPLACE_MBSINIT)|g' \
@@ -1987,10 +2081,10 @@ wchar.h: wchar.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
              -e 's|@''REPLACE_WCSRTOMBS''@|$(REPLACE_WCSRTOMBS)|g' \
              -e 's|@''REPLACE_WCSNRTOMBS''@|$(REPLACE_WCSNRTOMBS)|g' \
              -e 's|@''REPLACE_WCWIDTH''@|$(REPLACE_WCWIDTH)|g' \
              -e 's|@''REPLACE_WCSRTOMBS''@|$(REPLACE_WCSRTOMBS)|g' \
              -e 's|@''REPLACE_WCSNRTOMBS''@|$(REPLACE_WCSNRTOMBS)|g' \
              -e 's|@''REPLACE_WCWIDTH''@|$(REPLACE_WCWIDTH)|g' \
+             -e 's|@''REPLACE_WCSWIDTH''@|$(REPLACE_WCSWIDTH)|g' \
              -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
              -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
              -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
              -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
-             -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
-           < $(srcdir)/wchar.in.h; \
+             -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \
        } > $@-t && \
        mv $@-t $@
 MOSTLYCLEANFILES += wchar.h wchar.h-t
        } > $@-t && \
        mv $@-t $@
 MOSTLYCLEANFILES += wchar.h wchar.h-t
diff --git a/lib/accept.c b/lib/accept.c
new file mode 100644 (file)
index 0000000..911c184
--- /dev/null
@@ -0,0 +1,42 @@
+/* accept.c --- wrappers for Windows accept function
+
+   Copyright (C) 2008-2011 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 3 of the License, 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, see <http://www.gnu.org/licenses/>.  */
+
+/* Written by Paolo Bonzini */
+
+#include <config.h>
+
+#define WIN32_LEAN_AND_MEAN
+/* Get winsock2.h. */
+#include <sys/socket.h>
+
+/* Get set_winsock_errno, FD_TO_SOCKET etc. */
+#include "w32sock.h"
+
+#undef accept
+
+int
+rpl_accept (int fd, struct sockaddr *addr, socklen_t *addrlen)
+{
+  SOCKET fh = accept (FD_TO_SOCKET (fd), addr, addrlen);
+  if (fh == INVALID_SOCKET)
+    {
+      set_winsock_errno ();
+      return -1;
+    }
+  else
+    return SOCKET_TO_FD (fh);
+}
index 13687ab..5e71f6c 100644 (file)
@@ -1,5 +1,5 @@
 /* Determine alignment of types.
 /* Determine alignment of types.
-   Copyright (C) 2003-2004, 2006, 2009-2010 Free Software Foundation, Inc.
+   Copyright (C) 2003-2004, 2006, 2009-2011 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
 
    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
index ee7aa9a..8760ae7 100644 (file)
@@ -1,6 +1,6 @@
 /* Memory allocation on the stack.
 
 /* Memory allocation on the stack.
 
-   Copyright (C) 1995, 1999, 2001-2004, 2006-2010 Free Software Foundation,
+   Copyright (C) 1995, 1999, 2001-2004, 2006-2011 Free Software Foundation,
    Inc.
 
    This program is free software; you can redistribute it and/or modify it
    Inc.
 
    This program is free software; you can redistribute it and/or modify it
@@ -11,7 +11,7 @@
    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
    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
-   General Public License for more details.
+   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
 
    You should have received a copy of the GNU Lesser General Public
    License along with this program; if not, write to the Free Software
index 6d9b8c7..3df6fd2 100644 (file)
@@ -1,6 +1,6 @@
 /* A GNU-like <arpa/inet.h>.
 
 /* A GNU-like <arpa/inet.h>.
 
-   Copyright (C) 2005-2006, 2008-2010 Free Software Foundation, Inc.
+   Copyright (C) 2005-2006, 2008-2011 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
 
    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 <sys/socket.h>
 #endif
 
 # include <sys/socket.h>
 #endif
 
+/* On NonStop Kernel, inet_ntop and inet_pton are declared in <netdb.h>.
+   But avoid namespace pollution on glibc systems.  */
+#if defined __TANDEM && !defined __GLIBC__
+# include <netdb.h>
+#endif
+
 #if @HAVE_ARPA_INET_H@
 
 /* The include_next requires a split double-inclusion guard.  */
 #if @HAVE_ARPA_INET_H@
 
 /* The include_next requires a split double-inclusion guard.  */
 #ifndef _GL_ARPA_INET_H
 #define _GL_ARPA_INET_H
 
 #ifndef _GL_ARPA_INET_H
 #define _GL_ARPA_INET_H
 
+/* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
+
 /* The definition of _GL_ARG_NONNULL is copied here.  */
 
 /* The definition of _GL_WARN_ON_USE is copied here.  */
 
 /* The definition of _GL_ARG_NONNULL is copied here.  */
 
 /* The definition of _GL_WARN_ON_USE is copied here.  */
 
-#ifdef __cplusplus
-extern "C" {
-#endif
 
 #if @GNULIB_INET_NTOP@
 # if !@HAVE_DECL_INET_NTOP@
 
 #if @GNULIB_INET_NTOP@
 # if !@HAVE_DECL_INET_NTOP@
@@ -69,10 +74,17 @@ extern "C" {
 
    For more details, see the POSIX:2001 specification
    <http://www.opengroup.org/susv3xsh/inet_ntop.html>.  */
 
    For more details, see the POSIX:2001 specification
    <http://www.opengroup.org/susv3xsh/inet_ntop.html>.  */
-extern const char *inet_ntop (int af, const void *restrict src,
-                              char *restrict dst, socklen_t cnt)
-     _GL_ARG_NONNULL ((2, 3));
+_GL_FUNCDECL_SYS (inet_ntop, const char *,
+                  (int af, const void *restrict src,
+                   char *restrict dst, socklen_t cnt)
+                  _GL_ARG_NONNULL ((2, 3)));
 # endif
 # endif
+/* Need to cast, because on NonStop Kernel, the fourth parameter is
+                                            size_t cnt.  */
+_GL_CXXALIAS_SYS_CAST (inet_ntop, const char *,
+                       (int af, const void *restrict src,
+                        char *restrict dst, socklen_t cnt));
+_GL_CXXALIASWARN (inet_ntop);
 #elif defined GNULIB_POSIXCHECK
 # undef inet_ntop
 # if HAVE_RAW_DECL_INET_NTOP
 #elif defined GNULIB_POSIXCHECK
 # undef inet_ntop
 # if HAVE_RAW_DECL_INET_NTOP
@@ -83,9 +95,13 @@ _GL_WARN_ON_USE (inet_ntop, "inet_ntop is unportable - "
 
 #if @GNULIB_INET_PTON@
 # if !@HAVE_DECL_INET_PTON@
 
 #if @GNULIB_INET_PTON@
 # if !@HAVE_DECL_INET_PTON@
-extern int inet_pton (int af, const char *restrict src, void *restrict dst)
-     _GL_ARG_NONNULL ((2, 3));
+_GL_FUNCDECL_SYS (inet_pton, int,
+                  (int af, const char *restrict src, void *restrict dst)
+                  _GL_ARG_NONNULL ((2, 3)));
 # endif
 # endif
+_GL_CXXALIAS_SYS (inet_pton, int,
+                  (int af, const char *restrict src, void *restrict dst));
+_GL_CXXALIASWARN (inet_pton);
 #elif defined GNULIB_POSIXCHECK
 # undef inet_pton
 # if HAVE_RAW_DECL_INET_PTON
 #elif defined GNULIB_POSIXCHECK
 # undef inet_pton
 # if HAVE_RAW_DECL_INET_PTON
@@ -94,9 +110,6 @@ _GL_WARN_ON_USE (inet_pton, "inet_pton is unportable - "
 # endif
 #endif
 
 # endif
 #endif
 
-#ifdef __cplusplus
-}
-#endif
 
 #endif /* _GL_ARPA_INET_H */
 #endif /* _GL_ARPA_INET_H */
 
 #endif /* _GL_ARPA_INET_H */
 #endif /* _GL_ARPA_INET_H */
index bc5a8af..f1fb746 100644 (file)
@@ -1,5 +1,5 @@
 /* Formatted output to strings.
 /* Formatted output to strings.
-   Copyright (C) 1999, 2002, 2006, 2009, 2010 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2002, 2006, 2009-2011 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
 
    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
diff --git a/lib/bind.c b/lib/bind.c
new file mode 100644 (file)
index 0000000..512f364
--- /dev/null
@@ -0,0 +1,40 @@
+/* bind.c --- wrappers for Windows bind function
+
+   Copyright (C) 2008-2011 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 3 of the License, 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, see <http://www.gnu.org/licenses/>.  */
+
+/* Written by Paolo Bonzini */
+
+#include <config.h>
+
+#define WIN32_LEAN_AND_MEAN
+/* Get winsock2.h. */
+#include <sys/socket.h>
+
+/* Get set_winsock_errno, FD_TO_SOCKET etc. */
+#include "w32sock.h"
+
+#undef bind
+
+int
+rpl_bind (int fd, const struct sockaddr *sockaddr, socklen_t len)
+{
+  SOCKET sock = FD_TO_SOCKET (fd);
+  int r = bind (sock, sockaddr, len);
+  if (r < 0)
+    set_winsock_errno ();
+
+  return r;
+}
index cf2accb..0491781 100644 (file)
@@ -1,5 +1,5 @@
 /* byteswap.h - Byte swapping
 /* byteswap.h - Byte swapping
-   Copyright (C) 2005, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Copyright (C) 2005, 2007, 2009-2011 Free Software Foundation, Inc.
    Written by Oskar Liljeblad <oskar@osk.mine.nu>, 2005.
 
    This program is free software: you can redistribute it and/or modify
    Written by Oskar Liljeblad <oskar@osk.mine.nu>, 2005.
 
    This program is free software: you can redistribute it and/or modify
index 403adc2..06f87d0 100644 (file)
@@ -1,6 +1,6 @@
 /* Character handling in C locale.
 
 /* Character handling in C locale.
 
-   Copyright 2000-2003, 2006, 2009-2010 Free Software Foundation, Inc.
+   Copyright 2000-2003, 2006, 2009-2011 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
 
 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
index 00c0a26..ccf53e7 100644 (file)
@@ -5,7 +5,7 @@
    <ctype.h> functions' behaviour depends on the current locale set via
    setlocale.
 
    <ctype.h> functions' behaviour depends on the current locale set via
    setlocale.
 
-   Copyright (C) 2000-2003, 2006, 2008-2010 Free Software Foundation, Inc.
+   Copyright (C) 2000-2003, 2006, 2008-2011 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
 
 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
index 99e7faf..1e3d45a 100644 (file)
@@ -1,5 +1,5 @@
 /* Case-insensitive string comparison functions in C locale.
 /* Case-insensitive string comparison functions in C locale.
-   Copyright (C) 1995-1996, 2001, 2003, 2005, 2009-2010 Free Software
+   Copyright (C) 1995-1996, 2001, 2003, 2005, 2009-2011 Free Software
    Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
index bc3e76d..5216c44 100644 (file)
@@ -1,5 +1,5 @@
 /* c-strcasecmp.c -- case insensitive string comparator in C locale
 /* c-strcasecmp.c -- case insensitive string comparator in C locale
-   Copyright (C) 1998-1999, 2005-2006, 2009-2010 Free Software Foundation, Inc.
+   Copyright (C) 1998-1999, 2005-2006, 2009-2011 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
 
    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
index 0af82f3..754303d 100644 (file)
@@ -1,5 +1,5 @@
 /* Optimized case-insensitive string comparison in C locale.
 /* Optimized case-insensitive string comparison in C locale.
-   Copyright (C) 2001-2002, 2007, 2009-2010 Free Software Foundation, Inc.
+   Copyright (C) 2001-2002, 2007, 2009-2011 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
 
    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
index 01dbf39..2d5a324 100644 (file)
@@ -1,5 +1,5 @@
 /* c-strncasecmp.c -- case insensitive string comparator in C locale
 /* c-strncasecmp.c -- case insensitive string comparator in C locale
-   Copyright (C) 1998-1999, 2005-2006, 2009-2010 Free Software Foundation, Inc.
+   Copyright (C) 1998-1999, 2005-2006, 2009-2011 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
 
    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
index ec55f26..7e2fdbd 100644 (file)
@@ -1,5 +1,5 @@
 /* Return the canonical absolute name of a given file.
 /* Return the canonical absolute name of a given file.
-   Copyright (C) 1996-2010 Free Software Foundation, Inc.
+   Copyright (C) 1996-2011 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    This program is free software: you can redistribute it and/or modify
    This file is part of the GNU C Library.
 
    This program is free software: you can redistribute it and/or modify
index 15d67fb..0fdf323 100644 (file)
@@ -1,5 +1,5 @@
 /* Hook for making the close() function extensible.
 /* Hook for making the close() function extensible.
-   Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+   Copyright (C) 2009-2011 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2009.
 
    This program is free software: you can redistribute it and/or modify it
    Written by Bruno Haible <bruno@clisp.org>, 2009.
 
    This program is free software: you can redistribute it and/or modify it
index aff5757..adcf11c 100644 (file)
@@ -1,5 +1,5 @@
 /* Hook for making the close() function extensible.
 /* Hook for making the close() function extensible.
-   Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+   Copyright (C) 2009-2011 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
 
    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
similarity index 63%
rename from lib/mbrlen.c
rename to lib/close.c
index 1bd1cf4..9d72f7c 100644 (file)
@@ -1,6 +1,5 @@
-/* Recognize multibyte character.
-   Copyright (C) 1999-2000, 2008-2010 Free Software Foundation, Inc.
-   Written by Bruno Haible <bruno@clisp.org>, 2008.
+/* close replacement.
+   Copyright (C) 2008-2011 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
 
    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 <config.h>
 
 /* Specification.  */
 #include <config.h>
 
 /* Specification.  */
-#include <wchar.h>
+#include <unistd.h>
 
 
+#include "close-hook.h"
 
 
-static mbstate_t internal_state;
+/* Override close() to call into other gnulib modules.  */
 
 
-size_t
-mbrlen (const char *s, size_t n, mbstate_t *ps)
+int
+rpl_close (int fd)
+#undef close
 {
 {
-  if (ps == NULL)
-    ps = &internal_state;
-  return mbrtowc (NULL, s, n, ps);
+#if WINDOWS_SOCKETS
+  int retval = execute_all_close_hooks (fd);
+#else
+  int retval = close (fd);
+#endif
+
+#if REPLACE_FCHDIR
+  if (retval >= 0)
+    _gl_unregister_fd (fd);
+#endif
+
+  return retval;
 }
 }
diff --git a/lib/config.charset b/lib/config.charset
deleted file mode 100644 (file)
index 7435711..0000000
+++ /dev/null
@@ -1,683 +0,0 @@
-#! /bin/sh
-# Output a system dependent table of character encoding aliases.
-#
-#   Copyright (C) 2000-2004, 2006-2010 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, 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.
-#
-# The table consists of lines of the form
-#    ALIAS  CANONICAL
-#
-# ALIAS is the (system dependent) result of "nl_langinfo (CODESET)".
-# ALIAS is compared in a case sensitive way.
-#
-# CANONICAL is the GNU canonical name for this character encoding.
-# It must be an encoding supported by libiconv. Support by GNU libc is
-# also desirable. CANONICAL is case insensitive. Usually an upper case
-# MIME charset name is preferred.
-# The current list of GNU canonical charset names is as follows.
-#
-#       name              MIME?             used by which systems
-#   ASCII, ANSI_X3.4-1968       glibc solaris freebsd netbsd darwin cygwin
-#   ISO-8859-1              Y   glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin cygwin
-#   ISO-8859-2              Y   glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin cygwin
-#   ISO-8859-3              Y   glibc solaris cygwin
-#   ISO-8859-4              Y   osf solaris freebsd netbsd openbsd darwin
-#   ISO-8859-5              Y   glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin cygwin
-#   ISO-8859-6              Y   glibc aix hpux solaris cygwin
-#   ISO-8859-7              Y   glibc aix hpux irix osf solaris netbsd openbsd darwin cygwin
-#   ISO-8859-8              Y   glibc aix hpux osf solaris cygwin
-#   ISO-8859-9              Y   glibc aix hpux irix osf solaris darwin cygwin
-#   ISO-8859-13                 glibc netbsd openbsd darwin cygwin
-#   ISO-8859-14                 glibc cygwin
-#   ISO-8859-15                 glibc aix osf solaris freebsd netbsd openbsd darwin cygwin
-#   KOI8-R                  Y   glibc solaris freebsd netbsd openbsd darwin
-#   KOI8-U                  Y   glibc freebsd netbsd openbsd darwin cygwin
-#   KOI8-T                      glibc
-#   CP437                       dos
-#   CP775                       dos
-#   CP850                       aix osf dos
-#   CP852                       dos
-#   CP855                       dos
-#   CP856                       aix
-#   CP857                       dos
-#   CP861                       dos
-#   CP862                       dos
-#   CP864                       dos
-#   CP865                       dos
-#   CP866                       freebsd netbsd openbsd darwin dos
-#   CP869                       dos
-#   CP874                       woe32 dos
-#   CP922                       aix
-#   CP932                       aix cygwin woe32 dos
-#   CP943                       aix
-#   CP949                       osf darwin woe32 dos
-#   CP950                       woe32 dos
-#   CP1046                      aix
-#   CP1124                      aix
-#   CP1125                      dos
-#   CP1129                      aix
-#   CP1131                      darwin
-#   CP1250                      woe32
-#   CP1251                      glibc solaris netbsd openbsd darwin cygwin woe32
-#   CP1252                      aix woe32
-#   CP1253                      woe32
-#   CP1254                      woe32
-#   CP1255                      glibc woe32
-#   CP1256                      woe32
-#   CP1257                      woe32
-#   GB2312                  Y   glibc aix hpux irix solaris freebsd netbsd darwin
-#   EUC-JP                  Y   glibc aix hpux irix osf solaris freebsd netbsd darwin
-#   EUC-KR                  Y   glibc aix hpux irix osf solaris freebsd netbsd darwin cygwin
-#   EUC-TW                      glibc aix hpux irix osf solaris netbsd
-#   BIG5                    Y   glibc aix hpux osf solaris freebsd netbsd darwin cygwin
-#   BIG5-HKSCS                  glibc solaris darwin
-#   GBK                         glibc aix osf solaris darwin cygwin woe32 dos
-#   GB18030                     glibc solaris netbsd darwin
-#   SHIFT_JIS               Y   hpux osf solaris freebsd netbsd darwin
-#   JOHAB                       glibc solaris woe32
-#   TIS-620                     glibc aix hpux osf solaris cygwin
-#   VISCII                  Y   glibc
-#   TCVN5712-1                  glibc
-#   ARMSCII-8                   glibc darwin
-#   GEORGIAN-PS                 glibc cygwin
-#   PT154                       glibc
-#   HP-ROMAN8                   hpux
-#   HP-ARABIC8                  hpux
-#   HP-GREEK8                   hpux
-#   HP-HEBREW8                  hpux
-#   HP-TURKISH8                 hpux
-#   HP-KANA8                    hpux
-#   DEC-KANJI                   osf
-#   DEC-HANYU                   osf
-#   UTF-8                   Y   glibc aix hpux osf solaris netbsd darwin cygwin
-#
-# Note: Names which are not marked as being a MIME name should not be used in
-# Internet protocols for information interchange (mail, news, etc.).
-#
-# Note: ASCII and ANSI_X3.4-1968 are synonymous canonical names. Applications
-# must understand both names and treat them as equivalent.
-#
-# The first argument passed to this file is the canonical host specification,
-#    CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
-# or
-#    CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
-
-host="$1"
-os=`echo "$host" | sed -e 's/^[^-]*-[^-]*-\(.*\)$/\1/'`
-echo "# This file contains a table of character encoding aliases,"
-echo "# suitable for operating system '${os}'."
-echo "# It was automatically generated from config.charset."
-# List of references, updated during installation:
-echo "# Packages using this file: "
-case "$os" in
-  linux-gnulibc1*)
-    # Linux libc5 doesn't have nl_langinfo(CODESET); therefore
-    # localcharset.c falls back to using the full locale name
-    # from the environment variables.
-    echo "C ASCII"
-    echo "POSIX ASCII"
-    for l in af af_ZA ca ca_ES da da_DK de de_AT de_BE de_CH de_DE de_LU \
-             en en_AU en_BW en_CA en_DK en_GB en_IE en_NZ en_US en_ZA \
-             en_ZW es es_AR es_BO es_CL es_CO es_DO es_EC es_ES es_GT \
-             es_HN es_MX es_PA es_PE es_PY es_SV es_US es_UY es_VE et \
-             et_EE eu eu_ES fi fi_FI fo fo_FO fr fr_BE fr_CA fr_CH fr_FR \
-             fr_LU ga ga_IE gl gl_ES id id_ID in in_ID is is_IS it it_CH \
-             it_IT kl kl_GL nl nl_BE nl_NL no no_NO pt pt_BR pt_PT sv \
-             sv_FI sv_SE; do
-      echo "$l ISO-8859-1"
-      echo "$l.iso-8859-1 ISO-8859-1"
-      echo "$l.iso-8859-15 ISO-8859-15"
-      echo "$l.iso-8859-15@euro ISO-8859-15"
-      echo "$l@euro ISO-8859-15"
-      echo "$l.cp-437 CP437"
-      echo "$l.cp-850 CP850"
-      echo "$l.cp-1252 CP1252"
-      echo "$l.cp-1252@euro CP1252"
-      #echo "$l.atari-st ATARI-ST" # not a commonly used encoding
-      echo "$l.utf-8 UTF-8"
-      echo "$l.utf-8@euro UTF-8"
-    done
-    for l in cs cs_CZ hr hr_HR hu hu_HU pl pl_PL ro ro_RO sk sk_SK sl \
-             sl_SI sr sr_CS sr_YU; do
-      echo "$l ISO-8859-2"
-      echo "$l.iso-8859-2 ISO-8859-2"
-      echo "$l.cp-852 CP852"
-      echo "$l.cp-1250 CP1250"
-      echo "$l.utf-8 UTF-8"
-    done
-    for l in mk mk_MK ru ru_RU; do
-      echo "$l ISO-8859-5"
-      echo "$l.iso-8859-5 ISO-8859-5"
-      echo "$l.koi8-r KOI8-R"
-      echo "$l.cp-866 CP866"
-      echo "$l.cp-1251 CP1251"
-      echo "$l.utf-8 UTF-8"
-    done
-    for l in ar ar_SA; do
-      echo "$l ISO-8859-6"
-      echo "$l.iso-8859-6 ISO-8859-6"
-      echo "$l.cp-864 CP864"
-      #echo "$l.cp-868 CP868" # not a commonly used encoding
-      echo "$l.cp-1256 CP1256"
-      echo "$l.utf-8 UTF-8"
-    done
-    for l in el el_GR gr gr_GR; do
-      echo "$l ISO-8859-7"
-      echo "$l.iso-8859-7 ISO-8859-7"
-      echo "$l.cp-869 CP869"
-      echo "$l.cp-1253 CP1253"
-      echo "$l.cp-1253@euro CP1253"
-      echo "$l.utf-8 UTF-8"
-      echo "$l.utf-8@euro UTF-8"
-    done
-    for l in he he_IL iw iw_IL; do
-      echo "$l ISO-8859-8"
-      echo "$l.iso-8859-8 ISO-8859-8"
-      echo "$l.cp-862 CP862"
-      echo "$l.cp-1255 CP1255"
-      echo "$l.utf-8 UTF-8"
-    done
-    for l in tr tr_TR; do
-      echo "$l ISO-8859-9"
-      echo "$l.iso-8859-9 ISO-8859-9"
-      echo "$l.cp-857 CP857"
-      echo "$l.cp-1254 CP1254"
-      echo "$l.utf-8 UTF-8"
-    done
-    for l in lt lt_LT lv lv_LV; do
-      #echo "$l BALTIC" # not a commonly used encoding, wrong encoding name
-      echo "$l ISO-8859-13"
-    done
-    for l in ru_UA uk uk_UA; do
-      echo "$l KOI8-U"
-    done
-    for l in zh zh_CN; do
-      #echo "$l GB_2312-80" # not a commonly used encoding, wrong encoding name
-      echo "$l GB2312"
-    done
-    for l in ja ja_JP ja_JP.EUC; do
-      echo "$l EUC-JP"
-    done
-    for l in ko ko_KR; do
-      echo "$l EUC-KR"
-    done
-    for l in th th_TH; do
-      echo "$l TIS-620"
-    done
-    for l in fa fa_IR; do
-      #echo "$l ISIRI-3342" # a broken encoding
-      echo "$l.utf-8 UTF-8"
-    done
-    ;;
-  linux* | *-gnu*)
-    # With glibc-2.1 or newer, we don't need any canonicalization,
-    # because glibc has iconv and both glibc and libiconv support all
-    # GNU canonical names directly. Therefore, the Makefile does not
-    # need to install the alias file at all.
-    # The following applies only to glibc-2.0.x and older libcs.
-    echo "ISO_646.IRV:1983 ASCII"
-    ;;
-  aix*)
-    echo "ISO8859-1 ISO-8859-1"
-    echo "ISO8859-2 ISO-8859-2"
-    echo "ISO8859-5 ISO-8859-5"
-    echo "ISO8859-6 ISO-8859-6"
-    echo "ISO8859-7 ISO-8859-7"
-    echo "ISO8859-8 ISO-8859-8"
-    echo "ISO8859-9 ISO-8859-9"
-    echo "ISO8859-15 ISO-8859-15"
-    echo "IBM-850 CP850"
-    echo "IBM-856 CP856"
-    echo "IBM-921 ISO-8859-13"
-    echo "IBM-922 CP922"
-    echo "IBM-932 CP932"
-    echo "IBM-943 CP943"
-    echo "IBM-1046 CP1046"
-    echo "IBM-1124 CP1124"
-    echo "IBM-1129 CP1129"
-    echo "IBM-1252 CP1252"
-    echo "IBM-eucCN GB2312"
-    echo "IBM-eucJP EUC-JP"
-    echo "IBM-eucKR EUC-KR"
-    echo "IBM-eucTW EUC-TW"
-    echo "big5 BIG5"
-    echo "GBK GBK"
-    echo "TIS-620 TIS-620"
-    echo "UTF-8 UTF-8"
-    ;;
-  hpux*)
-    echo "iso88591 ISO-8859-1"
-    echo "iso88592 ISO-8859-2"
-    echo "iso88595 ISO-8859-5"
-    echo "iso88596 ISO-8859-6"
-    echo "iso88597 ISO-8859-7"
-    echo "iso88598 ISO-8859-8"
-    echo "iso88599 ISO-8859-9"
-    echo "iso885915 ISO-8859-15"
-    echo "roman8 HP-ROMAN8"
-    echo "arabic8 HP-ARABIC8"
-    echo "greek8 HP-GREEK8"
-    echo "hebrew8 HP-HEBREW8"
-    echo "turkish8 HP-TURKISH8"
-    echo "kana8 HP-KANA8"
-    echo "tis620 TIS-620"
-    echo "big5 BIG5"
-    echo "eucJP EUC-JP"
-    echo "eucKR EUC-KR"
-    echo "eucTW EUC-TW"
-    echo "hp15CN GB2312"
-    #echo "ccdc ?" # what is this?
-    echo "SJIS SHIFT_JIS"
-    echo "utf8 UTF-8"
-    ;;
-  irix*)
-    echo "ISO8859-1 ISO-8859-1"
-    echo "ISO8859-2 ISO-8859-2"
-    echo "ISO8859-5 ISO-8859-5"
-    echo "ISO8859-7 ISO-8859-7"
-    echo "ISO8859-9 ISO-8859-9"
-    echo "eucCN GB2312"
-    echo "eucJP EUC-JP"
-    echo "eucKR EUC-KR"
-    echo "eucTW EUC-TW"
-    ;;
-  osf*)
-    echo "ISO8859-1 ISO-8859-1"
-    echo "ISO8859-2 ISO-8859-2"
-    echo "ISO8859-4 ISO-8859-4"
-    echo "ISO8859-5 ISO-8859-5"
-    echo "ISO8859-7 ISO-8859-7"
-    echo "ISO8859-8 ISO-8859-8"
-    echo "ISO8859-9 ISO-8859-9"
-    echo "ISO8859-15 ISO-8859-15"
-    echo "cp850 CP850"
-    echo "big5 BIG5"
-    echo "dechanyu DEC-HANYU"
-    echo "dechanzi GB2312"
-    echo "deckanji DEC-KANJI"
-    echo "deckorean EUC-KR"
-    echo "eucJP EUC-JP"
-    echo "eucKR EUC-KR"
-    echo "eucTW EUC-TW"
-    echo "GBK GBK"
-    echo "KSC5601 CP949"
-    echo "sdeckanji EUC-JP"
-    echo "SJIS SHIFT_JIS"
-    echo "TACTIS TIS-620"
-    echo "UTF-8 UTF-8"
-    ;;
-  solaris*)
-    echo "646 ASCII"
-    echo "ISO8859-1 ISO-8859-1"
-    echo "ISO8859-2 ISO-8859-2"
-    echo "ISO8859-3 ISO-8859-3"
-    echo "ISO8859-4 ISO-8859-4"
-    echo "ISO8859-5 ISO-8859-5"
-    echo "ISO8859-6 ISO-8859-6"
-    echo "ISO8859-7 ISO-8859-7"
-    echo "ISO8859-8 ISO-8859-8"
-    echo "ISO8859-9 ISO-8859-9"
-    echo "ISO8859-15 ISO-8859-15"
-    echo "koi8-r KOI8-R"
-    echo "ansi-1251 CP1251"
-    echo "BIG5 BIG5"
-    echo "Big5-HKSCS BIG5-HKSCS"
-    echo "gb2312 GB2312"
-    echo "GBK GBK"
-    echo "GB18030 GB18030"
-    echo "cns11643 EUC-TW"
-    echo "5601 EUC-KR"
-    echo "ko_KR.johap92 JOHAB"
-    echo "eucJP EUC-JP"
-    echo "PCK SHIFT_JIS"
-    echo "TIS620.2533 TIS-620"
-    #echo "sun_eu_greek ?" # what is this?
-    echo "UTF-8 UTF-8"
-    ;;
-  freebsd* | os2*)
-    # FreeBSD 4.2 doesn't have nl_langinfo(CODESET); therefore
-    # localcharset.c falls back to using the full locale name
-    # from the environment variables.
-    # Likewise for OS/2. OS/2 has XFree86 just like FreeBSD. Just
-    # reuse FreeBSD's locale data for OS/2.
-    echo "C ASCII"
-    echo "US-ASCII ASCII"
-    for l in la_LN lt_LN; do
-      echo "$l.ASCII ASCII"
-    done
-    for l in da_DK de_AT de_CH de_DE en_AU en_CA en_GB en_US es_ES \
-             fi_FI fr_BE fr_CA fr_CH fr_FR is_IS it_CH it_IT la_LN \
-             lt_LN nl_BE nl_NL no_NO pt_PT sv_SE; do
-      echo "$l.ISO_8859-1 ISO-8859-1"
-      echo "$l.DIS_8859-15 ISO-8859-15"
-    done
-    for l in cs_CZ hr_HR hu_HU la_LN lt_LN pl_PL sl_SI; do
-      echo "$l.ISO_8859-2 ISO-8859-2"
-    done
-    for l in la_LN lt_LT; do
-      echo "$l.ISO_8859-4 ISO-8859-4"
-    done
-    for l in ru_RU ru_SU; do
-      echo "$l.KOI8-R KOI8-R"
-      echo "$l.ISO_8859-5 ISO-8859-5"
-      echo "$l.CP866 CP866"
-    done
-    echo "uk_UA.KOI8-U KOI8-U"
-    echo "zh_TW.BIG5 BIG5"
-    echo "zh_TW.Big5 BIG5"
-    echo "zh_CN.EUC GB2312"
-    echo "ja_JP.EUC EUC-JP"
-    echo "ja_JP.SJIS SHIFT_JIS"
-    echo "ja_JP.Shift_JIS SHIFT_JIS"
-    echo "ko_KR.EUC EUC-KR"
-    ;;
-  netbsd*)
-    echo "646 ASCII"
-    echo "ISO8859-1 ISO-8859-1"
-    echo "ISO8859-2 ISO-8859-2"
-    echo "ISO8859-4 ISO-8859-4"
-    echo "ISO8859-5 ISO-8859-5"
-    echo "ISO8859-7 ISO-8859-7"
-    echo "ISO8859-13 ISO-8859-13"
-    echo "ISO8859-15 ISO-8859-15"
-    echo "eucCN GB2312"
-    echo "eucJP EUC-JP"
-    echo "eucKR EUC-KR"
-    echo "eucTW EUC-TW"
-    echo "BIG5 BIG5"
-    echo "SJIS SHIFT_JIS"
-    ;;
-  openbsd*)
-    echo "646 ASCII"
-    echo "ISO8859-1 ISO-8859-1"
-    echo "ISO8859-2 ISO-8859-2"
-    echo "ISO8859-4 ISO-8859-4"
-    echo "ISO8859-5 ISO-8859-5"
-    echo "ISO8859-7 ISO-8859-7"
-    echo "ISO8859-13 ISO-8859-13"
-    echo "ISO8859-15 ISO-8859-15"
-    ;;
-  darwin[56]*)
-    # Darwin 6.8 doesn't have nl_langinfo(CODESET); therefore
-    # localcharset.c falls back to using the full locale name
-    # from the environment variables.
-    echo "C ASCII"
-    for l in en_AU en_CA en_GB en_US la_LN; do
-      echo "$l.US-ASCII ASCII"
-    done
-    for l in da_DK de_AT de_CH de_DE en_AU en_CA en_GB en_US es_ES \
-             fi_FI fr_BE fr_CA fr_CH fr_FR is_IS it_CH it_IT nl_BE \
-             nl_NL no_NO pt_PT sv_SE; do
-      echo "$l ISO-8859-1"
-      echo "$l.ISO8859-1 ISO-8859-1"
-      echo "$l.ISO8859-15 ISO-8859-15"
-    done
-    for l in la_LN; do
-      echo "$l.ISO8859-1 ISO-8859-1"
-      echo "$l.ISO8859-15 ISO-8859-15"
-    done
-    for l in cs_CZ hr_HR hu_HU la_LN pl_PL sl_SI; do
-      echo "$l.ISO8859-2 ISO-8859-2"
-    done
-    for l in la_LN lt_LT; do
-      echo "$l.ISO8859-4 ISO-8859-4"
-    done
-    for l in ru_RU; do
-      echo "$l.KOI8-R KOI8-R"
-      echo "$l.ISO8859-5 ISO-8859-5"
-      echo "$l.CP866 CP866"
-    done
-    for l in bg_BG; do
-      echo "$l.CP1251 CP1251"
-    done
-    echo "uk_UA.KOI8-U KOI8-U"
-    echo "zh_TW.BIG5 BIG5"
-    echo "zh_TW.Big5 BIG5"
-    echo "zh_CN.EUC GB2312"
-    echo "ja_JP.EUC EUC-JP"
-    echo "ja_JP.SJIS SHIFT_JIS"
-    echo "ko_KR.EUC EUC-KR"
-    ;;
-  darwin*)
-    # Darwin 7.5 has nl_langinfo(CODESET), but sometimes its value is
-    # useless:
-    # - It returns the empty string when LANG is set to a locale of the
-    #   form ll_CC, although ll_CC/LC_CTYPE is a symlink to an UTF-8
-    #   LC_CTYPE file.
-    # - The environment variables LANG, LC_CTYPE, LC_ALL are not set by
-    #   the system; nl_langinfo(CODESET) returns "US-ASCII" in this case.
-    # - The documentation says:
-    #     "... all code that calls BSD system routines should ensure
-    #      that the const *char parameters of these routines are in UTF-8
-    #      encoding. All BSD system functions expect their string
-    #      parameters to be in UTF-8 encoding and nothing else."
-    #   It also says
-    #     "An additional caveat is that string parameters for files,
-    #      paths, and other file-system entities must be in canonical
-    #      UTF-8. In a canonical UTF-8 Unicode string, all decomposable
-    #      characters are decomposed ..."
-    #   but this is not true: You can pass non-decomposed UTF-8 strings
-    #   to file system functions, and it is the OS which will convert
-    #   them to decomposed UTF-8 before accessing the file system.
-    # - The Apple Terminal application displays UTF-8 by default.
-    # - However, other applications are free to use different encodings:
-    #   - xterm uses ISO-8859-1 by default.
-    #   - TextEdit uses MacRoman by default.
-    # We prefer UTF-8 over decomposed UTF-8-MAC because one should
-    # minimize the use of decomposed Unicode. Unfortunately, through the
-    # Darwin file system, decomposed UTF-8 strings are leaked into user
-    # space nevertheless.
-    # Then there are also the locales with encodings other than US-ASCII
-    # and UTF-8. These locales can be occasionally useful to users (e.g.
-    # when grepping through ISO-8859-1 encoded text files), when all their
-    # file names are in US-ASCII.
-    echo "ISO8859-1 ISO-8859-1"
-    echo "ISO8859-2 ISO-8859-2"
-    echo "ISO8859-4 ISO-8859-4"
-    echo "ISO8859-5 ISO-8859-5"
-    echo "ISO8859-7 ISO-8859-7"
-    echo "ISO8859-9 ISO-8859-9"
-    echo "ISO8859-13 ISO-8859-13"
-    echo "ISO8859-15 ISO-8859-15"
-    echo "KOI8-R KOI8-R"
-    echo "KOI8-U KOI8-U"
-    echo "CP866 CP866"
-    echo "CP949 CP949"
-    echo "CP1131 CP1131"
-    echo "CP1251 CP1251"
-    echo "eucCN GB2312"
-    echo "GB2312 GB2312"
-    echo "eucJP EUC-JP"
-    echo "eucKR EUC-KR"
-    echo "Big5 BIG5"
-    echo "Big5HKSCS BIG5-HKSCS"
-    echo "GBK GBK"
-    echo "GB18030 GB18030"
-    echo "SJIS SHIFT_JIS"
-    echo "ARMSCII-8 ARMSCII-8"
-    echo "PT154 PT154"
-    #echo "ISCII-DEV ?"
-    echo "* UTF-8"
-    ;;
-  beos* | haiku*)
-    # BeOS and Haiku have a single locale, and it has UTF-8 encoding.
-    echo "* UTF-8"
-    ;;
-  msdosdjgpp*)
-    # DJGPP 2.03 doesn't have nl_langinfo(CODESET); therefore
-    # localcharset.c falls back to using the full locale name
-    # from the environment variables.
-    echo "#"
-    echo "# The encodings given here may not all be correct."
-    echo "# If you find that the encoding given for your language and"
-    echo "# country is not the one your DOS machine actually uses, just"
-    echo "# correct it in this file, and send a mail to"
-    echo "# Juan Manuel Guerrero <juan.guerrero@gmx.de>"
-    echo "# and Bruno Haible <bruno@clisp.org>."
-    echo "#"
-    echo "C ASCII"
-    # ISO-8859-1 languages
-    echo "ca CP850"
-    echo "ca_ES CP850"
-    echo "da CP865"    # not CP850 ??
-    echo "da_DK CP865" # not CP850 ??
-    echo "de CP850"
-    echo "de_AT CP850"
-    echo "de_CH CP850"
-    echo "de_DE CP850"
-    echo "en CP850"
-    echo "en_AU CP850" # not CP437 ??
-    echo "en_CA CP850"
-    echo "en_GB CP850"
-    echo "en_NZ CP437"
-    echo "en_US CP437"
-    echo "en_ZA CP850" # not CP437 ??
-    echo "es CP850"
-    echo "es_AR CP850"
-    echo "es_BO CP850"
-    echo "es_CL CP850"
-    echo "es_CO CP850"
-    echo "es_CR CP850"
-    echo "es_CU CP850"
-    echo "es_DO CP850"
-    echo "es_EC CP850"
-    echo "es_ES CP850"
-    echo "es_GT CP850"
-    echo "es_HN CP850"
-    echo "es_MX CP850"
-    echo "es_NI CP850"
-    echo "es_PA CP850"
-    echo "es_PY CP850"
-    echo "es_PE CP850"
-    echo "es_SV CP850"
-    echo "es_UY CP850"
-    echo "es_VE CP850"
-    echo "et CP850"
-    echo "et_EE CP850"
-    echo "eu CP850"
-    echo "eu_ES CP850"
-    echo "fi CP850"
-    echo "fi_FI CP850"
-    echo "fr CP850"
-    echo "fr_BE CP850"
-    echo "fr_CA CP850"
-    echo "fr_CH CP850"
-    echo "fr_FR CP850"
-    echo "ga CP850"
-    echo "ga_IE CP850"
-    echo "gd CP850"
-    echo "gd_GB CP850"
-    echo "gl CP850"
-    echo "gl_ES CP850"
-    echo "id CP850"    # not CP437 ??
-    echo "id_ID CP850" # not CP437 ??
-    echo "is CP861"    # not CP850 ??
-    echo "is_IS CP861" # not CP850 ??
-    echo "it CP850"
-    echo "it_CH CP850"
-    echo "it_IT CP850"
-    echo "lt CP775"
-    echo "lt_LT CP775"
-    echo "lv CP775"
-    echo "lv_LV CP775"
-    echo "nb CP865"    # not CP850 ??
-    echo "nb_NO CP865" # not CP850 ??
-    echo "nl CP850"
-    echo "nl_BE CP850"
-    echo "nl_NL CP850"
-    echo "nn CP865"    # not CP850 ??
-    echo "nn_NO CP865" # not CP850 ??
-    echo "no CP865"    # not CP850 ??
-    echo "no_NO CP865" # not CP850 ??
-    echo "pt CP850"
-    echo "pt_BR CP850"
-    echo "pt_PT CP850"
-    echo "sv CP850"
-    echo "sv_SE CP850"
-    # ISO-8859-2 languages
-    echo "cs CP852"
-    echo "cs_CZ CP852"
-    echo "hr CP852"
-    echo "hr_HR CP852"
-    echo "hu CP852"
-    echo "hu_HU CP852"
-    echo "pl CP852"
-    echo "pl_PL CP852"
-    echo "ro CP852"
-    echo "ro_RO CP852"
-    echo "sk CP852"
-    echo "sk_SK CP852"
-    echo "sl CP852"
-    echo "sl_SI CP852"
-    echo "sq CP852"
-    echo "sq_AL CP852"
-    echo "sr CP852"    # CP852 or CP866 or CP855 ??
-    echo "sr_CS CP852" # CP852 or CP866 or CP855 ??
-    echo "sr_YU CP852" # CP852 or CP866 or CP855 ??
-    # ISO-8859-3 languages
-    echo "mt CP850"
-    echo "mt_MT CP850"
-    # ISO-8859-5 languages
-    echo "be CP866"
-    echo "be_BE CP866"
-    echo "bg CP866"    # not CP855 ??
-    echo "bg_BG CP866" # not CP855 ??
-    echo "mk CP866"    # not CP855 ??
-    echo "mk_MK CP866" # not CP855 ??
-    echo "ru CP866"
-    echo "ru_RU CP866"
-    echo "uk CP1125"
-    echo "uk_UA CP1125"
-    # ISO-8859-6 languages
-    echo "ar CP864"
-    echo "ar_AE CP864"
-    echo "ar_DZ CP864"
-    echo "ar_EG CP864"
-    echo "ar_IQ CP864"
-    echo "ar_IR CP864"
-    echo "ar_JO CP864"
-    echo "ar_KW CP864"
-    echo "ar_MA CP864"
-    echo "ar_OM CP864"
-    echo "ar_QA CP864"
-    echo "ar_SA CP864"
-    echo "ar_SY CP864"
-    # ISO-8859-7 languages
-    echo "el CP869"
-    echo "el_GR CP869"
-    # ISO-8859-8 languages
-    echo "he CP862"
-    echo "he_IL CP862"
-    # ISO-8859-9 languages
-    echo "tr CP857"
-    echo "tr_TR CP857"
-    # Japanese
-    echo "ja CP932"
-    echo "ja_JP CP932"
-    # Chinese
-    echo "zh_CN GBK"
-    echo "zh_TW CP950" # not CP938 ??
-    # Korean
-    echo "kr CP949"    # not CP934 ??
-    echo "kr_KR CP949" # not CP934 ??
-    # Thai
-    echo "th CP874"
-    echo "th_TH CP874"
-    # Other
-    echo "eo CP850"
-    echo "eo_EO CP850"
-    ;;
-esac
diff --git a/lib/connect.c b/lib/connect.c
new file mode 100644 (file)
index 0000000..730331b
--- /dev/null
@@ -0,0 +1,47 @@
+/* connect.c --- wrappers for Windows connect function
+
+   Copyright (C) 2008-2011 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 3 of the License, 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, see <http://www.gnu.org/licenses/>.  */
+
+/* Written by Paolo Bonzini */
+
+#include <config.h>
+
+#define WIN32_LEAN_AND_MEAN
+/* Get winsock2.h. */
+#include <sys/socket.h>
+
+/* Get set_winsock_errno, FD_TO_SOCKET etc. */
+#include "w32sock.h"
+
+#undef connect
+
+int
+rpl_connect (int fd, const struct sockaddr *sockaddr, socklen_t len)
+{
+  SOCKET sock = FD_TO_SOCKET (fd);
+  int r = connect (sock, sockaddr, len);
+  if (r < 0)
+    {
+      /* EINPROGRESS is not returned by WinSock 2.0; for backwards
+         compatibility, connect(2) uses EWOULDBLOCK.  */
+      if (WSAGetLastError () == WSAEWOULDBLOCK)
+        WSASetLastError (WSAEINPROGRESS);
+
+      set_winsock_errno ();
+    }
+
+  return r;
+}
index 23527b1..8b1bf34 100644 (file)
@@ -1,5 +1,5 @@
 /* Duplicate a locale object.
 /* Duplicate a locale object.
-   Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+   Copyright (C) 2009-2011 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
 
    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
index 3543adc..98355be 100644 (file)
@@ -1,6 +1,6 @@
 /* A POSIX-like <errno.h>.
 
 /* A POSIX-like <errno.h>.
 
-   Copyright (C) 2008-2010 Free Software Foundation, Inc.
+   Copyright (C) 2008-2011 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
 
    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
diff --git a/lib/fclose.c b/lib/fclose.c
new file mode 100644 (file)
index 0000000..805449a
--- /dev/null
@@ -0,0 +1,47 @@
+/* fclose replacement.
+   Copyright (C) 2008-2011 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 3 of the License, 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, see <http://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include <stdio.h>
+
+#include <errno.h>
+#include <unistd.h>
+
+/* Override fclose() to call the overridden close().  */
+
+int
+rpl_fclose (FILE *fp)
+#undef fclose
+{
+  int saved_errno = 0;
+
+  if (fflush (fp))
+    saved_errno = errno;
+
+  if (close (fileno (fp)) < 0 && saved_errno == 0)
+    saved_errno = errno;
+
+  fclose (fp); /* will fail with errno = EBADF */
+
+  if (saved_errno != 0)
+    {
+      errno = saved_errno;
+      return EOF;
+    }
+  return 0;
+}
index 5a4955f..78019e5 100644 (file)
@@ -1,5 +1,5 @@
 /* Supplemental information about the floating-point formats.
 /* Supplemental information about the floating-point formats.
-   Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009-2011 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2007.
 
    This program is free software; you can redistribute it and/or modify
    Written by Bruno Haible <bruno@clisp.org>, 2007.
 
    This program is free software; you can redistribute it and/or modify
index 83fbf9f..d252bf0 100644 (file)
@@ -1,6 +1,6 @@
 /* A correct <float.h>.
 
 /* A correct <float.h>.
 
-   Copyright (C) 2007-2010 Free Software Foundation, Inc.
+   Copyright (C) 2007-2011 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
 
    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
index 72eef5b..bdec6d4 100644 (file)
@@ -6,7 +6,7 @@
 
    Written by Richard W.M. Jones <rjones.at.redhat.com>
 
 
    Written by Richard W.M. Jones <rjones.at.redhat.com>
 
-   Copyright (C) 2008-2010 Free Software Foundation, Inc.
+   Copyright (C) 2008-2011 Free Software Foundation, Inc.
 
    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
 
    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
@@ -163,9 +163,7 @@ flock (int fd, int operation)
 #ifdef HAVE_STRUCT_FLOCK_L_TYPE
 /* We know how to implement flock in terms of fcntl. */
 
 #ifdef HAVE_STRUCT_FLOCK_L_TYPE
 /* We know how to implement flock in terms of fcntl. */
 
-#ifdef HAVE_FCNTL_H
 #include <fcntl.h>
 #include <fcntl.h>
-#endif
 
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
index 93d378d..2f78020 100644 (file)
@@ -1,5 +1,5 @@
 /* An interface to read that retries after partial reads and interrupts.
 /* An interface to read that retries after partial reads and interrupts.
-   Copyright (C) 2002-2003, 2009-2010 Free Software Foundation, Inc.
+   Copyright (C) 2002-2003, 2009-2011 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
 
    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
index 71817a7..313d474 100644 (file)
@@ -1,6 +1,6 @@
 /* An interface to read() that reads all it is asked to read.
 
 /* An interface to read() that reads all it is asked to read.
 
-   Copyright (C) 2002, 2009-2010 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2009-2011 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
 
    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
index b0f6b27..b60ba02 100644 (file)
@@ -1,6 +1,6 @@
 /* An interface to read and write that retries (if necessary) until complete.
 
 /* An interface to read and write that retries (if necessary) until complete.
 
-   Copyright (C) 1993-1994, 1997-2006, 2009-2010 Free Software Foundation, Inc.
+   Copyright (C) 1993-1994, 1997-2006, 2009-2011 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
 
    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
index 03dabfb..c059a63 100644 (file)
@@ -1,6 +1,6 @@
 /* An interface to write() that writes all it is asked to write.
 
 /* An interface to write() that writes all it is asked to write.
 
-   Copyright (C) 2002-2003, 2009-2010 Free Software Foundation, Inc.
+   Copyright (C) 2002-2003, 2009-2011 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
 
    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
index 21e8076..92b4dd0 100644 (file)
@@ -1,5 +1,5 @@
-/* Copyright (C) 1997, 2001, 2002, 2004, 2005, 2006, 2008, 2009, 2010 Free
-   Software Foundation, Inc.
+/* Copyright (C) 1997, 2001-2002, 2004-2006, 2008-2011 Free Software
+   Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Philip Blundell <pjb27@cam.ac.uk>, 1997.
 
    This file is part of the GNU C Library.
    Contributed by Philip Blundell <pjb27@cam.ac.uk>, 1997.
 
index 1314871..2610031 100644 (file)
@@ -1,5 +1,5 @@
 /* Get address information (partial implementation).
 /* Get address information (partial implementation).
-   Copyright (C) 1997, 2001-2002, 2004-2010 Free Software Foundation, Inc.
+   Copyright (C) 1997, 2001-2002, 2004-2011 Free Software Foundation, Inc.
    Contributed by Simon Josefsson <simon@josefsson.org>.
 
    This program is free software; you can redistribute it and/or modify
    Contributed by Simon Josefsson <simon@josefsson.org>.
 
    This program is free software; you can redistribute it and/or modify
diff --git a/lib/getpeername.c b/lib/getpeername.c
new file mode 100644 (file)
index 0000000..806bb49
--- /dev/null
@@ -0,0 +1,40 @@
+/* getpeername.c --- wrappers for Windows getpeername function
+
+   Copyright (C) 2008-2011 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 3 of the License, 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, see <http://www.gnu.org/licenses/>.  */
+
+/* Written by Paolo Bonzini */
+
+#include <config.h>
+
+#define WIN32_LEAN_AND_MEAN
+/* Get winsock2.h. */
+#include <sys/socket.h>
+
+/* Get set_winsock_errno, FD_TO_SOCKET etc. */
+#include "w32sock.h"
+
+#undef getpeername
+
+int
+rpl_getpeername (int fd, struct sockaddr *addr, socklen_t *addrlen)
+{
+  SOCKET sock = FD_TO_SOCKET (fd);
+  int r = getpeername (sock, addr, addrlen);
+  if (r < 0)
+    set_winsock_errno ();
+
+  return r;
+}
diff --git a/lib/getsockname.c b/lib/getsockname.c
new file mode 100644 (file)
index 0000000..d48f26f
--- /dev/null
@@ -0,0 +1,40 @@
+/* getsockname.c --- wrappers for Windows getsockname function
+
+   Copyright (C) 2008-2011 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 3 of the License, 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, see <http://www.gnu.org/licenses/>.  */
+
+/* Written by Paolo Bonzini */
+
+#include <config.h>
+
+#define WIN32_LEAN_AND_MEAN
+/* Get winsock2.h. */
+#include <sys/socket.h>
+
+/* Get set_winsock_errno, FD_TO_SOCKET etc. */
+#include "w32sock.h"
+
+#undef getsockname
+
+int
+rpl_getsockname (int fd, struct sockaddr *addr, socklen_t *addrlen)
+{
+  SOCKET sock = FD_TO_SOCKET (fd);
+  int r = getsockname (sock, addr, addrlen);
+  if (r < 0)
+    set_winsock_errno ();
+
+  return r;
+}
diff --git a/lib/getsockopt.c b/lib/getsockopt.c
new file mode 100644 (file)
index 0000000..7c83f01
--- /dev/null
@@ -0,0 +1,67 @@
+/* getsockopt.c --- wrappers for Windows getsockopt function
+
+   Copyright (C) 2008-2011 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 3 of the License, 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, see <http://www.gnu.org/licenses/>.  */
+
+/* Written by Paolo Bonzini */
+
+#include <config.h>
+
+#define WIN32_LEAN_AND_MEAN
+/* Get winsock2.h. */
+#include <sys/socket.h>
+
+/* Get struct timeval. */
+#include <sys/time.h>
+
+/* Get memcpy. */
+#include <string.h>
+
+/* Get set_winsock_errno, FD_TO_SOCKET etc. */
+#include "w32sock.h"
+
+#undef getsockopt
+
+int
+rpl_getsockopt (int fd, int level, int optname, void *optval, socklen_t *optlen)
+{
+  int r;
+  SOCKET sock = FD_TO_SOCKET (fd);
+
+  if (level == SOL_SOCKET && (optname == SO_RCVTIMEO || optname == SO_SNDTIMEO))
+    {
+      int milliseconds;
+      int milliseconds_len = sizeof (int);
+      struct timeval tv;
+      size_t n;
+      r = getsockopt (sock, level, optname, &milliseconds, &milliseconds_len);
+      tv.tv_sec = milliseconds / 1000;
+      tv.tv_usec = (milliseconds - 1000 * tv.tv_sec) * 1000;
+      n = sizeof (struct timeval);
+      if (n > *optlen)
+        n = *optlen;
+      memcpy (optval, &tv, n);
+      *optlen = n;
+    }
+  else
+    {
+      r = getsockopt (sock, level, optname, optval, optlen);
+    }
+
+  if (r < 0)
+    set_winsock_errno ();
+
+  return r;
+}
index d7705b5..9d339a6 100644 (file)
@@ -1,5 +1,5 @@
 /* Convenience header for conditional use of GNU <libintl.h>.
 /* Convenience header for conditional use of GNU <libintl.h>.
-   Copyright (C) 1995-1998, 2000-2002, 2004-2006, 2009-2010 Free Software
+   Copyright (C) 1995-1998, 2000-2002, 2004-2006, 2009-2011 Free Software
    Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
 
 #endif
 
 
 #endif
 
+/* Prefer gnulib's setlocale override over libintl's setlocale override.  */
+#ifdef GNULIB_defined_setlocale
+# undef setlocale
+# define setlocale rpl_setlocale
+#endif
+
 /* A pseudo function call that serves as a marker for the automated
    extraction of messages, but does not call gettext().  The run-time
    translation is done at a different place in the code.
 /* A pseudo function call that serves as a marker for the automated
    extraction of messages, but does not call gettext().  The run-time
    translation is done at a different place in the code.
index 5b29d9a..f607ed3 100644 (file)
@@ -1,5 +1,5 @@
 /* Character set conversion.
 /* Character set conversion.
-   Copyright (C) 1999-2001, 2007, 2009-2010 Free Software Foundation, Inc.
+   Copyright (C) 1999-2001, 2007, 2009-2011 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
 
    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
index 260c758..6cb698e 100644 (file)
@@ -1,6 +1,6 @@
 /* A GNU-like <iconv.h>.
 
 /* A GNU-like <iconv.h>.
 
-   Copyright (C) 2007-2010 Free Software Foundation, Inc.
+   Copyright (C) 2007-2011 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
 
    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
index 1b300ec..d015f74 100644 (file)
@@ -1,5 +1,5 @@
 /* Character set conversion.
 /* Character set conversion.
-   Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009-2011 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
 
    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
index 1d1c053..b17a3b2 100644 (file)
@@ -1,5 +1,5 @@
 /* Character set conversion.
 /* Character set conversion.
-   Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009-2011 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
 
    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
index da15126..2a4f34b 100644 (file)
@@ -1,5 +1,5 @@
 /* Character set conversion handler type.
 /* Character set conversion handler type.
-   Copyright (C) 2001-2007, 2009-2010 Free Software Foundation, Inc.
+   Copyright (C) 2001-2007, 2009-2011 Free Software Foundation, Inc.
    Written by Bruno Haible.
 
    This program is free software: you can redistribute it and/or modify
    Written by Bruno Haible.
 
    This program is free software: you can redistribute it and/or modify
index fc8c683..64f90a1 100644 (file)
@@ -1,6 +1,6 @@
 /* inet_ntop.c -- convert IPv4 and IPv6 addresses from binary to text form
 
 /* inet_ntop.c -- convert IPv4 and IPv6 addresses from binary to text form
 
-   Copyright (C) 2005-2006, 2008-2010 Free Software Foundation, Inc.
+   Copyright (C) 2005-2006, 2008-2011 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
 
    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
index e7d4ba0..bceeec6 100644 (file)
@@ -1,6 +1,6 @@
 /* inet_pton.c -- convert IPv4 and IPv6 addresses from text to binary form
 
 /* inet_pton.c -- convert IPv4 and IPv6 addresses from text to binary form
 
-   Copyright (C) 2006, 2008, 2009, 2010 Free Software Foundation, Inc.
+   Copyright (C) 2006, 2008-2011 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
 
    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
index a2d6d10..28cfc4d 100644 (file)
@@ -1,5 +1,5 @@
 /* Test for positive or negative infinity.
 /* Test for positive or negative infinity.
-   Copyright (C) 2007-2010 Free Software Foundation, Inc.
+   Copyright (C) 2007-2011 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
 
    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
index ad96c1f..e977be1 100644 (file)
@@ -1,5 +1,5 @@
 /* Test for NaN that does not need libm.
 /* Test for NaN that does not need libm.
-   Copyright (C) 2007-2010 Free Software Foundation, Inc.
+   Copyright (C) 2007-2011 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
 
    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
index f7a1565..adfac27 100644 (file)
@@ -1,5 +1,5 @@
 /* Test for NaN that does not need libm.
 /* Test for NaN that does not need libm.
-   Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
+   Copyright (C) 2008-2011 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
 
    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
index a352fdb..2fd06f8 100644 (file)
@@ -1,5 +1,5 @@
 /* Test for NaN that does not need libm.
 /* Test for NaN that does not need libm.
-   Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009-2011 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
 
    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
index b45fef0..2e68d28 100644 (file)
@@ -1,5 +1,5 @@
 /* Test for NaN that does not need libm.
 /* Test for NaN that does not need libm.
-   Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009-2011 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
 
    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
diff --git a/lib/listen.c b/lib/listen.c
new file mode 100644 (file)
index 0000000..a29090d
--- /dev/null
@@ -0,0 +1,40 @@
+/* listen.c --- wrappers for Windows listen function
+
+   Copyright (C) 2008-2011 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 3 of the License, 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, see <http://www.gnu.org/licenses/>.  */
+
+/* Written by Paolo Bonzini */
+
+#include <config.h>
+
+#define WIN32_LEAN_AND_MEAN
+/* Get winsock2.h. */
+#include <sys/socket.h>
+
+/* Get set_winsock_errno, FD_TO_SOCKET etc. */
+#include "w32sock.h"
+
+#undef listen
+
+int
+rpl_listen (int fd, int backlog)
+{
+  SOCKET sock = FD_TO_SOCKET (fd);
+  int r = listen (sock, backlog);
+  if (r < 0)
+    set_winsock_errno ();
+
+  return r;
+}
diff --git a/lib/localcharset.c b/lib/localcharset.c
deleted file mode 100644 (file)
index 6c233d1..0000000
+++ /dev/null
@@ -1,548 +0,0 @@
-/* Determine a canonical name for the current locale's character encoding.
-
-   Copyright (C) 2000-2006, 2008-2010 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, 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.  */
-
-/* Written by Bruno Haible <bruno@clisp.org>.  */
-
-#include <config.h>
-
-/* Specification.  */
-#include "localcharset.h"
-
-#include <fcntl.h>
-#include <stddef.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-
-#if defined __APPLE__ && defined __MACH__ && HAVE_LANGINFO_CODESET
-# define DARWIN7 /* Darwin 7 or newer, i.e. MacOS X 10.3 or newer */
-#endif
-
-#if defined _WIN32 || defined __WIN32__
-# define WIN32_NATIVE
-#endif
-
-#if defined __EMX__
-/* Assume EMX program runs on OS/2, even if compiled under DOS.  */
-# ifndef OS2
-#  define OS2
-# endif
-#endif
-
-#if !defined WIN32_NATIVE
-# include <unistd.h>
-# if HAVE_LANGINFO_CODESET
-#  include <langinfo.h>
-# else
-#  if 0 /* see comment below */
-#   include <locale.h>
-#  endif
-# endif
-# ifdef __CYGWIN__
-#  define WIN32_LEAN_AND_MEAN
-#  include <windows.h>
-# endif
-#elif defined WIN32_NATIVE
-# define WIN32_LEAN_AND_MEAN
-# include <windows.h>
-#endif
-#if defined OS2
-# define INCL_DOS
-# include <os2.h>
-#endif
-
-#if ENABLE_RELOCATABLE
-# include "relocatable.h"
-#else
-# define relocate(pathname) (pathname)
-#endif
-
-/* Get LIBDIR.  */
-#ifndef LIBDIR
-# include "configmake.h"
-#endif
-
-/* Define O_NOFOLLOW to 0 on platforms where it does not exist.  */
-#ifndef O_NOFOLLOW
-# define O_NOFOLLOW 0
-#endif
-
-#if defined _WIN32 || defined __WIN32__ || defined __CYGWIN__ || defined __EMX__ || defined __DJGPP__
-  /* Win32, Cygwin, OS/2, DOS */
-# define ISSLASH(C) ((C) == '/' || (C) == '\\')
-#endif
-
-#ifndef DIRECTORY_SEPARATOR
-# define DIRECTORY_SEPARATOR '/'
-#endif
-
-#ifndef ISSLASH
-# define ISSLASH(C) ((C) == DIRECTORY_SEPARATOR)
-#endif
-
-#if HAVE_DECL_GETC_UNLOCKED
-# undef getc
-# define getc getc_unlocked
-#endif
-
-/* The following static variable is declared 'volatile' to avoid a
-   possible multithread problem in the function get_charset_aliases. If we
-   are running in a threaded environment, and if two threads initialize
-   'charset_aliases' simultaneously, both will produce the same value,
-   and everything will be ok if the two assignments to 'charset_aliases'
-   are atomic. But I don't know what will happen if the two assignments mix.  */
-#if __STDC__ != 1
-# define volatile /* empty */
-#endif
-/* Pointer to the contents of the charset.alias file, if it has already been
-   read, else NULL.  Its format is:
-   ALIAS_1 '\0' CANONICAL_1 '\0' ... ALIAS_n '\0' CANONICAL_n '\0' '\0'  */
-static const char * volatile charset_aliases;
-
-/* Return a pointer to the contents of the charset.alias file.  */
-static const char *
-get_charset_aliases (void)
-{
-  const char *cp;
-
-  cp = charset_aliases;
-  if (cp == NULL)
-    {
-#if !(defined DARWIN7 || defined VMS || defined WIN32_NATIVE || defined __CYGWIN__)
-      const char *dir;
-      const char *base = "charset.alias";
-      char *file_name;
-
-      /* Make it possible to override the charset.alias location.  This is
-         necessary for running the testsuite before "make install".  */
-      dir = getenv ("CHARSETALIASDIR");
-      if (dir == NULL || dir[0] == '\0')
-        dir = relocate (LIBDIR);
-
-      /* Concatenate dir and base into freshly allocated file_name.  */
-      {
-        size_t dir_len = strlen (dir);
-        size_t base_len = strlen (base);
-        int add_slash = (dir_len > 0 && !ISSLASH (dir[dir_len - 1]));
-        file_name = (char *) malloc (dir_len + add_slash + base_len + 1);
-        if (file_name != NULL)
-          {
-            memcpy (file_name, dir, dir_len);
-            if (add_slash)
-              file_name[dir_len] = DIRECTORY_SEPARATOR;
-            memcpy (file_name + dir_len + add_slash, base, base_len + 1);
-          }
-      }
-
-      if (file_name == NULL)
-        /* Out of memory.  Treat the file as empty.  */
-        cp = "";
-      else
-        {
-          int fd;
-
-          /* Open the file.  Reject symbolic links on platforms that support
-             O_NOFOLLOW.  This is a security feature.  Without it, an attacker
-             could retrieve parts of the contents (namely, the tail of the
-             first line that starts with "* ") of an arbitrary file by placing
-             a symbolic link to that file under the name "charset.alias" in
-             some writable directory and defining the environment variable
-             CHARSETALIASDIR to point to that directory.  */
-          fd = open (file_name,
-                     O_RDONLY | (HAVE_WORKING_O_NOFOLLOW ? O_NOFOLLOW : 0));
-          if (fd < 0)
-            /* File not found.  Treat it as empty.  */
-            cp = "";
-          else
-            {
-              FILE *fp;
-
-              fp = fdopen (fd, "r");
-              if (fp == NULL)
-                {
-                  /* Out of memory.  Treat the file as empty.  */
-                  close (fd);
-                  cp = "";
-                }
-              else
-                {
-                  /* Parse the file's contents.  */
-                  char *res_ptr = NULL;
-                  size_t res_size = 0;
-
-                  for (;;)
-                    {
-                      int c;
-                      char buf1[50+1];
-                      char buf2[50+1];
-                      size_t l1, l2;
-                      char *old_res_ptr;
-
-                      c = getc (fp);
-                      if (c == EOF)
-                        break;
-                      if (c == '\n' || c == ' ' || c == '\t')
-                        continue;
-                      if (c == '#')
-                        {
-                          /* Skip comment, to end of line.  */
-                          do
-                            c = getc (fp);
-                          while (!(c == EOF || c == '\n'));
-                          if (c == EOF)
-                            break;
-                          continue;
-                        }
-                      ungetc (c, fp);
-                      if (fscanf (fp, "%50s %50s", buf1, buf2) < 2)
-                        break;
-                      l1 = strlen (buf1);
-                      l2 = strlen (buf2);
-                      old_res_ptr = res_ptr;
-                      if (res_size == 0)
-                        {
-                          res_size = l1 + 1 + l2 + 1;
-                          res_ptr = (char *) malloc (res_size + 1);
-                        }
-                      else
-                        {
-                          res_size += l1 + 1 + l2 + 1;
-                          res_ptr = (char *) realloc (res_ptr, res_size + 1);
-                        }
-                      if (res_ptr == NULL)
-                        {
-                          /* Out of memory. */
-                          res_size = 0;
-                          if (old_res_ptr != NULL)
-                            free (old_res_ptr);
-                          break;
-                        }
-                      strcpy (res_ptr + res_size - (l2 + 1) - (l1 + 1), buf1);
-                      strcpy (res_ptr + res_size - (l2 + 1), buf2);
-                    }
-                  fclose (fp);
-                  if (res_size == 0)
-                    cp = "";
-                  else
-                    {
-                      *(res_ptr + res_size) = '\0';
-                      cp = res_ptr;
-                    }
-                }
-            }
-
-          free (file_name);
-        }
-
-#else
-
-# if defined DARWIN7
-      /* To avoid the trouble of installing a file that is shared by many
-         GNU packages -- many packaging systems have problems with this --,
-         simply inline the aliases here.  */
-      cp = "ISO8859-1" "\0" "ISO-8859-1" "\0"
-           "ISO8859-2" "\0" "ISO-8859-2" "\0"
-           "ISO8859-4" "\0" "ISO-8859-4" "\0"
-           "ISO8859-5" "\0" "ISO-8859-5" "\0"
-           "ISO8859-7" "\0" "ISO-8859-7" "\0"
-           "ISO8859-9" "\0" "ISO-8859-9" "\0"
-           "ISO8859-13" "\0" "ISO-8859-13" "\0"
-           "ISO8859-15" "\0" "ISO-8859-15" "\0"
-           "KOI8-R" "\0" "KOI8-R" "\0"
-           "KOI8-U" "\0" "KOI8-U" "\0"
-           "CP866" "\0" "CP866" "\0"
-           "CP949" "\0" "CP949" "\0"
-           "CP1131" "\0" "CP1131" "\0"
-           "CP1251" "\0" "CP1251" "\0"
-           "eucCN" "\0" "GB2312" "\0"
-           "GB2312" "\0" "GB2312" "\0"
-           "eucJP" "\0" "EUC-JP" "\0"
-           "eucKR" "\0" "EUC-KR" "\0"
-           "Big5" "\0" "BIG5" "\0"
-           "Big5HKSCS" "\0" "BIG5-HKSCS" "\0"
-           "GBK" "\0" "GBK" "\0"
-           "GB18030" "\0" "GB18030" "\0"
-           "SJIS" "\0" "SHIFT_JIS" "\0"
-           "ARMSCII-8" "\0" "ARMSCII-8" "\0"
-           "PT154" "\0" "PT154" "\0"
-         /*"ISCII-DEV" "\0" "?" "\0"*/
-           "*" "\0" "UTF-8" "\0";
-# endif
-
-# if defined VMS
-      /* To avoid the troubles of an extra file charset.alias_vms in the
-         sources of many GNU packages, simply inline the aliases here.  */
-      /* The list of encodings is taken from the OpenVMS 7.3-1 documentation
-         "Compaq C Run-Time Library Reference Manual for OpenVMS systems"
-         section 10.7 "Handling Different Character Sets".  */
-      cp = "ISO8859-1" "\0" "ISO-8859-1" "\0"
-           "ISO8859-2" "\0" "ISO-8859-2" "\0"
-           "ISO8859-5" "\0" "ISO-8859-5" "\0"
-           "ISO8859-7" "\0" "ISO-8859-7" "\0"
-           "ISO8859-8" "\0" "ISO-8859-8" "\0"
-           "ISO8859-9" "\0" "ISO-8859-9" "\0"
-           /* Japanese */
-           "eucJP" "\0" "EUC-JP" "\0"
-           "SJIS" "\0" "SHIFT_JIS" "\0"
-           "DECKANJI" "\0" "DEC-KANJI" "\0"
-           "SDECKANJI" "\0" "EUC-JP" "\0"
-           /* Chinese */
-           "eucTW" "\0" "EUC-TW" "\0"
-           "DECHANYU" "\0" "DEC-HANYU" "\0"
-           "DECHANZI" "\0" "GB2312" "\0"
-           /* Korean */
-           "DECKOREAN" "\0" "EUC-KR" "\0";
-# endif
-
-# if defined WIN32_NATIVE || defined __CYGWIN__
-      /* To avoid the troubles of installing a separate file in the same
-         directory as the DLL and of retrieving the DLL's directory at
-         runtime, simply inline the aliases here.  */
-
-      cp = "CP936" "\0" "GBK" "\0"
-           "CP1361" "\0" "JOHAB" "\0"
-           "CP20127" "\0" "ASCII" "\0"
-           "CP20866" "\0" "KOI8-R" "\0"
-           "CP20936" "\0" "GB2312" "\0"
-           "CP21866" "\0" "KOI8-RU" "\0"
-           "CP28591" "\0" "ISO-8859-1" "\0"
-           "CP28592" "\0" "ISO-8859-2" "\0"
-           "CP28593" "\0" "ISO-8859-3" "\0"
-           "CP28594" "\0" "ISO-8859-4" "\0"
-           "CP28595" "\0" "ISO-8859-5" "\0"
-           "CP28596" "\0" "ISO-8859-6" "\0"
-           "CP28597" "\0" "ISO-8859-7" "\0"
-           "CP28598" "\0" "ISO-8859-8" "\0"
-           "CP28599" "\0" "ISO-8859-9" "\0"
-           "CP28605" "\0" "ISO-8859-15" "\0"
-           "CP38598" "\0" "ISO-8859-8" "\0"
-           "CP51932" "\0" "EUC-JP" "\0"
-           "CP51936" "\0" "GB2312" "\0"
-           "CP51949" "\0" "EUC-KR" "\0"
-           "CP51950" "\0" "EUC-TW" "\0"
-           "CP54936" "\0" "GB18030" "\0"
-           "CP65001" "\0" "UTF-8" "\0";
-# endif
-#endif
-
-      charset_aliases = cp;
-    }
-
-  return cp;
-}
-
-/* Determine the current locale's character encoding, and canonicalize it
-   into one of the canonical names listed in config.charset.
-   The result must not be freed; it is statically allocated.
-   If the canonical name cannot be determined, the result is a non-canonical
-   name.  */
-
-#ifdef STATIC
-STATIC
-#endif
-const char *
-locale_charset (void)
-{
-  const char *codeset;
-  const char *aliases;
-
-#if !(defined WIN32_NATIVE || defined OS2)
-
-# if HAVE_LANGINFO_CODESET
-
-  /* Most systems support nl_langinfo (CODESET) nowadays.  */
-  codeset = nl_langinfo (CODESET);
-
-#  ifdef __CYGWIN__
-  /* Cygwin < 1.7 does not have locales.  nl_langinfo (CODESET) always
-     returns "US-ASCII".  Return the suffix of the locale name from the
-     environment variables (if present) or the codepage as a number.  */
-  if (codeset != NULL && strcmp (codeset, "US-ASCII") == 0)
-    {
-      const char *locale;
-      static char buf[2 + 10 + 1];
-
-      locale = getenv ("LC_ALL");
-      if (locale == NULL || locale[0] == '\0')
-        {
-          locale = getenv ("LC_CTYPE");
-          if (locale == NULL || locale[0] == '\0')
-            locale = getenv ("LANG");
-        }
-      if (locale != NULL && locale[0] != '\0')
-        {
-          /* If the locale name contains an encoding after the dot, return
-             it.  */
-          const char *dot = strchr (locale, '.');
-
-          if (dot != NULL)
-            {
-              const char *modifier;
-
-              dot++;
-              /* Look for the possible @... trailer and remove it, if any.  */
-              modifier = strchr (dot, '@');
-              if (modifier == NULL)
-                return dot;
-              if (modifier - dot < sizeof (buf))
-                {
-                  memcpy (buf, dot, modifier - dot);
-                  buf [modifier - dot] = '\0';
-                  return buf;
-                }
-            }
-        }
-
-      /* Woe32 has a function returning the locale's codepage as a number:
-         GetACP().  This encoding is used by Cygwin, unless the user has set
-         the environment variable CYGWIN=codepage:oem (which very few people
-         do).
-         Output directed to console windows needs to be converted (to
-         GetOEMCP() if the console is using a raster font, or to
-         GetConsoleOutputCP() if it is using a TrueType font).  Cygwin does
-         this conversion transparently (see winsup/cygwin/fhandler_console.cc),
-         converting to GetConsoleOutputCP().  This leads to correct results,
-         except when SetConsoleOutputCP has been called and a raster font is
-         in use.  */
-      sprintf (buf, "CP%u", GetACP ());
-      codeset = buf;
-    }
-#  endif
-
-# else
-
-  /* On old systems which lack it, use setlocale or getenv.  */
-  const char *locale = NULL;
-
-  /* But most old systems don't have a complete set of locales.  Some
-     (like SunOS 4 or DJGPP) have only the C locale.  Therefore we don't
-     use setlocale here; it would return "C" when it doesn't support the
-     locale name the user has set.  */
-#  if 0
-  locale = setlocale (LC_CTYPE, NULL);
-#  endif
-  if (locale == NULL || locale[0] == '\0')
-    {
-      locale = getenv ("LC_ALL");
-      if (locale == NULL || locale[0] == '\0')
-        {
-          locale = getenv ("LC_CTYPE");
-          if (locale == NULL || locale[0] == '\0')
-            locale = getenv ("LANG");
-        }
-    }
-
-  /* On some old systems, one used to set locale = "iso8859_1". On others,
-     you set it to "language_COUNTRY.charset". In any case, we resolve it
-     through the charset.alias file.  */
-  codeset = locale;
-
-# endif
-
-#elif defined WIN32_NATIVE
-
-  static char buf[2 + 10 + 1];
-
-  /* Woe32 has a function returning the locale's codepage as a number:
-     GetACP().
-     When the output goes to a console window, it needs to be provided in
-     GetOEMCP() encoding if the console is using a raster font, or in
-     GetConsoleOutputCP() encoding if it is using a TrueType font.
-     But in GUI programs and for output sent to files and pipes, GetACP()
-     encoding is the best bet.  */
-  sprintf (buf, "CP%u", GetACP ());
-  codeset = buf;
-
-#elif defined OS2
-
-  const char *locale;
-  static char buf[2 + 10 + 1];
-  ULONG cp[3];
-  ULONG cplen;
-
-  /* Allow user to override the codeset, as set in the operating system,
-     with standard language environment variables.  */
-  locale = getenv ("LC_ALL");
-  if (locale == NULL || locale[0] == '\0')
-    {
-      locale = getenv ("LC_CTYPE");
-      if (locale == NULL || locale[0] == '\0')
-        locale = getenv ("LANG");
-    }
-  if (locale != NULL && locale[0] != '\0')
-    {
-      /* If the locale name contains an encoding after the dot, return it.  */
-      const char *dot = strchr (locale, '.');
-
-      if (dot != NULL)
-        {
-          const char *modifier;
-
-          dot++;
-          /* Look for the possible @... trailer and remove it, if any.  */
-          modifier = strchr (dot, '@');
-          if (modifier == NULL)
-            return dot;
-          if (modifier - dot < sizeof (buf))
-            {
-              memcpy (buf, dot, modifier - dot);
-              buf [modifier - dot] = '\0';
-              return buf;
-            }
-        }
-
-      /* Resolve through the charset.alias file.  */
-      codeset = locale;
-    }
-  else
-    {
-      /* OS/2 has a function returning the locale's codepage as a number.  */
-      if (DosQueryCp (sizeof (cp), cp, &cplen))
-        codeset = "";
-      else
-        {
-          sprintf (buf, "CP%u", cp[0]);
-          codeset = buf;
-        }
-    }
-
-#endif
-
-  if (codeset == NULL)
-    /* The canonical name cannot be determined.  */
-    codeset = "";
-
-  /* Resolve alias. */
-  for (aliases = get_charset_aliases ();
-       *aliases != '\0';
-       aliases += strlen (aliases) + 1, aliases += strlen (aliases) + 1)
-    if (strcmp (codeset, aliases) == 0
-        || (aliases[0] == '*' && aliases[1] == '\0'))
-      {
-        codeset = aliases + strlen (aliases) + 1;
-        break;
-      }
-
-  /* Don't return an empty string.  GNU libc and GNU libiconv interpret
-     the empty string as denoting "the locale's character encoding",
-     thus GNU libiconv would call this function a second time.  */
-  if (codeset[0] == '\0')
-    codeset = "ASCII";
-
-  return codeset;
-}
diff --git a/lib/localcharset.h b/lib/localcharset.h
deleted file mode 100644 (file)
index c18f492..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/* Determine a canonical name for the current locale's character encoding.
-   Copyright (C) 2000-2003, 2009-2010 Free Software Foundation, Inc.
-   This file is part of the GNU CHARSET Library.
-
-   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, 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.  */
-
-#ifndef _LOCALCHARSET_H
-#define _LOCALCHARSET_H
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/* Determine the current locale's character encoding, and canonicalize it
-   into one of the canonical names listed in config.charset.
-   The result must not be freed; it is statically allocated.
-   If the canonical name cannot be determined, the result is a non-canonical
-   name.  */
-extern const char * locale_charset (void);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#endif /* _LOCALCHARSET_H */
index 9464877..02db8da 100644 (file)
@@ -1,5 +1,5 @@
 /* A POSIX <locale.h>.
 /* A POSIX <locale.h>.
-   Copyright (C) 2007-2010 Free Software Foundation, Inc.
+   Copyright (C) 2007-2011 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
 
    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
 # define LC_MESSAGES 1729
 #endif
 
 # define LC_MESSAGES 1729
 #endif
 
+#if @GNULIB_SETLOCALE@
+# if @REPLACE_SETLOCALE@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef setlocale
+#   define setlocale rpl_setlocale
+#   define GNULIB_defined_setlocale 1
+#  endif
+_GL_FUNCDECL_RPL (setlocale, char *, (int category, const char *locale));
+_GL_CXXALIAS_RPL (setlocale, char *, (int category, const char *locale));
+# else
+_GL_CXXALIAS_SYS (setlocale, char *, (int category, const char *locale));
+# endif
+_GL_CXXALIASWARN (setlocale);
+#elif defined GNULIB_POSIXCHECK
+# undef setlocale
+# if HAVE_RAW_DECL_SETLOCALE
+_GL_WARN_ON_USE (setlocale, "setlocale works differently on native Windows - "
+                 "use gnulib module setlocale for portability");
+# endif
+#endif
+
 #if @GNULIB_DUPLOCALE@
 # if @REPLACE_DUPLOCALE@
 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #if @GNULIB_DUPLOCALE@
 # if @REPLACE_DUPLOCALE@
 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
index a8e95e6..0fc3b2c 100644 (file)
@@ -1,6 +1,6 @@
 /* Work around a bug of lstat on some systems
 
 /* Work around a bug of lstat on some systems
 
-   Copyright (C) 1997-2006, 2008-2010 Free Software Foundation, Inc.
+   Copyright (C) 1997-2006, 2008-2011 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
 
    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
index c8d76c3..6a417c3 100644 (file)
@@ -1,6 +1,6 @@
 /* malloc() function that is glibc compatible.
 
 /* malloc() function that is glibc compatible.
 
-   Copyright (C) 1997-1998, 2006-2007, 2009-2010 Free Software Foundation, Inc.
+   Copyright (C) 1997-1998, 2006-2007, 2009-2011 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
 
    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
index 386a506..b79e7d7 100644 (file)
@@ -1,5 +1,5 @@
 /* Safe automatic memory allocation.
 /* Safe automatic memory allocation.
-   Copyright (C) 2003, 2006-2007, 2009-2010 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2006-2007, 2009-2011 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2003.
 
    This program is free software; you can redistribute it and/or modify
    Written by Bruno Haible <bruno@clisp.org>, 2003.
 
    This program is free software; you can redistribute it and/or modify
index e39d0f4..15e37aa 100644 (file)
@@ -1,5 +1,5 @@
 /* Safe automatic memory allocation.
 /* Safe automatic memory allocation.
-   Copyright (C) 2003-2007, 2009-2010 Free Software Foundation, Inc.
+   Copyright (C) 2003-2007, 2009-2011 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2003.
 
    This program is free software; you can redistribute it and/or modify
    Written by Bruno Haible <bruno@clisp.org>, 2003.
 
    This program is free software; you can redistribute it and/or modify
index b04c9e6..7ff0102 100644 (file)
@@ -1,6 +1,6 @@
 /* A GNU-like <math.h>.
 
 /* A GNU-like <math.h>.
 
-   Copyright (C) 2002-2003, 2007-2010 Free Software Foundation, Inc.
+   Copyright (C) 2002-2003, 2007-2011 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
 
    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
@@ -73,18 +73,21 @@ _GL_WARN_ON_USE (rpl_ ## func ## l, #func " is unportable - "       \
    it on platforms like Solaris 10, where NAN is present but defined
    as a function pointer rather than a floating point constant.  */
 #if !defined NAN || @REPLACE_NAN@
    it on platforms like Solaris 10, where NAN is present but defined
    as a function pointer rather than a floating point constant.  */
 #if !defined NAN || @REPLACE_NAN@
-# undef NAN
+# if !GNULIB_defined_NAN
+#  undef NAN
   /* The Compaq (ex-DEC) C 6.4 compiler chokes on the expression 0.0 / 0.0.  */
   /* The Compaq (ex-DEC) C 6.4 compiler chokes on the expression 0.0 / 0.0.  */
-# ifdef __DECC
+#  ifdef __DECC
 static float
 _NaN ()
 {
   static float zero = 0.0f;
   return zero / zero;
 }
 static float
 _NaN ()
 {
   static float zero = 0.0f;
   return zero / zero;
 }
-#  define NAN (_NaN())
-# else
-#  define NAN (0.0f / 0.0f)
+#   define NAN (_NaN())
+#  else
+#   define NAN (0.0f / 0.0f)
+#  endif
+#  define GNULIB_defined_NAN 1
 # endif
 #endif
 
 # endif
 #endif
 
@@ -202,6 +205,19 @@ _GL_WARN_ON_USE (ceilf, "ceilf is unportable - "
 # endif
 #endif
 
 # endif
 #endif
 
+#if @GNULIB_CEIL@
+# if @REPLACE_CEIL@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define ceil rpl_ceil
+#  endif
+_GL_FUNCDECL_RPL (ceil, double, (double x));
+_GL_CXXALIAS_RPL (ceil, double, (double x));
+# else
+_GL_CXXALIAS_SYS (ceil, double, (double x));
+# endif
+_GL_CXXALIASWARN (ceil);
+#endif
+
 #if @GNULIB_CEILL@
 # if @REPLACE_CEILL@
 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #if @GNULIB_CEILL@
 # if @REPLACE_CEILL@
 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
@@ -262,7 +278,7 @@ _GL_WARN_ON_USE (expl, "expl is unportable - "
 #  endif
 _GL_FUNCDECL_RPL (floorf, float, (float x));
 _GL_CXXALIAS_RPL (floorf, float, (float x));
 #  endif
 _GL_FUNCDECL_RPL (floorf, float, (float x));
 _GL_CXXALIAS_RPL (floorf, float, (float x));
-#else
+# else
 #  if !@HAVE_DECL_FLOORF@
 _GL_FUNCDECL_SYS (floorf, float, (float x));
 #  endif
 #  if !@HAVE_DECL_FLOORF@
 _GL_FUNCDECL_SYS (floorf, float, (float x));
 #  endif
@@ -277,6 +293,19 @@ _GL_WARN_ON_USE (floorf, "floorf is unportable - "
 # endif
 #endif
 
 # endif
 #endif
 
+#if @GNULIB_FLOOR@
+# if @REPLACE_FLOOR@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define floor rpl_floor
+#  endif
+_GL_FUNCDECL_RPL (floor, double, (double x));
+_GL_CXXALIAS_RPL (floor, double, (double x));
+# else
+_GL_CXXALIAS_SYS (floor, double, (double x));
+# endif
+_GL_CXXALIASWARN (floor);
+#endif
+
 #if @GNULIB_FLOORL@
 # if @REPLACE_FLOORL@
 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #if @GNULIB_FLOORL@
 # if @REPLACE_FLOORL@
 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
@@ -493,10 +522,18 @@ _GL_WARN_ON_USE (tanl, "tanl is unportable - "
 
 
 #if @GNULIB_TRUNCF@
 
 
 #if @GNULIB_TRUNCF@
-# if !@HAVE_DECL_TRUNCF@
+# if @REPLACE_TRUNCF@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define truncf rpl_truncf
+#  endif
+_GL_FUNCDECL_RPL (truncf, float, (float x));
+_GL_CXXALIAS_RPL (truncf, float, (float x));
+# else
+#  if !@HAVE_DECL_TRUNCF@
 _GL_FUNCDECL_SYS (truncf, float, (float x));
 _GL_FUNCDECL_SYS (truncf, float, (float x));
-# endif
+#  endif
 _GL_CXXALIAS_SYS (truncf, float, (float x));
 _GL_CXXALIAS_SYS (truncf, float, (float x));
+# endif
 _GL_CXXALIASWARN (truncf);
 #elif defined GNULIB_POSIXCHECK
 # undef truncf
 _GL_CXXALIASWARN (truncf);
 #elif defined GNULIB_POSIXCHECK
 # undef truncf
@@ -507,10 +544,18 @@ _GL_WARN_ON_USE (truncf, "truncf is unportable - "
 #endif
 
 #if @GNULIB_TRUNC@
 #endif
 
 #if @GNULIB_TRUNC@
-# if !@HAVE_DECL_TRUNC@
+# if @REPLACE_TRUNC@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define trunc rpl_trunc
+#  endif
+_GL_FUNCDECL_RPL (trunc, double, (double x));
+_GL_CXXALIAS_RPL (trunc, double, (double x));
+# else
+#  if !@HAVE_DECL_TRUNC@
 _GL_FUNCDECL_SYS (trunc, double, (double x));
 _GL_FUNCDECL_SYS (trunc, double, (double x));
-# endif
+#  endif
 _GL_CXXALIAS_SYS (trunc, double, (double x));
 _GL_CXXALIAS_SYS (trunc, double, (double x));
+# endif
 _GL_CXXALIASWARN (trunc);
 #elif defined GNULIB_POSIXCHECK
 # undef trunc
 _GL_CXXALIASWARN (trunc);
 #elif defined GNULIB_POSIXCHECK
 # undef trunc
@@ -657,7 +702,7 @@ _GL_EXTERN_C int isnanl (long double x);
    that recursively expand back to isnan.  So use the gnulib
    replacements for them directly. */
 #  if @HAVE_ISNANF@ && __GNUC__ >= 4
    that recursively expand back to isnan.  So use the gnulib
    replacements for them directly. */
 #  if @HAVE_ISNANF@ && __GNUC__ >= 4
-#   define gl_isnan_f(x) __builtin_isnan ((float)(x))
+#   define gl_isnan_f(x) __builtin_isnanf ((float)(x))
 #  else
 _GL_EXTERN_C int rpl_isnanf (float x);
 #   define gl_isnan_f(x) rpl_isnanf (x)
 #  else
 _GL_EXTERN_C int rpl_isnanf (float x);
 #   define gl_isnan_f(x) rpl_isnanf (x)
@@ -669,7 +714,7 @@ _GL_EXTERN_C int rpl_isnand (double x);
 #   define gl_isnan_d(x) rpl_isnand (x)
 #  endif
 #  if @HAVE_ISNANL@ && __GNUC__ >= 4
 #   define gl_isnan_d(x) rpl_isnand (x)
 #  endif
 #  if @HAVE_ISNANL@ && __GNUC__ >= 4
-#   define gl_isnan_l(x) __builtin_isnan ((long double)(x))
+#   define gl_isnan_l(x) __builtin_isnanl ((long double)(x))
 #  else
 _GL_EXTERN_C int rpl_isnanl (long double x);
 #   define gl_isnan_l(x) rpl_isnanl (x)
 #  else
 _GL_EXTERN_C int rpl_isnanl (long double x);
 #   define gl_isnan_l(x) rpl_isnanl (x)
@@ -679,6 +724,12 @@ _GL_EXTERN_C int rpl_isnanl (long double x);
    (sizeof (x) == sizeof (long double) ? gl_isnan_l (x) : \
     sizeof (x) == sizeof (double) ? gl_isnan_d (x) : \
     gl_isnan_f (x))
    (sizeof (x) == sizeof (long double) ? gl_isnan_l (x) : \
     sizeof (x) == sizeof (double) ? gl_isnan_d (x) : \
     gl_isnan_f (x))
+# elif __GNUC__ >= 4
+#  undef isnan
+#  define isnan(x) \
+   (sizeof (x) == sizeof (long double) ? __builtin_isnanl ((long double)(x)) : \
+    sizeof (x) == sizeof (double) ? __builtin_isnan ((double)(x)) : \
+    __builtin_isnanf ((float)(x)))
 # endif
 /* Ensure isnan is a macro.  */
 # ifndef isnan
 # endif
 /* Ensure isnan is a macro.  */
 # ifndef isnan
diff --git a/lib/mbrtowc.c b/lib/mbrtowc.c
deleted file mode 100644 (file)
index 85f251c..0000000
+++ /dev/null
@@ -1,386 +0,0 @@
-/* Convert multibyte character to wide character.
-   Copyright (C) 1999-2002, 2005-2010 Free Software Foundation, Inc.
-   Written by Bruno Haible <bruno@clisp.org>, 2008.
-
-   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 3 of the License, 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, see <http://www.gnu.org/licenses/>.  */
-
-#include <config.h>
-
-/* Specification.  */
-#include <wchar.h>
-
-#if GNULIB_defined_mbstate_t
-/* Implement mbrtowc() on top of mbtowc().  */
-
-# include <errno.h>
-# include <stdlib.h>
-
-# include "localcharset.h"
-# include "streq.h"
-# include "verify.h"
-
-
-verify (sizeof (mbstate_t) >= 4);
-
-static char internal_state[4];
-
-size_t
-mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps)
-{
-  char *pstate = (char *)ps;
-
-  if (pstate == NULL)
-    pstate = internal_state;
-
-  if (s == NULL)
-    {
-      pwc = NULL;
-      s = "";
-      n = 1;
-    }
-
-  if (n == 0)
-    return (size_t)(-2);
-
-  /* Here n > 0.  */
-  {
-    size_t nstate = pstate[0];
-    char buf[4];
-    const char *p;
-    size_t m;
-
-    switch (nstate)
-      {
-      case 0:
-        p = s;
-        m = n;
-        break;
-      case 3:
-        buf[2] = pstate[3];
-        /*FALLTHROUGH*/
-      case 2:
-        buf[1] = pstate[2];
-        /*FALLTHROUGH*/
-      case 1:
-        buf[0] = pstate[1];
-        p = buf;
-        m = nstate;
-        buf[m++] = s[0];
-        if (n >= 2 && m < 4)
-          {
-            buf[m++] = s[1];
-            if (n >= 3 && m < 4)
-              buf[m++] = s[2];
-          }
-        break;
-      default:
-        errno = EINVAL;
-        return (size_t)(-1);
-      }
-
-    /* Here m > 0.  */
-
-# if __GLIBC__ || defined __UCLIBC__
-    /* Work around bug <http://sourceware.org/bugzilla/show_bug.cgi?id=9674> */
-    mbtowc (NULL, NULL, 0);
-# endif
-    {
-      int res = mbtowc (pwc, p, m);
-
-      if (res >= 0)
-        {
-          if (pwc != NULL && ((*pwc == 0) != (res == 0)))
-            abort ();
-          if (nstate >= (res > 0 ? res : 1))
-            abort ();
-          res -= nstate;
-          pstate[0] = 0;
-          return res;
-        }
-
-      /* mbtowc does not distinguish between invalid and incomplete multibyte
-         sequences.  But mbrtowc needs to make this distinction.
-         There are two possible approaches:
-           - Use iconv() and its return value.
-           - Use built-in knowledge about the possible encodings.
-         Given the low quality of implementation of iconv() on the systems that
-         lack mbrtowc(), we use the second approach.
-         The possible encodings are:
-           - 8-bit encodings,
-           - EUC-JP, EUC-KR, GB2312, EUC-TW, BIG5, GB18030, SJIS,
-           - UTF-8.
-         Use specialized code for each.  */
-      if (m >= 4 || m >= MB_CUR_MAX)
-        goto invalid;
-      /* Here MB_CUR_MAX > 1 and 0 < m < 4.  */
-      {
-        const char *encoding = locale_charset ();
-
-        if (STREQ (encoding, "UTF-8", 'U', 'T', 'F', '-', '8', 0, 0, 0, 0))
-          {
-            /* Cf. unistr/u8-mblen.c.  */
-            unsigned char c = (unsigned char) p[0];
-
-            if (c >= 0xc2)
-              {
-                if (c < 0xe0)
-                  {
-                    if (m == 1)
-                      goto incomplete;
-                  }
-                else if (c < 0xf0)
-                  {
-                    if (m == 1)
-                      goto incomplete;
-                    if (m == 2)
-                      {
-                        unsigned char c2 = (unsigned char) p[1];
-
-                        if ((c2 ^ 0x80) < 0x40
-                            && (c >= 0xe1 || c2 >= 0xa0)
-                            && (c != 0xed || c2 < 0xa0))
-                          goto incomplete;
-                      }
-                  }
-                else if (c <= 0xf4)
-                  {
-                    if (m == 1)
-                      goto incomplete;
-                    else /* m == 2 || m == 3 */
-                      {
-                        unsigned char c2 = (unsigned char) p[1];
-
-                        if ((c2 ^ 0x80) < 0x40
-                            && (c >= 0xf1 || c2 >= 0x90)
-                            && (c < 0xf4 || (c == 0xf4 && c2 < 0x90)))
-                          {
-                            if (m == 2)
-                              goto incomplete;
-                            else /* m == 3 */
-                              {
-                                unsigned char c3 = (unsigned char) p[2];
-
-                                if ((c3 ^ 0x80) < 0x40)
-                                  goto incomplete;
-                              }
-                          }
-                      }
-                  }
-              }
-            goto invalid;
-          }
-
-        /* As a reference for this code, you can use the GNU libiconv
-           implementation.  Look for uses of the RET_TOOFEW macro.  */
-
-        if (STREQ (encoding, "EUC-JP", 'E', 'U', 'C', '-', 'J', 'P', 0, 0, 0))
-          {
-            if (m == 1)
-              {
-                unsigned char c = (unsigned char) p[0];
-
-                if ((c >= 0xa1 && c < 0xff) || c == 0x8e || c == 0x8f)
-                  goto incomplete;
-              }
-            if (m == 2)
-              {
-                unsigned char c = (unsigned char) p[0];
-
-                if (c == 0x8f)
-                  {
-                    unsigned char c2 = (unsigned char) p[1];
-
-                    if (c2 >= 0xa1 && c2 < 0xff)
-                      goto incomplete;
-                  }
-              }
-            goto invalid;
-          }
-        if (STREQ (encoding, "EUC-KR", 'E', 'U', 'C', '-', 'K', 'R', 0, 0, 0)
-            || STREQ (encoding, "GB2312", 'G', 'B', '2', '3', '1', '2', 0, 0, 0)
-            || STREQ (encoding, "BIG5", 'B', 'I', 'G', '5', 0, 0, 0, 0, 0))
-          {
-            if (m == 1)
-              {
-                unsigned char c = (unsigned char) p[0];
-
-                if (c >= 0xa1 && c < 0xff)
-                  goto incomplete;
-              }
-            goto invalid;
-          }
-        if (STREQ (encoding, "EUC-TW", 'E', 'U', 'C', '-', 'T', 'W', 0, 0, 0))
-          {
-            if (m == 1)
-              {
-                unsigned char c = (unsigned char) p[0];
-
-                if ((c >= 0xa1 && c < 0xff) || c == 0x8e)
-                  goto incomplete;
-              }
-            else /* m == 2 || m == 3 */
-              {
-                unsigned char c = (unsigned char) p[0];
-
-                if (c == 0x8e)
-                  goto incomplete;
-              }
-            goto invalid;
-          }
-        if (STREQ (encoding, "GB18030", 'G', 'B', '1', '8', '0', '3', '0', 0, 0))
-          {
-            if (m == 1)
-              {
-                unsigned char c = (unsigned char) p[0];
-
-                if ((c >= 0x90 && c <= 0xe3) || (c >= 0xf8 && c <= 0xfe))
-                  goto incomplete;
-              }
-            else /* m == 2 || m == 3 */
-              {
-                unsigned char c = (unsigned char) p[0];
-
-                if (c >= 0x90 && c <= 0xe3)
-                  {
-                    unsigned char c2 = (unsigned char) p[1];
-
-                    if (c2 >= 0x30 && c2 <= 0x39)
-                      {
-                        if (m == 2)
-                          goto incomplete;
-                        else /* m == 3 */
-                          {
-                            unsigned char c3 = (unsigned char) p[2];
-
-                            if (c3 >= 0x81 && c3 <= 0xfe)
-                              goto incomplete;
-                          }
-                      }
-                  }
-              }
-            goto invalid;
-          }
-        if (STREQ (encoding, "SJIS", 'S', 'J', 'I', 'S', 0, 0, 0, 0, 0))
-          {
-            if (m == 1)
-              {
-                unsigned char c = (unsigned char) p[0];
-
-                if ((c >= 0x81 && c <= 0x9f) || (c >= 0xe0 && c <= 0xea)
-                    || (c >= 0xf0 && c <= 0xf9))
-                  goto incomplete;
-              }
-            goto invalid;
-          }
-
-        /* An unknown multibyte encoding.  */
-        goto incomplete;
-      }
-
-     incomplete:
-      {
-        size_t k = nstate;
-        /* Here 0 <= k < m < 4.  */
-        pstate[++k] = s[0];
-        if (k < m)
-          {
-            pstate[++k] = s[1];
-            if (k < m)
-              pstate[++k] = s[2];
-          }
-        if (k != m)
-          abort ();
-      }
-      pstate[0] = m;
-      return (size_t)(-2);
-
-     invalid:
-      errno = EILSEQ;
-      /* The conversion state is undefined, says POSIX.  */
-      return (size_t)(-1);
-    }
-  }
-}
-
-#else
-/* Override the system's mbrtowc() function.  */
-
-# undef mbrtowc
-
-size_t
-rpl_mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps)
-{
-# if MBRTOWC_NULL_ARG_BUG || MBRTOWC_RETVAL_BUG
-  if (s == NULL)
-    {
-      pwc = NULL;
-      s = "";
-      n = 1;
-    }
-# endif
-
-# if MBRTOWC_RETVAL_BUG
-  {
-    static mbstate_t internal_state;
-
-    /* Override mbrtowc's internal state.  We can not call mbsinit() on the
-       hidden internal state, but we can call it on our variable.  */
-    if (ps == NULL)
-      ps = &internal_state;
-
-    if (!mbsinit (ps))
-      {
-        /* Parse the rest of the multibyte character byte for byte.  */
-        size_t count = 0;
-        for (; n > 0; s++, n--)
-          {
-            wchar_t wc;
-            size_t ret = mbrtowc (&wc, s, 1, ps);
-
-            if (ret == (size_t)(-1))
-              return (size_t)(-1);
-            count++;
-            if (ret != (size_t)(-2))
-              {
-                /* The multibyte character has been completed.  */
-                if (pwc != NULL)
-                  *pwc = wc;
-                return (wc == 0 ? 0 : count);
-              }
-          }
-        return (size_t)(-2);
-      }
-  }
-# endif
-
-# if MBRTOWC_NUL_RETVAL_BUG
-  {
-    wchar_t wc;
-    size_t ret = mbrtowc (&wc, s, n, ps);
-
-    if (ret != (size_t)(-1) && ret != (size_t)(-2))
-      {
-        if (pwc != NULL)
-          *pwc = wc;
-        if (wc == 0)
-          ret = 0;
-      }
-    return ret;
-  }
-# else
-  return mbrtowc (pwc, s, n, ps);
-# endif
-}
-
-#endif
diff --git a/lib/mbsinit.c b/lib/mbsinit.c
deleted file mode 100644 (file)
index 811e39b..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-/* Test for initial conversion state.
-   Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
-   Written by Bruno Haible <bruno@clisp.org>, 2008.
-
-   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 3 of the License, 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, see <http://www.gnu.org/licenses/>.  */
-
-#include <config.h>
-
-/* Specification.  */
-#include <wchar.h>
-
-#include "verify.h"
-
-/* Platforms that lack mbsinit() also lack mbrlen(), mbrtowc(), mbsrtowcs()
-   and wcrtomb(), wcsrtombs().
-   We assume that
-     - sizeof (mbstate_t) >= 4,
-     - only stateless encodings are supported (such as UTF-8 and EUC-JP, but
-       not ISO-2022 variants),
-     - for each encoding, the number of bytes for a wide character is <= 4.
-       (This maximum is attained for UTF-8, GB18030, EUC-TW.)
-   We define the meaning of mbstate_t as follows:
-     - In mb -> wc direction, mbstate_t's first byte contains the number of
-       buffered bytes (in the range 0..3), followed by up to 3 buffered bytes.
-     - In wc -> mb direction, mbstate_t contains no information. In other
-       words, it is always in the initial state.  */
-
-verify (sizeof (mbstate_t) >= 4);
-
-int
-mbsinit (const mbstate_t *ps)
-{
-  const char *pstate = (const char *)ps;
-
-  return pstate[0] == 0;
-}
index 1e897cd..16546e4 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1993, 1996-1997, 1999-2000, 2003-2004, 2006, 2008-2010
+/* Copyright (C) 1991, 1993, 1996-1997, 1999-2000, 2003-2004, 2006, 2008-2011
    Free Software Foundation, Inc.
 
    Based on strlen implementation by Torbjorn Granlund (tege@sics.se),
    Free Software Foundation, Inc.
 
    Based on strlen implementation by Torbjorn Granlund (tege@sics.se),
index 6f761f1..21e3d55 100644 (file)
@@ -1,5 +1,5 @@
 /* Provide a netdb.h header file for systems lacking it (read: MinGW).
 /* Provide a netdb.h header file for systems lacking it (read: MinGW).
-   Copyright (C) 2008-2010 Free Software Foundation, Inc.
+   Copyright (C) 2008-2011 Free Software Foundation, Inc.
    Written by Simon Josefsson.
 
    This program is free software; you can redistribute it and/or modify
    Written by Simon Josefsson.
 
    This program is free software; you can redistribute it and/or modify
@@ -51,6 +51,7 @@
 
 # if !@HAVE_STRUCT_ADDRINFO@
 
 
 # if !@HAVE_STRUCT_ADDRINFO@
 
+#  if !GNULIB_defined_struct_addrinfo
 /* Structure to contain information about address of a service provider.  */
 struct addrinfo
 {
 /* Structure to contain information about address of a service provider.  */
 struct addrinfo
 {
@@ -63,6 +64,8 @@ struct addrinfo
   char *ai_canonname;           /* Canonical name for service location.  */
   struct addrinfo *ai_next;     /* Pointer to next in list.  */
 };
   char *ai_canonname;           /* Canonical name for service location.  */
   struct addrinfo *ai_next;     /* Pointer to next in list.  */
 };
+#   define GNULIB_defined_struct_addrinfo 1
+#  endif
 # endif
 
 /* Possible values for `ai_flags' field in `addrinfo' structure.  */
 # endif
 
 /* Possible values for `ai_flags' field in `addrinfo' structure.  */
index e9af2a9..11c587a 100644 (file)
@@ -1,5 +1,5 @@
 /* Substitute for <netinet/in.h>.
 /* Substitute for <netinet/in.h>.
-   Copyright (C) 2007-2010 Free Software Foundation, Inc.
+   Copyright (C) 2007-2011 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
 
    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
index e4cdb3a..a1e13e2 100644 (file)
@@ -1,6 +1,6 @@
 /* Detect the number of processors.
 
 /* Detect the number of processors.
 
-   Copyright (C) 2009-2010 Free Software Foundation, Inc.
+   Copyright (C) 2009-2011 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
 
    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
index 56af19e..8dbb02f 100644 (file)
@@ -1,6 +1,6 @@
 /* Detect the number of processors.
 
 /* Detect the number of processors.
 
-   Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+   Copyright (C) 2009-2011 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
 
    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
index c53aa9d..8056fef 100644 (file)
@@ -1,5 +1,5 @@
 /* Define PATH_MAX somehow.  Requires sys/types.h.
 /* Define PATH_MAX somehow.  Requires sys/types.h.
-   Copyright (C) 1992, 1999, 2001, 2003, 2005, 2009-2010 Free Software
+   Copyright (C) 1992, 1999, 2001, 2003, 2005, 2009-2011 Free Software
    Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
index 597bba9..68e52fd 100644 (file)
@@ -1,5 +1,5 @@
 /* Decomposed printf argument list.
 /* Decomposed printf argument list.
-   Copyright (C) 1999, 2002-2003, 2005-2007, 2009-2010 Free Software
+   Copyright (C) 1999, 2002-2003, 2005-2007, 2009-2011 Free Software
    Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
index d76352d..998e95d 100644 (file)
@@ -1,5 +1,5 @@
 /* Decomposed printf argument list.
 /* Decomposed printf argument list.
-   Copyright (C) 1999, 2002-2003, 2006-2007, 2009-2010 Free Software
+   Copyright (C) 1999, 2002-2003, 2006-2007, 2011 Free Software
    Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
@@ -136,10 +136,14 @@ typedef struct
 }
 argument;
 
 }
 argument;
 
+/* Number of directly allocated arguments (no malloc() needed).  */
+#define N_DIRECT_ALLOC_ARGUMENTS 7
+
 typedef struct
 {
   size_t count;
   argument *arg;
 typedef struct
 {
   size_t count;
   argument *arg;
+  argument direct_alloc_arg[N_DIRECT_ALLOC_ARGUMENTS];
 }
 arguments;
 
 }
 arguments;
 
index 8c68fda..0143861 100644 (file)
@@ -1,5 +1,5 @@
 /* Formatted output to strings.
 /* Formatted output to strings.
-   Copyright (C) 1999-2000, 2002-2003, 2006-2010 Free Software Foundation, Inc.
+   Copyright (C) 1999-2000, 2002-2003, 2006-2011 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
 
    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
@@ -63,6 +63,9 @@
 /* malloc(), realloc(), free().  */
 #include <stdlib.h>
 
 /* malloc(), realloc(), free().  */
 #include <stdlib.h>
 
+/* memcpy().  */
+#include <string.h>
+
 /* errno.  */
 #include <errno.h>
 
 /* errno.  */
 #include <errno.h>
 
@@ -80,23 +83,20 @@ STATIC
 int
 PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a)
 {
 int
 PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a)
 {
-  const CHAR_T *cp = format;            /* pointer into format */
+  const CHAR_T *cp = format;    /* pointer into format */
   size_t arg_posn = 0;          /* number of regular arguments consumed */
   size_t arg_posn = 0;          /* number of regular arguments consumed */
-  size_t d_allocated;                   /* allocated elements of d->dir */
-  size_t a_allocated;                   /* allocated elements of a->arg */
+  size_t d_allocated;           /* allocated elements of d->dir */
+  size_t a_allocated;           /* allocated elements of a->arg */
   size_t max_width_length = 0;
   size_t max_precision_length = 0;
 
   d->count = 0;
   size_t max_width_length = 0;
   size_t max_precision_length = 0;
 
   d->count = 0;
-  d_allocated = 1;
-  d->dir = (DIRECTIVE *) malloc (d_allocated * sizeof (DIRECTIVE));
-  if (d->dir == NULL)
-    /* Out of memory.  */
-    goto out_of_memory_1;
+  d_allocated = N_DIRECT_ALLOC_DIRECTIVES;
+  d->dir = d->direct_alloc_dir;
 
   a->count = 0;
 
   a->count = 0;
-  a_allocated = 0;
-  a->arg = NULL;
+  a_allocated = N_DIRECT_ALLOC_ARGUMENTS;
+  a->arg = a->direct_alloc_arg;
 
 #define REGISTER_ARG(_index_,_type_) \
   {                                                                     \
 
 #define REGISTER_ARG(_index_,_type_) \
   {                                                                     \
@@ -113,12 +113,14 @@ PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a)
         if (size_overflow_p (memory_size))                              \
           /* Overflow, would lead to out of memory.  */                 \
           goto out_of_memory;                                           \
         if (size_overflow_p (memory_size))                              \
           /* Overflow, would lead to out of memory.  */                 \
           goto out_of_memory;                                           \
-        memory = (argument *) (a->arg                                   \
+        memory = (argument *) (a->arg != a->direct_alloc_arg            \
                                ? realloc (a->arg, memory_size)          \
                                : malloc (memory_size));                 \
         if (memory == NULL)                                             \
           /* Out of memory.  */                                         \
           goto out_of_memory;                                           \
                                ? realloc (a->arg, memory_size)          \
                                : malloc (memory_size));                 \
         if (memory == NULL)                                             \
           /* Out of memory.  */                                         \
           goto out_of_memory;                                           \
+        if (a->arg == a->direct_alloc_arg)                              \
+          memcpy (memory, a->arg, a->count * sizeof (argument));        \
         a->arg = memory;                                                \
       }                                                                 \
     while (a->count <= n)                                               \
         a->arg = memory;                                                \
       }                                                                 \
     while (a->count <= n)                                               \
@@ -588,10 +590,14 @@ PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a)
               if (size_overflow_p (memory_size))
                 /* Overflow, would lead to out of memory.  */
                 goto out_of_memory;
               if (size_overflow_p (memory_size))
                 /* Overflow, would lead to out of memory.  */
                 goto out_of_memory;
-              memory = (DIRECTIVE *) realloc (d->dir, memory_size);
+              memory = (DIRECTIVE *) (d->dir != d->direct_alloc_dir
+                                      ? realloc (d->dir, memory_size)
+                                      : malloc (memory_size));
               if (memory == NULL)
                 /* Out of memory.  */
                 goto out_of_memory;
               if (memory == NULL)
                 /* Out of memory.  */
                 goto out_of_memory;
+              if (d->dir == d->direct_alloc_dir)
+                memcpy (memory, d->dir, d->count * sizeof (DIRECTIVE));
               d->dir = memory;
             }
         }
               d->dir = memory;
             }
         }
@@ -610,19 +616,18 @@ PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a)
   return 0;
 
 error:
   return 0;
 
 error:
-  if (a->arg)
+  if (a->arg != a->direct_alloc_arg)
     free (a->arg);
     free (a->arg);
-  if (d->dir)
+  if (d->dir != d->direct_alloc_dir)
     free (d->dir);
   errno = EINVAL;
   return -1;
 
 out_of_memory:
     free (d->dir);
   errno = EINVAL;
   return -1;
 
 out_of_memory:
-  if (a->arg)
+  if (a->arg != a->direct_alloc_arg)
     free (a->arg);
     free (a->arg);
-  if (d->dir)
+  if (d->dir != d->direct_alloc_dir)
     free (d->dir);
     free (d->dir);
-out_of_memory_1:
   errno = ENOMEM;
   return -1;
 }
   errno = ENOMEM;
   return -1;
 }
index 777bf4d..281f0d9 100644 (file)
@@ -1,5 +1,5 @@
 /* Parse printf format string.
 /* Parse printf format string.
-   Copyright (C) 1999, 2002-2003, 2005, 2007, 2009-2010 Free Software
+   Copyright (C) 1999, 2002-2003, 2005, 2007, 2010-2011 Free Software
    Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
@@ -47,6 +47,9 @@
 /* xxx_directive: A parsed directive.
    xxx_directives: A parsed format string.  */
 
 /* xxx_directive: A parsed directive.
    xxx_directives: A parsed format string.  */
 
+/* Number of directly allocated directives (no malloc() needed).  */
+#define N_DIRECT_ALLOC_DIRECTIVES 7
+
 /* A parsed directive.  */
 typedef struct
 {
 /* A parsed directive.  */
 typedef struct
 {
@@ -71,6 +74,7 @@ typedef struct
   char_directive *dir;
   size_t max_width_length;
   size_t max_precision_length;
   char_directive *dir;
   size_t max_width_length;
   size_t max_precision_length;
+  char_directive direct_alloc_dir[N_DIRECT_ALLOC_DIRECTIVES];
 }
 char_directives;
 
 }
 char_directives;
 
@@ -100,6 +104,7 @@ typedef struct
   u8_directive *dir;
   size_t max_width_length;
   size_t max_precision_length;
   u8_directive *dir;
   size_t max_width_length;
   size_t max_precision_length;
+  u8_directive direct_alloc_dir[N_DIRECT_ALLOC_DIRECTIVES];
 }
 u8_directives;
 
 }
 u8_directives;
 
@@ -127,6 +132,7 @@ typedef struct
   u16_directive *dir;
   size_t max_width_length;
   size_t max_precision_length;
   u16_directive *dir;
   size_t max_width_length;
   size_t max_precision_length;
+  u16_directive direct_alloc_dir[N_DIRECT_ALLOC_DIRECTIVES];
 }
 u16_directives;
 
 }
 u16_directives;
 
@@ -154,6 +160,7 @@ typedef struct
   u32_directive *dir;
   size_t max_width_length;
   size_t max_precision_length;
   u32_directive *dir;
   size_t max_width_length;
   size_t max_precision_length;
+  u32_directive direct_alloc_dir[N_DIRECT_ALLOC_DIRECTIVES];
 }
 u32_directives;
 
 }
 u32_directives;
 
index 36c5123..0e6e65f 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1994, 1997-1998, 2000, 2003-2010 Free Software
+/* Copyright (C) 1991, 1994, 1997-1998, 2000, 2003-2011 Free Software
    Foundation, Inc.
 
    NOTE: The canonical source of this file is maintained with the GNU C
    Foundation, Inc.
 
    NOTE: The canonical source of this file is maintained with the GNU C
index 7d326b4..8a6cbc6 100644 (file)
@@ -1,5 +1,5 @@
 /* Stub for readlink().
 /* Stub for readlink().
-   Copyright (C) 2003-2007, 2009-2010 Free Software Foundation, Inc.
+   Copyright (C) 2003-2007, 2009-2011 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
 
    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
diff --git a/lib/recv.c b/lib/recv.c
new file mode 100644 (file)
index 0000000..b648fc4
--- /dev/null
@@ -0,0 +1,40 @@
+/* recv.c --- wrappers for Windows recv function
+
+   Copyright (C) 2008-2011 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 3 of the License, 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, see <http://www.gnu.org/licenses/>.  */
+
+/* Written by Paolo Bonzini */
+
+#include <config.h>
+
+#define WIN32_LEAN_AND_MEAN
+/* Get winsock2.h. */
+#include <sys/socket.h>
+
+/* Get set_winsock_errno, FD_TO_SOCKET etc. */
+#include "w32sock.h"
+
+#undef recv
+
+ssize_t
+rpl_recv (int fd, void *buf, size_t len, int flags)
+{
+  SOCKET sock = FD_TO_SOCKET (fd);
+  int r = recv (sock, buf, len, flags);
+  if (r < 0)
+    set_winsock_errno ();
+
+  return r;
+}
diff --git a/lib/recvfrom.c b/lib/recvfrom.c
new file mode 100644 (file)
index 0000000..068f5a5
--- /dev/null
@@ -0,0 +1,48 @@
+/* recvfrom.c --- wrappers for Windows recvfrom function
+
+   Copyright (C) 2008-2011 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 3 of the License, 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, see <http://www.gnu.org/licenses/>.  */
+
+/* Written by Paolo Bonzini */
+
+#include <config.h>
+
+#define WIN32_LEAN_AND_MEAN
+/* Get winsock2.h. */
+#include <sys/socket.h>
+
+/* Get set_winsock_errno, FD_TO_SOCKET etc. */
+#include "w32sock.h"
+
+#undef recvfrom
+
+ssize_t
+rpl_recvfrom (int fd, void *buf, size_t len, int flags, struct sockaddr *from,
+              socklen_t *fromlen)
+{
+  int frombufsize = (from != NULL ? *fromlen : 0);
+  SOCKET sock = FD_TO_SOCKET (fd);
+  int r = recvfrom (sock, buf, len, flags, from, fromlen);
+
+  if (r < 0)
+    set_winsock_errno ();
+
+  /* Winsock recvfrom() only returns a valid 'from' when the socket is
+     connectionless.  POSIX gives a valid 'from' for all types of sockets.  */
+  else if (from != NULL && *fromlen == frombufsize)
+    rpl_getpeername (fd, from, fromlen);
+
+  return r;
+}
diff --git a/lib/ref-add.sin b/lib/ref-add.sin
deleted file mode 100644 (file)
index cb482d7..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-# Add this package to a list of references stored in a text file.
-#
-#   Copyright (C) 2000, 2009, 2010 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, 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.
-#
-# Written by Bruno Haible <haible@clisp.cons.org>.
-#
-/^# Packages using this file: / {
-  s/# Packages using this file://
-  ta
-  :a
-  s/ @PACKAGE@ / @PACKAGE@ /
-  tb
-  s/ $/ @PACKAGE@ /
-  :b
-  s/^/# Packages using this file:/
-}
diff --git a/lib/ref-del.sin b/lib/ref-del.sin
deleted file mode 100644 (file)
index 74f8e1c..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-# Remove this package from a list of references stored in a text file.
-#
-#   Copyright (C) 2000, 2009, 2010 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, 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.
-#
-# Written by Bruno Haible <haible@clisp.cons.org>.
-#
-/^# Packages using this file: / {
-  s/# Packages using this file://
-  s/ @PACKAGE@ / /
-  s/^/# Packages using this file:/
-}
index 1a24096..a7cef32 100644 (file)
@@ -1,6 +1,6 @@
 /* An interface to read and write that retries after interrupts.
 
 /* An interface to read and write that retries after interrupts.
 
-   Copyright (C) 1993-1994, 1998, 2002-2006, 2009-2010 Free Software
+   Copyright (C) 1993-1994, 1998, 2002-2006, 2009-2011 Free Software
    Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
index 21c860b..5d65b51 100644 (file)
@@ -1,5 +1,5 @@
 /* An interface to read() that retries after interrupts.
 /* An interface to read() that retries after interrupts.
-   Copyright (C) 2002, 2006, 2009-2010 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2006, 2009-2011 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
 
    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
index 6e8c8d7..dce3277 100644 (file)
@@ -1,5 +1,5 @@
 /* An interface to write that retries after interrupts.
 /* An interface to write that retries after interrupts.
-   Copyright (C) 2002, 2009-2010 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2009-2011 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
 
    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
index 5c24996..556fe29 100644 (file)
@@ -1,5 +1,5 @@
 /* An interface to write() that retries after interrupts.
 /* An interface to write() that retries after interrupts.
-   Copyright (C) 2002, 2009-2010 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2009-2011 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
 
    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
diff --git a/lib/send.c b/lib/send.c
new file mode 100644 (file)
index 0000000..2a4d20d
--- /dev/null
@@ -0,0 +1,40 @@
+/* send.c --- wrappers for Windows send function
+
+   Copyright (C) 2008-2011 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 3 of the License, 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, see <http://www.gnu.org/licenses/>.  */
+
+/* Written by Paolo Bonzini */
+
+#include <config.h>
+
+#define WIN32_LEAN_AND_MEAN
+/* Get winsock2.h. */
+#include <sys/socket.h>
+
+/* Get set_winsock_errno, FD_TO_SOCKET etc. */
+#include "w32sock.h"
+
+#undef send
+
+ssize_t
+rpl_send (int fd, const void *buf, size_t len, int flags)
+{
+  SOCKET sock = FD_TO_SOCKET (fd);
+  int r = send (sock, buf, len, flags);
+  if (r < 0)
+    set_winsock_errno ();
+
+  return r;
+}
diff --git a/lib/sendto.c b/lib/sendto.c
new file mode 100644 (file)
index 0000000..fb22313
--- /dev/null
@@ -0,0 +1,41 @@
+/* sendto.c --- wrappers for Windows sendto function
+
+   Copyright (C) 2008-2011 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 3 of the License, 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, see <http://www.gnu.org/licenses/>.  */
+
+/* Written by Paolo Bonzini */
+
+#include <config.h>
+
+#define WIN32_LEAN_AND_MEAN
+/* Get winsock2.h. */
+#include <sys/socket.h>
+
+/* Get set_winsock_errno, FD_TO_SOCKET etc. */
+#include "w32sock.h"
+
+#undef sendto
+
+ssize_t
+rpl_sendto (int fd, const void *buf, size_t len, int flags,
+            const struct sockaddr *to, socklen_t tolen)
+{
+  SOCKET sock = FD_TO_SOCKET (fd);
+  int r = sendto (sock, buf, len, flags, to, tolen);
+  if (r < 0)
+    set_winsock_errno ();
+
+  return r;
+}
diff --git a/lib/setsockopt.c b/lib/setsockopt.c
new file mode 100644 (file)
index 0000000..5623ca3
--- /dev/null
@@ -0,0 +1,56 @@
+/* setsockopt.c --- wrappers for Windows setsockopt function
+
+   Copyright (C) 2008-2011 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 3 of the License, 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, see <http://www.gnu.org/licenses/>.  */
+
+/* Written by Paolo Bonzini */
+
+#include <config.h>
+
+#define WIN32_LEAN_AND_MEAN
+/* Get winsock2.h. */
+#include <sys/socket.h>
+
+/* Get struct timeval. */
+#include <sys/time.h>
+
+/* Get set_winsock_errno, FD_TO_SOCKET etc. */
+#include "w32sock.h"
+
+#undef setsockopt
+
+int
+rpl_setsockopt (int fd, int level, int optname, const void *optval, socklen_t optlen)
+{
+  int r;
+  SOCKET sock = FD_TO_SOCKET (fd);
+
+  if (level == SOL_SOCKET && (optname == SO_RCVTIMEO || optname == SO_SNDTIMEO))
+    {
+      const struct timeval *tv = optval;
+      int milliseconds = tv->tv_sec * 1000 + tv->tv_usec / 1000;
+      optval = &milliseconds;
+      r = setsockopt (sock, level, optname, optval, sizeof (int));
+    }
+  else
+    {
+      r = setsockopt (sock, level, optname, optval, optlen);
+    }
+
+  if (r < 0)
+    set_winsock_errno ();
+
+  return r;
+}
diff --git a/lib/shutdown.c b/lib/shutdown.c
new file mode 100644 (file)
index 0000000..a7d9ac5
--- /dev/null
@@ -0,0 +1,40 @@
+/* shutdown.c --- wrappers for Windows shutdown function
+
+   Copyright (C) 2008-2011 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 3 of the License, 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, see <http://www.gnu.org/licenses/>.  */
+
+/* Written by Paolo Bonzini */
+
+#include <config.h>
+
+#define WIN32_LEAN_AND_MEAN
+/* Get winsock2.h. */
+#include <sys/socket.h>
+
+/* Get set_winsock_errno, FD_TO_SOCKET etc. */
+#include "w32sock.h"
+
+#undef shutdown
+
+int
+rpl_shutdown (int fd, int how)
+{
+  SOCKET sock = FD_TO_SOCKET (fd);
+  int r = shutdown (sock, how);
+  if (r < 0)
+    set_winsock_errno ();
+
+  return r;
+}
index 381eea1..aedf29e 100644 (file)
@@ -1,5 +1,5 @@
 /* size_max.h -- declare SIZE_MAX through system headers
 /* size_max.h -- declare SIZE_MAX through system headers
-   Copyright (C) 2005-2006, 2009-2010 Free Software Foundation, Inc.
+   Copyright (C) 2005-2006, 2009-2011 Free Software Foundation, Inc.
    Written by Simon Josefsson.
 
    This program is free software; you can redistribute it and/or modify
    Written by Simon Josefsson.
 
    This program is free software; you can redistribute it and/or modify
index 4243679..662ad8e 100644 (file)
@@ -1,5 +1,5 @@
 /* Formatted output to strings.
 /* Formatted output to strings.
-   Copyright (C) 2004, 2006-2010 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2006-2011 Free Software Foundation, Inc.
    Written by Simon Josefsson and Paul Eggert.
 
    This program is free software; you can redistribute it and/or modify
    Written by Simon Josefsson and Paul Eggert.
 
    This program is free software; you can redistribute it and/or modify
diff --git a/lib/socket.c b/lib/socket.c
new file mode 100644 (file)
index 0000000..600a145
--- /dev/null
@@ -0,0 +1,49 @@
+/* socket.c --- wrappers for Windows socket function
+
+   Copyright (C) 2008-2011 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 3 of the License, 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, see <http://www.gnu.org/licenses/>.  */
+
+/* Written by Paolo Bonzini */
+
+#include <config.h>
+
+#define WIN32_LEAN_AND_MEAN
+/* Get winsock2.h. */
+#include <sys/socket.h>
+
+/* Get set_winsock_errno, FD_TO_SOCKET etc. */
+#include "w32sock.h"
+
+#include "sockets.h"
+
+int
+rpl_socket (int domain, int type, int protocol)
+{
+  SOCKET fh;
+
+  gl_sockets_startup (SOCKETS_1_1);
+
+  /* We have to use WSASocket() to create non-overlapped IO sockets.
+     Overlapped IO sockets cannot be used with read/write.  */
+  fh = WSASocket (domain, type, protocol, NULL, 0, 0);
+
+  if (fh == INVALID_SOCKET)
+    {
+      set_winsock_errno ();
+      return -1;
+    }
+  else
+    return SOCKET_TO_FD (fh);
+}
index a853c8c..27da15f 100644 (file)
@@ -1,6 +1,6 @@
 /* sockets.c --- wrappers for Windows socket functions
 
 /* sockets.c --- wrappers for Windows socket functions
 
-   Copyright (C) 2008-2010 Free Software Foundation, Inc.
+   Copyright (C) 2008-2011 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
 
    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
index 0ecedce..518565d 100644 (file)
@@ -1,6 +1,6 @@
 /* sockets.h - wrappers for Windows socket functions
 
 /* sockets.h - wrappers for Windows socket functions
 
-   Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
+   Copyright (C) 2008-2011 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
 
    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
index 1cb73ab..b4a914c 100644 (file)
@@ -1,6 +1,6 @@
 /* stat-related time functions.
 
 /* stat-related time functions.
 
-   Copyright (C) 2005, 2007, 2009-2010 Free Software Foundation, Inc.
+   Copyright (C) 2005, 2007, 2009-2011 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
 
    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
index 60fe127..d154a18 100644 (file)
@@ -1,5 +1,5 @@
 /* Work around platform bugs in stat.
 /* Work around platform bugs in stat.
-   Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+   Copyright (C) 2009-2011 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
 
    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
index 1062a12..957fa9a 100644 (file)
@@ -1,5 +1,5 @@
 /* Substitute for and wrapper around <stdarg.h>.
 /* Substitute for and wrapper around <stdarg.h>.
-   Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
+   Copyright (C) 2008-2011 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
 
    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
index f2510a9..0f33b19 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2003, 2006-2010 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2003, 2006-2011 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
    Written by Bruno Haible <haible@clisp.cons.org>, 2001.
 
    This program is free software; you can redistribute it and/or modify
index a69683e..70f5a86 100644 (file)
@@ -1,6 +1,6 @@
 /* A substitute for POSIX 2008 <stddef.h>, for platforms that have issues.
 
 /* A substitute for POSIX 2008 <stddef.h>, for platforms that have issues.
 
-   Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+   Copyright (C) 2009-2011 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
 
    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
index db1eec8..319b8aa 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2002, 2004-2010 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2002, 2004-2011 Free Software Foundation, Inc.
    Written by Paul Eggert, Bruno Haible, Sam Steingold, Peter Burwood.
    This file is part of gnulib.
 
    Written by Paul Eggert, Bruno Haible, Sam Steingold, Peter Burwood.
    This file is part of gnulib.
 
         warnings in the signed case.  */ \
      ((((zero) + 1) << ((bits) ? (bits) - 1 - (signed) : 0)) - 1) * 2 + 1)
 
         warnings in the signed case.  */ \
      ((((zero) + 1) << ((bits) ? (bits) - 1 - (signed) : 0)) - 1) * 2 + 1)
 
+#if !GNULIB_defined_stdint_types
+
 /* 7.18.1.1. Exact-width integer types */
 
 /* Here we assume a standard architecture where the hardware integer
 /* 7.18.1.1. Exact-width integer types */
 
 /* Here we assume a standard architecture where the hardware integer
@@ -137,9 +139,10 @@ typedef unsigned int gl_uint32_t;
 /* If the system defines INT64_MAX, assume int64_t works.  That way,
    if the underlying platform defines int64_t to be a 64-bit long long
    int, the code below won't mistakenly define it to be a 64-bit long
 /* If the system defines INT64_MAX, assume int64_t works.  That way,
    if the underlying platform defines int64_t to be a 64-bit long long
    int, the code below won't mistakenly define it to be a 64-bit long
-   int, which would mess up C++ name mangling.  */
+   int, which would mess up C++ name mangling.  We must use #ifdef
+   rather than #if, to avoid an error with HP-UX 10.20 cc.  */
 
 
-#if INT64_MAX
+#ifdef INT64_MAX
 # define GL_INT64_T
 #else
 /* Do not undefine int64_t if gnulib is not being used with 64-bit
 # define GL_INT64_T
 #else
 /* Do not undefine int64_t if gnulib is not being used with 64-bit
@@ -162,7 +165,7 @@ typedef long long int gl_int64_t;
 # endif
 #endif
 
 # endif
 #endif
 
-#if UINT64_MAX
+#ifdef UINT64_MAX
 # define GL_UINT64_T
 #else
 # if ULONG_MAX >> 31 >> 31 >> 1 == 1
 # define GL_UINT64_T
 #else
 # if ULONG_MAX >> 31 >> 31 >> 1 == 1
@@ -295,6 +298,9 @@ typedef unsigned long int gl_uintmax_t;
 typedef int _verify_intmax_size[sizeof (intmax_t) == sizeof (uintmax_t)
                                 ? 1 : -1];
 
 typedef int _verify_intmax_size[sizeof (intmax_t) == sizeof (uintmax_t)
                                 ? 1 : -1];
 
+#define GNULIB_defined_stdint_types 1
+#endif /* !GNULIB_defined_stdint_types */
+
 /* 7.18.2. Limits of specified-width integer types */
 
 #if ! defined __cplusplus || defined __STDC_LIMIT_MACROS
 /* 7.18.2. Limits of specified-width integer types */
 
 #if ! defined __cplusplus || defined __STDC_LIMIT_MACROS
index 21d07b9..252d9bc 100644 (file)
@@ -1,5 +1,5 @@
 /* POSIX compatible FILE stream write function.
 /* POSIX compatible FILE stream write function.
-   Copyright (C) 2008-2010 Free Software Foundation, Inc.
+   Copyright (C) 2008-2011 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2008.
 
    This program is free software: you can redistribute it and/or modify
    Written by Bruno Haible <bruno@clisp.org>, 2008.
 
    This program is free software: you can redistribute it and/or modify
index 1aa1227..4a82174 100644 (file)
@@ -1,6 +1,6 @@
 /* A GNU-like <stdio.h>.
 
 /* A GNU-like <stdio.h>.
 
-   Copyright (C) 2004, 2007-2010 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2007-2011 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
 
    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 <stddef.h>
 
 
 #include <stddef.h>
 
-/* Get off_t and ssize_t.  Needed on many systems, including glibc 2.8.  */
+/* Get off_t and ssize_t.  Needed on many systems, including glibc 2.8
+   and eglibc 2.11.2.  */
 #include <sys/types.h>
 
 #include <sys/types.h>
 
-#ifndef __attribute__
 /* The __attribute__ feature is available in gcc versions 2.5 and later.
    The __-protected variants of the attributes 'format' and 'printf' are
    accepted by gcc versions 2.6.4 (effectively 2.7) and later.
 /* The __attribute__ feature is available in gcc versions 2.5 and later.
    The __-protected variants of the attributes 'format' and 'printf' are
    accepted by gcc versions 2.6.4 (effectively 2.7) and later.
-   We enable __attribute__ only if these are supported too, because
+   We enable _GL_ATTRIBUTE_FORMAT only if these are supported too, because
    gnulib and libintl do '#define printf __printf__' when they override
    the 'printf' function.  */
    gnulib and libintl do '#define printf __printf__' when they override
    the 'printf' function.  */
-# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
-#  define __attribute__(Spec)   /* empty */
-# endif
+#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
+# define _GL_ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec))
+#else
+# define _GL_ATTRIBUTE_FORMAT(spec) /* empty */
 #endif
 #endif
+#define _GL_ATTRIBUTE_FORMAT_PRINTF(formatstring_parameter, first_argument) \
+  _GL_ATTRIBUTE_FORMAT ((__printf__, formatstring_parameter, first_argument))
 
 /* Solaris 10 declares renameat in <unistd.h>, not in <stdio.h>.  */
 /* But in any case avoid namespace pollution on glibc systems.  */
 
 /* Solaris 10 declares renameat in <unistd.h>, not in <stdio.h>.  */
 /* But in any case avoid namespace pollution on glibc systems.  */
 #   define dprintf rpl_dprintf
 #  endif
 _GL_FUNCDECL_RPL (dprintf, int, (int fd, const char *format, ...)
 #   define dprintf rpl_dprintf
 #  endif
 _GL_FUNCDECL_RPL (dprintf, int, (int fd, const char *format, ...)
-                                __attribute__ ((__format__ (__printf__, 2, 3)))
+                                _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
                                 _GL_ARG_NONNULL ((2)));
 _GL_CXXALIAS_RPL (dprintf, int, (int fd, const char *format, ...));
 # else
 #  if !@HAVE_DPRINTF@
 _GL_FUNCDECL_SYS (dprintf, int, (int fd, const char *format, ...)
                                 _GL_ARG_NONNULL ((2)));
 _GL_CXXALIAS_RPL (dprintf, int, (int fd, const char *format, ...));
 # else
 #  if !@HAVE_DPRINTF@
 _GL_FUNCDECL_SYS (dprintf, int, (int fd, const char *format, ...)
-                                __attribute__ ((__format__ (__printf__, 2, 3)))
+                                _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
                                 _GL_ARG_NONNULL ((2)));
 #  endif
 _GL_CXXALIAS_SYS (dprintf, int, (int fd, const char *format, ...));
                                 _GL_ARG_NONNULL ((2)));
 #  endif
 _GL_CXXALIAS_SYS (dprintf, int, (int fd, const char *format, ...));
@@ -189,7 +192,7 @@ _GL_WARN_ON_USE (fopen, "fopen on Win32 platforms is not POSIX compatible - "
 #  endif
 #  define GNULIB_overrides_fprintf 1
 _GL_FUNCDECL_RPL (fprintf, int, (FILE *fp, const char *format, ...)
 #  endif
 #  define GNULIB_overrides_fprintf 1
 _GL_FUNCDECL_RPL (fprintf, int, (FILE *fp, const char *format, ...)
-                                __attribute__ ((__format__ (__printf__, 2, 3)))
+                                _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
                                 _GL_ARG_NONNULL ((1, 2)));
 _GL_CXXALIAS_RPL (fprintf, int, (FILE *fp, const char *format, ...));
 # else
                                 _GL_ARG_NONNULL ((1, 2)));
 _GL_CXXALIAS_RPL (fprintf, int, (FILE *fp, const char *format, ...));
 # else
@@ -366,17 +369,20 @@ _GL_CXXALIASWARN (fseeko);
    /* Provide an fseek function that is consistent with fseeko.  */
    /* In order to avoid that fseek gets defined as a macro here, the
       developer can request the 'fseek' module.  */
    /* Provide an fseek function that is consistent with fseeko.  */
    /* In order to avoid that fseek gets defined as a macro here, the
       developer can request the 'fseek' module.  */
-#  undef fseek
-#  define fseek rpl_fseek
+#  if !GNULIB_defined_fseek_function
+#   undef fseek
+#   define fseek rpl_fseek
 static inline int _GL_ARG_NONNULL ((1))
 rpl_fseek (FILE *fp, long offset, int whence)
 {
 static inline int _GL_ARG_NONNULL ((1))
 rpl_fseek (FILE *fp, long offset, int whence)
 {
-#  if @REPLACE_FSEEKO@
+#   if @REPLACE_FSEEKO@
   return rpl_fseeko (fp, offset, whence);
   return rpl_fseeko (fp, offset, whence);
-#  else
+#   else
   return fseeko (fp, offset, whence);
   return fseeko (fp, offset, whence);
-#  endif
+#   endif
 }
 }
+#   define GNULIB_defined_fseek_function 1
+#  endif
 # endif
 #elif defined GNULIB_POSIXCHECK
 # define _GL_FSEEK_WARN /* Category 1, above.  */
 # endif
 #elif defined GNULIB_POSIXCHECK
 # define _GL_FSEEK_WARN /* Category 1, above.  */
@@ -441,17 +447,20 @@ _GL_CXXALIASWARN (ftello);
    /* Provide an ftell function that is consistent with ftello.  */
    /* In order to avoid that ftell gets defined as a macro here, the
       developer can request the 'ftell' module.  */
    /* Provide an ftell function that is consistent with ftello.  */
    /* In order to avoid that ftell gets defined as a macro here, the
       developer can request the 'ftell' module.  */
-#  undef ftell
-#  define ftell rpl_ftell
+#  if !GNULIB_defined_ftell_function
+#   undef ftell
+#   define ftell rpl_ftell
 static inline long _GL_ARG_NONNULL ((1))
 rpl_ftell (FILE *f)
 {
 static inline long _GL_ARG_NONNULL ((1))
 rpl_ftell (FILE *f)
 {
-#  if @REPLACE_FTELLO@
+#   if @REPLACE_FTELLO@
   return rpl_ftello (f);
   return rpl_ftello (f);
-#  else
+#   else
   return ftello (f);
   return ftello (f);
-#  endif
+#   endif
 }
 }
+#   define GNULIB_defined_ftell_function 1
+#  endif
 # endif
 #elif defined GNULIB_POSIXCHECK
 # define _GL_FTELL_WARN /* Category 1, above.  */
 # endif
 #elif defined GNULIB_POSIXCHECK
 # define _GL_FTELL_WARN /* Category 1, above.  */
@@ -580,7 +589,7 @@ struct obstack;
 #  endif
 _GL_FUNCDECL_RPL (obstack_printf, int,
                   (struct obstack *obs, const char *format, ...)
 #  endif
 _GL_FUNCDECL_RPL (obstack_printf, int,
                   (struct obstack *obs, const char *format, ...)
-                  __attribute__ ((__format__ (__printf__, 2, 3)))
+                  _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
                   _GL_ARG_NONNULL ((1, 2)));
 _GL_CXXALIAS_RPL (obstack_printf, int,
                   (struct obstack *obs, const char *format, ...));
                   _GL_ARG_NONNULL ((1, 2)));
 _GL_CXXALIAS_RPL (obstack_printf, int,
                   (struct obstack *obs, const char *format, ...));
@@ -588,7 +597,7 @@ _GL_CXXALIAS_RPL (obstack_printf, int,
 #  if !@HAVE_DECL_OBSTACK_PRINTF@
 _GL_FUNCDECL_SYS (obstack_printf, int,
                   (struct obstack *obs, const char *format, ...)
 #  if !@HAVE_DECL_OBSTACK_PRINTF@
 _GL_FUNCDECL_SYS (obstack_printf, int,
                   (struct obstack *obs, const char *format, ...)
-                  __attribute__ ((__format__ (__printf__, 2, 3)))
+                  _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
                   _GL_ARG_NONNULL ((1, 2)));
 #  endif
 _GL_CXXALIAS_SYS (obstack_printf, int,
                   _GL_ARG_NONNULL ((1, 2)));
 #  endif
 _GL_CXXALIAS_SYS (obstack_printf, int,
@@ -601,7 +610,7 @@ _GL_CXXALIASWARN (obstack_printf);
 #  endif
 _GL_FUNCDECL_RPL (obstack_vprintf, int,
                   (struct obstack *obs, const char *format, va_list args)
 #  endif
 _GL_FUNCDECL_RPL (obstack_vprintf, int,
                   (struct obstack *obs, const char *format, va_list args)
-                  __attribute__ ((__format__ (__printf__, 2, 0)))
+                  _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
                   _GL_ARG_NONNULL ((1, 2)));
 _GL_CXXALIAS_RPL (obstack_vprintf, int,
                   (struct obstack *obs, const char *format, va_list args));
                   _GL_ARG_NONNULL ((1, 2)));
 _GL_CXXALIAS_RPL (obstack_vprintf, int,
                   (struct obstack *obs, const char *format, va_list args));
@@ -609,7 +618,7 @@ _GL_CXXALIAS_RPL (obstack_vprintf, int,
 #  if !@HAVE_DECL_OBSTACK_PRINTF@
 _GL_FUNCDECL_SYS (obstack_vprintf, int,
                   (struct obstack *obs, const char *format, va_list args)
 #  if !@HAVE_DECL_OBSTACK_PRINTF@
 _GL_FUNCDECL_SYS (obstack_vprintf, int,
                   (struct obstack *obs, const char *format, va_list args)
-                  __attribute__ ((__format__ (__printf__, 2, 0)))
+                  _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
                   _GL_ARG_NONNULL ((1, 2)));
 #  endif
 _GL_CXXALIAS_SYS (obstack_vprintf, int,
                   _GL_ARG_NONNULL ((1, 2)));
 #  endif
 _GL_CXXALIAS_SYS (obstack_vprintf, int,
@@ -672,13 +681,16 @@ _GL_FUNCDECL_RPL_1 (__printf__, int,
                     (const char *format, ...)
                     __asm__ (@ASM_SYMBOL_PREFIX@
                              _GL_STDIO_MACROEXPAND_AND_STRINGIZE(rpl_printf))
                     (const char *format, ...)
                     __asm__ (@ASM_SYMBOL_PREFIX@
                              _GL_STDIO_MACROEXPAND_AND_STRINGIZE(rpl_printf))
-                    __attribute__ ((__format__ (__printf__, 1, 2)))
+                    _GL_ATTRIBUTE_FORMAT_PRINTF (1, 2)
                     _GL_ARG_NONNULL ((1)));
 _GL_CXXALIAS_RPL_1 (printf, __printf__, int, (const char *format, ...));
 #  else
                     _GL_ARG_NONNULL ((1)));
 _GL_CXXALIAS_RPL_1 (printf, __printf__, int, (const char *format, ...));
 #  else
+#   if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#    define printf rpl_printf
+#   endif
 _GL_FUNCDECL_RPL (printf, int,
                   (const char *format, ...)
 _GL_FUNCDECL_RPL (printf, int,
                   (const char *format, ...)
-                  __attribute__ ((__format__ (__printf__, 1, 2)))
+                  _GL_ATTRIBUTE_FORMAT_PRINTF (1, 2)
                   _GL_ARG_NONNULL ((1)));
 _GL_CXXALIAS_RPL (printf, int, (const char *format, ...));
 #  endif
                   _GL_ARG_NONNULL ((1)));
 _GL_CXXALIAS_RPL (printf, int, (const char *format, ...));
 #  endif
@@ -818,7 +830,7 @@ _GL_WARN_ON_USE (renameat, "renameat is not portable - "
 #  endif
 _GL_FUNCDECL_RPL (snprintf, int,
                   (char *str, size_t size, const char *format, ...)
 #  endif
 _GL_FUNCDECL_RPL (snprintf, int,
                   (char *str, size_t size, const char *format, ...)
-                  __attribute__ ((__format__ (__printf__, 3, 4)))
+                  _GL_ATTRIBUTE_FORMAT_PRINTF (3, 4)
                   _GL_ARG_NONNULL ((3)));
 _GL_CXXALIAS_RPL (snprintf, int,
                   (char *str, size_t size, const char *format, ...));
                   _GL_ARG_NONNULL ((3)));
 _GL_CXXALIAS_RPL (snprintf, int,
                   (char *str, size_t size, const char *format, ...));
@@ -826,7 +838,7 @@ _GL_CXXALIAS_RPL (snprintf, int,
 #  if !@HAVE_DECL_SNPRINTF@
 _GL_FUNCDECL_SYS (snprintf, int,
                   (char *str, size_t size, const char *format, ...)
 #  if !@HAVE_DECL_SNPRINTF@
 _GL_FUNCDECL_SYS (snprintf, int,
                   (char *str, size_t size, const char *format, ...)
-                  __attribute__ ((__format__ (__printf__, 3, 4)))
+                  _GL_ATTRIBUTE_FORMAT_PRINTF (3, 4)
                   _GL_ARG_NONNULL ((3)));
 #  endif
 _GL_CXXALIAS_SYS (snprintf, int,
                   _GL_ARG_NONNULL ((3)));
 #  endif
 _GL_CXXALIAS_SYS (snprintf, int,
@@ -856,7 +868,7 @@ _GL_WARN_ON_USE (snprintf, "snprintf is unportable - "
 #   define sprintf rpl_sprintf
 #  endif
 _GL_FUNCDECL_RPL (sprintf, int, (char *str, const char *format, ...)
 #   define sprintf rpl_sprintf
 #  endif
 _GL_FUNCDECL_RPL (sprintf, int, (char *str, const char *format, ...)
-                                __attribute__ ((__format__ (__printf__, 2, 3)))
+                                _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
                                 _GL_ARG_NONNULL ((1, 2)));
 _GL_CXXALIAS_RPL (sprintf, int, (char *str, const char *format, ...));
 # else
                                 _GL_ARG_NONNULL ((1, 2)));
 _GL_CXXALIAS_RPL (sprintf, int, (char *str, const char *format, ...));
 # else
@@ -901,7 +913,7 @@ _GL_WARN_ON_USE (tmpfile, "tmpfile is not usable on mingw - "
 #  endif
 _GL_FUNCDECL_RPL (asprintf, int,
                   (char **result, const char *format, ...)
 #  endif
 _GL_FUNCDECL_RPL (asprintf, int,
                   (char **result, const char *format, ...)
-                  __attribute__ ((__format__ (__printf__, 2, 3)))
+                  _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
                   _GL_ARG_NONNULL ((1, 2)));
 _GL_CXXALIAS_RPL (asprintf, int,
                   (char **result, const char *format, ...));
                   _GL_ARG_NONNULL ((1, 2)));
 _GL_CXXALIAS_RPL (asprintf, int,
                   (char **result, const char *format, ...));
@@ -909,7 +921,7 @@ _GL_CXXALIAS_RPL (asprintf, int,
 #  if !@HAVE_VASPRINTF@
 _GL_FUNCDECL_SYS (asprintf, int,
                   (char **result, const char *format, ...)
 #  if !@HAVE_VASPRINTF@
 _GL_FUNCDECL_SYS (asprintf, int,
                   (char **result, const char *format, ...)
-                  __attribute__ ((__format__ (__printf__, 2, 3)))
+                  _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
                   _GL_ARG_NONNULL ((1, 2)));
 #  endif
 _GL_CXXALIAS_SYS (asprintf, int,
                   _GL_ARG_NONNULL ((1, 2)));
 #  endif
 _GL_CXXALIAS_SYS (asprintf, int,
@@ -922,7 +934,7 @@ _GL_CXXALIASWARN (asprintf);
 #  endif
 _GL_FUNCDECL_RPL (vasprintf, int,
                   (char **result, const char *format, va_list args)
 #  endif
 _GL_FUNCDECL_RPL (vasprintf, int,
                   (char **result, const char *format, va_list args)
-                  __attribute__ ((__format__ (__printf__, 2, 0)))
+                  _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
                   _GL_ARG_NONNULL ((1, 2)));
 _GL_CXXALIAS_RPL (vasprintf, int,
                   (char **result, const char *format, va_list args));
                   _GL_ARG_NONNULL ((1, 2)));
 _GL_CXXALIAS_RPL (vasprintf, int,
                   (char **result, const char *format, va_list args));
@@ -930,7 +942,7 @@ _GL_CXXALIAS_RPL (vasprintf, int,
 #  if !@HAVE_VASPRINTF@
 _GL_FUNCDECL_SYS (vasprintf, int,
                   (char **result, const char *format, va_list args)
 #  if !@HAVE_VASPRINTF@
 _GL_FUNCDECL_SYS (vasprintf, int,
                   (char **result, const char *format, va_list args)
-                  __attribute__ ((__format__ (__printf__, 2, 0)))
+                  _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
                   _GL_ARG_NONNULL ((1, 2)));
 #  endif
 _GL_CXXALIAS_SYS (vasprintf, int,
                   _GL_ARG_NONNULL ((1, 2)));
 #  endif
 _GL_CXXALIAS_SYS (vasprintf, int,
@@ -945,13 +957,13 @@ _GL_CXXALIASWARN (vasprintf);
 #   define vdprintf rpl_vdprintf
 #  endif
 _GL_FUNCDECL_RPL (vdprintf, int, (int fd, const char *format, va_list args)
 #   define vdprintf rpl_vdprintf
 #  endif
 _GL_FUNCDECL_RPL (vdprintf, int, (int fd, const char *format, va_list args)
-                                 __attribute__ ((__format__ (__printf__, 2, 0)))
+                                 _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
                                  _GL_ARG_NONNULL ((2)));
 _GL_CXXALIAS_RPL (vdprintf, int, (int fd, const char *format, va_list args));
 # else
 #  if !@HAVE_VDPRINTF@
 _GL_FUNCDECL_SYS (vdprintf, int, (int fd, const char *format, va_list args)
                                  _GL_ARG_NONNULL ((2)));
 _GL_CXXALIAS_RPL (vdprintf, int, (int fd, const char *format, va_list args));
 # else
 #  if !@HAVE_VDPRINTF@
 _GL_FUNCDECL_SYS (vdprintf, int, (int fd, const char *format, va_list args)
-                                 __attribute__ ((__format__ (__printf__, 2, 0)))
+                                 _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
                                  _GL_ARG_NONNULL ((2)));
 #  endif
 /* Need to cast, because on Solaris, the third parameter will likely be
                                  _GL_ARG_NONNULL ((2)));
 #  endif
 /* Need to cast, because on Solaris, the third parameter will likely be
@@ -976,7 +988,7 @@ _GL_WARN_ON_USE (vdprintf, "vdprintf is unportable - "
 #  endif
 #  define GNULIB_overrides_vfprintf 1
 _GL_FUNCDECL_RPL (vfprintf, int, (FILE *fp, const char *format, va_list args)
 #  endif
 #  define GNULIB_overrides_vfprintf 1
 _GL_FUNCDECL_RPL (vfprintf, int, (FILE *fp, const char *format, va_list args)
-                                 __attribute__ ((__format__ (__printf__, 2, 0)))
+                                 _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
                                  _GL_ARG_NONNULL ((1, 2)));
 _GL_CXXALIAS_RPL (vfprintf, int, (FILE *fp, const char *format, va_list args));
 # else
                                  _GL_ARG_NONNULL ((1, 2)));
 _GL_CXXALIAS_RPL (vfprintf, int, (FILE *fp, const char *format, va_list args));
 # else
@@ -1006,7 +1018,7 @@ _GL_WARN_ON_USE (vfprintf, "vfprintf is not always POSIX compliant - "
 #  endif
 #  define GNULIB_overrides_vprintf 1
 _GL_FUNCDECL_RPL (vprintf, int, (const char *format, va_list args)
 #  endif
 #  define GNULIB_overrides_vprintf 1
 _GL_FUNCDECL_RPL (vprintf, int, (const char *format, va_list args)
-                                __attribute__ ((__format__ (__printf__, 1, 0)))
+                                _GL_ATTRIBUTE_FORMAT_PRINTF (1, 0)
                                 _GL_ARG_NONNULL ((1)));
 _GL_CXXALIAS_RPL (vprintf, int, (const char *format, va_list args));
 # else
                                 _GL_ARG_NONNULL ((1)));
 _GL_CXXALIAS_RPL (vprintf, int, (const char *format, va_list args));
 # else
@@ -1034,7 +1046,7 @@ _GL_WARN_ON_USE (vprintf, "vprintf is not always POSIX compliant - "
 #  endif
 _GL_FUNCDECL_RPL (vsnprintf, int,
                   (char *str, size_t size, const char *format, va_list args)
 #  endif
 _GL_FUNCDECL_RPL (vsnprintf, int,
                   (char *str, size_t size, const char *format, va_list args)
-                  __attribute__ ((__format__ (__printf__, 3, 0)))
+                  _GL_ATTRIBUTE_FORMAT_PRINTF (3, 0)
                   _GL_ARG_NONNULL ((3)));
 _GL_CXXALIAS_RPL (vsnprintf, int,
                   (char *str, size_t size, const char *format, va_list args));
                   _GL_ARG_NONNULL ((3)));
 _GL_CXXALIAS_RPL (vsnprintf, int,
                   (char *str, size_t size, const char *format, va_list args));
@@ -1042,7 +1054,7 @@ _GL_CXXALIAS_RPL (vsnprintf, int,
 #  if !@HAVE_DECL_VSNPRINTF@
 _GL_FUNCDECL_SYS (vsnprintf, int,
                   (char *str, size_t size, const char *format, va_list args)
 #  if !@HAVE_DECL_VSNPRINTF@
 _GL_FUNCDECL_SYS (vsnprintf, int,
                   (char *str, size_t size, const char *format, va_list args)
-                  __attribute__ ((__format__ (__printf__, 3, 0)))
+                  _GL_ATTRIBUTE_FORMAT_PRINTF (3, 0)
                   _GL_ARG_NONNULL ((3)));
 #  endif
 _GL_CXXALIAS_SYS (vsnprintf, int,
                   _GL_ARG_NONNULL ((3)));
 #  endif
 _GL_CXXALIAS_SYS (vsnprintf, int,
@@ -1064,7 +1076,7 @@ _GL_WARN_ON_USE (vsnprintf, "vsnprintf is unportable - "
 #  endif
 _GL_FUNCDECL_RPL (vsprintf, int,
                   (char *str, const char *format, va_list args)
 #  endif
 _GL_FUNCDECL_RPL (vsprintf, int,
                   (char *str, const char *format, va_list args)
-                  __attribute__ ((__format__ (__printf__, 2, 0)))
+                  _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
                   _GL_ARG_NONNULL ((1, 2)));
 _GL_CXXALIAS_RPL (vsprintf, int,
                   (char *str, const char *format, va_list args));
                   _GL_ARG_NONNULL ((1, 2)));
 _GL_CXXALIAS_RPL (vsprintf, int,
                   (char *str, const char *format, va_list args));
index 1bae6c7..e2d9457 100644 (file)
@@ -1,6 +1,6 @@
 /* A GNU-like <stdlib.h>.
 
 /* A GNU-like <stdlib.h>.
 
-   Copyright (C) 1995, 2001-2004, 2006-2010 Free Software Foundation, Inc.
+   Copyright (C) 1995, 2001-2004, 2006-2011 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
 
    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 <sys/loadavg.h>
 #endif
 
 # include <sys/loadavg.h>
 #endif
 
+#if @GNULIB_RANDOM_R@
+
 /* OSF/1 5.1 declares 'struct random_data' in <random.h>, which is included
 /* OSF/1 5.1 declares 'struct random_data' in <random.h>, which is included
-   from <stdlib.h> if _REENTRANT is defined.  Include it always.  */
-#if @HAVE_RANDOM_H@
-# include <random.h>
-#endif
+   from <stdlib.h> if _REENTRANT is defined.  Include it whenever we need
+   'struct random_data'.  */
+# if @HAVE_RANDOM_H@
+#  include <random.h>
+# endif
 
 
-#if !@HAVE_STRUCT_RANDOM_DATA@ || (@GNULIB_RANDOM_R@ && !@HAVE_RANDOM_R@) \
-    || defined GNULIB_POSIXCHECK
-# include <stdint.h>
-#endif
+# if !@HAVE_STRUCT_RANDOM_DATA@ || !@HAVE_RANDOM_R@
+#  include <stdint.h>
+# endif
 
 
-#if !@HAVE_STRUCT_RANDOM_DATA@
+# if !@HAVE_STRUCT_RANDOM_DATA@
 /* Define 'struct random_data'.
    But allow multiple gnulib generated <stdlib.h> replacements to coexist.  */
 /* Define 'struct random_data'.
    But allow multiple gnulib generated <stdlib.h> replacements to coexist.  */
-# if !GNULIB_defined_struct_random_data
+#  if !GNULIB_defined_struct_random_data
 struct random_data
 {
   int32_t *fptr;                /* Front pointer.  */
 struct random_data
 {
   int32_t *fptr;                /* Front pointer.  */
@@ -74,7 +76,8 @@ struct random_data
   int rand_sep;                 /* Distance between front and rear.  */
   int32_t *end_ptr;             /* Pointer behind state table.  */
 };
   int rand_sep;                 /* Distance between front and rear.  */
   int32_t *end_ptr;             /* Pointer behind state table.  */
 };
-#  define GNULIB_defined_struct_random_data 1
+#   define GNULIB_defined_struct_random_data 1
+#  endif
 # endif
 #endif
 
 # endif
 #endif
 
@@ -85,10 +88,10 @@ struct random_data
 # include <unistd.h>
 #endif
 
 # include <unistd.h>
 #endif
 
-#ifndef __attribute__
-# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8)
-#  define __attribute__(Spec)   /* empty */
-# endif
+#if 3 <= __GNUC__ || __GNUC__ == 2 && 8 <= __GNUC_MINOR__
+# define _GL_ATTRIBUTE_NORETURN __attribute__ ((__noreturn__))
+#else
+# define _GL_ATTRIBUTE_NORETURN
 #endif
 
 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
 #endif
 
 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
@@ -116,7 +119,7 @@ struct random_data
 /* Terminate the current process with the given return code, without running
    the 'atexit' handlers.  */
 # if !@HAVE__EXIT@
 /* Terminate the current process with the given return code, without running
    the 'atexit' handlers.  */
 # if !@HAVE__EXIT@
-_GL_FUNCDECL_SYS (_Exit, void, (int status) __attribute__ ((__noreturn__)));
+_GL_FUNCDECL_SYS (_Exit, void, (int status) _GL_ATTRIBUTE_NORETURN);
 # endif
 _GL_CXXALIAS_SYS (_Exit, void, (int status));
 _GL_CXXALIASWARN (_Exit);
 # endif
 _GL_CXXALIAS_SYS (_Exit, void, (int status));
 _GL_CXXALIASWARN (_Exit);
index 2891544..a98a3a0 100644 (file)
@@ -1,5 +1,5 @@
 /* Case-insensitive string comparison function.
 /* Case-insensitive string comparison function.
-   Copyright (C) 1998-1999, 2005-2007, 2009-2010 Free Software Foundation, Inc.
+   Copyright (C) 1998-1999, 2005-2007, 2009-2011 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
 
    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
diff --git a/lib/streq.h b/lib/streq.h
deleted file mode 100644 (file)
index 8791598..0000000
+++ /dev/null
@@ -1,176 +0,0 @@
-/* Optimized string comparison.
-   Copyright (C) 2001-2002, 2007, 2009-2010 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 3 of the License, 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, see <http://www.gnu.org/licenses/>.  */
-
-/* Written by Bruno Haible <bruno@clisp.org>.  */
-
-#ifndef _GL_STREQ_H
-#define _GL_STREQ_H
-
-#include <string.h>
-
-/* STREQ allows to optimize string comparison with a small literal string.
-     STREQ (s, "EUC-KR", 'E', 'U', 'C', '-', 'K', 'R', 0, 0, 0)
-   is semantically equivalent to
-     strcmp (s, "EUC-KR") == 0
-   just faster.  */
-
-/* Help GCC to generate good code for string comparisons with
-   immediate strings. */
-#if defined (__GNUC__) && defined (__OPTIMIZE__)
-
-static inline int
-streq9 (const char *s1, const char *s2)
-{
-  return strcmp (s1 + 9, s2 + 9) == 0;
-}
-
-static inline int
-streq8 (const char *s1, const char *s2, char s28)
-{
-  if (s1[8] == s28)
-    {
-      if (s28 == 0)
-        return 1;
-      else
-        return streq9 (s1, s2);
-    }
-  else
-    return 0;
-}
-
-static inline int
-streq7 (const char *s1, const char *s2, char s27, char s28)
-{
-  if (s1[7] == s27)
-    {
-      if (s27 == 0)
-        return 1;
-      else
-        return streq8 (s1, s2, s28);
-    }
-  else
-    return 0;
-}
-
-static inline int
-streq6 (const char *s1, const char *s2, char s26, char s27, char s28)
-{
-  if (s1[6] == s26)
-    {
-      if (s26 == 0)
-        return 1;
-      else
-        return streq7 (s1, s2, s27, s28);
-    }
-  else
-    return 0;
-}
-
-static inline int
-streq5 (const char *s1, const char *s2, char s25, char s26, char s27, char s28)
-{
-  if (s1[5] == s25)
-    {
-      if (s25 == 0)
-        return 1;
-      else
-        return streq6 (s1, s2, s26, s27, s28);
-    }
-  else
-    return 0;
-}
-
-static inline int
-streq4 (const char *s1, const char *s2, char s24, char s25, char s26, char s27, char s28)
-{
-  if (s1[4] == s24)
-    {
-      if (s24 == 0)
-        return 1;
-      else
-        return streq5 (s1, s2, s25, s26, s27, s28);
-    }
-  else
-    return 0;
-}
-
-static inline int
-streq3 (const char *s1, const char *s2, char s23, char s24, char s25, char s26, char s27, char s28)
-{
-  if (s1[3] == s23)
-    {
-      if (s23 == 0)
-        return 1;
-      else
-        return streq4 (s1, s2, s24, s25, s26, s27, s28);
-    }
-  else
-    return 0;
-}
-
-static inline int
-streq2 (const char *s1, const char *s2, char s22, char s23, char s24, char s25, char s26, char s27, char s28)
-{
-  if (s1[2] == s22)
-    {
-      if (s22 == 0)
-        return 1;
-      else
-        return streq3 (s1, s2, s23, s24, s25, s26, s27, s28);
-    }
-  else
-    return 0;
-}
-
-static inline int
-streq1 (const char *s1, const char *s2, char s21, char s22, char s23, char s24, char s25, char s26, char s27, char s28)
-{
-  if (s1[1] == s21)
-    {
-      if (s21 == 0)
-        return 1;
-      else
-        return streq2 (s1, s2, s22, s23, s24, s25, s26, s27, s28);
-    }
-  else
-    return 0;
-}
-
-static inline int
-streq0 (const char *s1, const char *s2, char s20, char s21, char s22, char s23, char s24, char s25, char s26, char s27, char s28)
-{
-  if (s1[0] == s20)
-    {
-      if (s20 == 0)
-        return 1;
-      else
-        return streq1 (s1, s2, s21, s22, s23, s24, s25, s26, s27, s28);
-    }
-  else
-    return 0;
-}
-
-#define STREQ(s1,s2,s20,s21,s22,s23,s24,s25,s26,s27,s28) \
-  streq0 (s1, s2, s20, s21, s22, s23, s24, s25, s26, s27, s28)
-
-#else
-
-#define STREQ(s1,s2,s20,s21,s22,s23,s24,s25,s26,s27,s28) \
-  (strcmp (s1, s2) == 0)
-
-#endif
-
-#endif /* _GL_STREQ_H */
index c6a9ed2..be7750d 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2001, 2003-2007, 2009-2010 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2001, 2003-2007, 2009-2011 Free Software Foundation, Inc.
 
    NOTE: The canonical source of this file is maintained with the GNU C Library.
    Bugs can be reported to bug-glibc@prep.ai.mit.edu.
 
    NOTE: The canonical source of this file is maintained with the GNU C Library.
    Bugs can be reported to bug-glibc@prep.ai.mit.edu.
@@ -48,8 +48,11 @@ extern char *tzname[];
    GB18030, EUC-TW, BIG5, BIG5-HKSCS, CP950, EUC-JP, EUC-KR, CP949,
    SHIFT_JIS, CP932, JOHAB) are safe for formats, because the byte '%'
    cannot occur in a multibyte character except in the first byte.
    GB18030, EUC-TW, BIG5, BIG5-HKSCS, CP950, EUC-JP, EUC-KR, CP949,
    SHIFT_JIS, CP932, JOHAB) are safe for formats, because the byte '%'
    cannot occur in a multibyte character except in the first byte.
-   But this does not hold for the DEC-HANYU encoding used on OSF/1.  */
-#if !defined __osf__
+
+   The DEC-HANYU encoding used on OSF/1 is not safe for formats, but
+   this encoding has never been seen in real-life use, so we ignore
+   it.  */
+#if !(defined __osf__ && 0)
 # define MULTIBYTE_IS_FORMAT_SAFE 1
 #endif
 #define DO_MULTIBYTE (! MULTIBYTE_IS_FORMAT_SAFE)
 # define MULTIBYTE_IS_FORMAT_SAFE 1
 #endif
 #define DO_MULTIBYTE (! MULTIBYTE_IS_FORMAT_SAFE)
index 92501c3..c8cac90 100644 (file)
@@ -1,6 +1,6 @@
 /* declarations for strftime.c
 
 /* declarations for strftime.c
 
-   Copyright (C) 2002, 2004, 2008-2010 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2004, 2008-2011 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
 
    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
index 4fa4ea0..5052f02 100644 (file)
@@ -1,5 +1,5 @@
 /* Character set conversion with error handling.
 /* Character set conversion with error handling.
-   Copyright (C) 2001-2010 Free Software Foundation, Inc.
+   Copyright (C) 2001-2011 Free Software Foundation, Inc.
    Written by Bruno Haible and Simon Josefsson.
 
    This program is free software: you can redistribute it and/or modify
    Written by Bruno Haible and Simon Josefsson.
 
    This program is free software: you can redistribute it and/or modify
index 1f1c3bc..8c0e6c4 100644 (file)
@@ -1,5 +1,5 @@
 /* Character set conversion with error handling.
 /* Character set conversion with error handling.
-   Copyright (C) 2001-2007, 2009-2010 Free Software Foundation, Inc.
+   Copyright (C) 2001-2007, 2009-2011 Free Software Foundation, Inc.
    Written by Bruno Haible and Simon Josefsson.
 
    This program is free software: you can redistribute it and/or modify
    Written by Bruno Haible and Simon Josefsson.
 
    This program is free software: you can redistribute it and/or modify
index 57c1019..3926c0c 100644 (file)
@@ -1,6 +1,6 @@
 /* A GNU-like <string.h>.
 
 /* A GNU-like <string.h>.
 
-   Copyright (C) 1995-1996, 2001-2010 Free Software Foundation, Inc.
+   Copyright (C) 1995-1996, 2001-2011 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
 
    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 <wchar.h>
 #endif
 
 # include <wchar.h>
 #endif
 
-#ifndef __attribute__
-/* This feature is available in gcc versions 2.5 and later.  */
-# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5)
-#  define __attribute__(Spec) /* empty */
-# endif
-#endif
-/* The attribute __pure__ was added in gcc 2.96.  */
+/* The __attribute__ feature is available in gcc versions 2.5 and later.
+   The attribute __pure__ was added in gcc 2.96.  */
 #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
 # define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
 #else
 #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
 # define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
 #else
index 83b5823..d8f1770 100644 (file)
@@ -1,6 +1,6 @@
 /* A substitute <strings.h>.
 
 /* A substitute <strings.h>.
 
-   Copyright (C) 2007-2010 Free Software Foundation, Inc.
+   Copyright (C) 2007-2011 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
 
    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
index d525deb..35cd4cc 100644 (file)
@@ -1,5 +1,5 @@
 /* strncasecmp.c -- case insensitive string comparator
 /* strncasecmp.c -- case insensitive string comparator
-   Copyright (C) 1998-1999, 2005-2007, 2009-2010 Free Software Foundation, Inc.
+   Copyright (C) 1998-1999, 2005-2007, 2009-2011 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
 
    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
index c879f23..2526ea6 100644 (file)
@@ -1,6 +1,6 @@
 /* Provide a more complete sys/file.h.
 
 /* Provide a more complete sys/file.h.
 
-   Copyright (C) 2007-2010 Free Software Foundation, Inc.
+   Copyright (C) 2007-2011 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
 
    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
index 5c84627..12f6d1b 100644 (file)
@@ -1,6 +1,6 @@
 /* Provide a sys/socket header file for systems lacking it (read: MinGW)
    and for systems where it is incomplete.
 /* Provide a sys/socket header file for systems lacking it (read: MinGW)
    and for systems where it is incomplete.
-   Copyright (C) 2005-2010 Free Software Foundation, Inc.
+   Copyright (C) 2005-2011 Free Software Foundation, Inc.
    Written by Simon Josefsson.
 
    This program is free software; you can redistribute it and/or modify
    Written by Simon Josefsson.
 
    This program is free software; you can redistribute it and/or modify
 /* The definition of _GL_WARN_ON_USE is copied here.  */
 
 #if !@HAVE_SA_FAMILY_T@
 /* The definition of _GL_WARN_ON_USE is copied here.  */
 
 #if !@HAVE_SA_FAMILY_T@
+# if !GNULIB_defined_sa_family_t
 typedef unsigned short  sa_family_t;
 typedef unsigned short  sa_family_t;
+#  define GNULIB_defined_sa_family_t 1
+# endif
 #endif
 
 #if @HAVE_STRUCT_SOCKADDR_STORAGE@
 #endif
 
 #if @HAVE_STRUCT_SOCKADDR_STORAGE@
@@ -89,12 +92,16 @@ typedef unsigned short  sa_family_t;
                   : alignof (__ss_aligntype))                           \
                  + sizeof (__ss_aligntype)))
 
                   : alignof (__ss_aligntype))                           \
                  + sizeof (__ss_aligntype)))
 
+# if !GNULIB_defined_struct_sockaddr_storage
 struct sockaddr_storage
 {
   sa_family_t ss_family;      /* Address family, etc.  */
   __ss_aligntype __ss_align;  /* Force desired alignment.  */
   char __ss_padding[_SS_PADSIZE];
 };
 struct sockaddr_storage
 {
   sa_family_t ss_family;      /* Address family, etc.  */
   __ss_aligntype __ss_align;  /* Force desired alignment.  */
   char __ss_padding[_SS_PADSIZE];
 };
+#  define GNULIB_defined_struct_sockaddr_storage 1
+# endif
+
 #endif
 
 #if @HAVE_SYS_SOCKET_H@
 #endif
 
 #if @HAVE_SYS_SOCKET_H@
@@ -159,7 +166,10 @@ struct sockaddr_storage
 #  include <sys/types.h>
 #  include <io.h>
 
 #  include <sys/types.h>
 #  include <io.h>
 
+#  if !GNULIB_defined_socklen_t
 typedef int socklen_t;
 typedef int socklen_t;
+#   define GNULIB_defined_socklen_t 1
+#  endif
 
 # endif
 
 
 # endif
 
@@ -167,6 +177,8 @@ typedef int socklen_t;
 
 #if @HAVE_WINSOCK2_H@
 
 
 #if @HAVE_WINSOCK2_H@
 
+# if !GNULIB_defined_rpl_fd_isset
+
 /* Re-define FD_ISSET to avoid a WSA call while we are not using
    network sockets.  */
 static inline int
 /* Re-define FD_ISSET to avoid a WSA call while we are not using
    network sockets.  */
 static inline int
@@ -183,6 +195,9 @@ rpl_fd_isset (SOCKET fd, fd_set * set)
   return 0;
 }
 
   return 0;
 }
 
+#  define GNULIB_defined_rpl_fd_isset 1
+# endif
+
 # undef FD_ISSET
 # define FD_ISSET(fd, set) rpl_fd_isset(fd, set)
 
 # undef FD_ISSET
 # define FD_ISSET(fd, set) rpl_fd_isset(fd, set)
 
@@ -245,8 +260,11 @@ _GL_FUNCDECL_RPL (connect, int,
 _GL_CXXALIAS_RPL (connect, int,
                   (int fd, const struct sockaddr *addr, socklen_t addrlen));
 # else
 _GL_CXXALIAS_RPL (connect, int,
                   (int fd, const struct sockaddr *addr, socklen_t addrlen));
 # else
-_GL_CXXALIAS_SYS (connect, int,
-                  (int fd, const struct sockaddr *addr, socklen_t addrlen));
+/* Need to cast, because on NonStop Kernel, the third parameter is
+                                                     size_t addrlen.  */
+_GL_CXXALIAS_SYS_CAST (connect, int,
+                       (int fd,
+                        const struct sockaddr *addr, socklen_t addrlen));
 # endif
 _GL_CXXALIASWARN (connect);
 #elif @HAVE_WINSOCK2_H@
 # endif
 _GL_CXXALIASWARN (connect);
 #elif @HAVE_WINSOCK2_H@
@@ -300,8 +318,11 @@ _GL_FUNCDECL_RPL (bind, int,
 _GL_CXXALIAS_RPL (bind, int,
                   (int fd, const struct sockaddr *addr, socklen_t addrlen));
 # else
 _GL_CXXALIAS_RPL (bind, int,
                   (int fd, const struct sockaddr *addr, socklen_t addrlen));
 # else
-_GL_CXXALIAS_SYS (bind, int,
-                  (int fd, const struct sockaddr *addr, socklen_t addrlen));
+/* Need to cast, because on NonStop Kernel, the third parameter is
+                                                     size_t addrlen.  */
+_GL_CXXALIAS_SYS_CAST (bind, int,
+                       (int fd,
+                        const struct sockaddr *addr, socklen_t addrlen));
 # endif
 _GL_CXXALIASWARN (bind);
 #elif @HAVE_WINSOCK2_H@
 # endif
 _GL_CXXALIASWARN (bind);
 #elif @HAVE_WINSOCK2_H@
@@ -522,9 +543,11 @@ _GL_CXXALIAS_RPL (sendto, ssize_t,
                   (int fd, const void *buf, size_t len, int flags,
                    const struct sockaddr *to, socklen_t tolen));
 # else
                   (int fd, const void *buf, size_t len, int flags,
                    const struct sockaddr *to, socklen_t tolen));
 # else
-_GL_CXXALIAS_SYS (sendto, ssize_t,
-                  (int fd, const void *buf, size_t len, int flags,
-                   const struct sockaddr *to, socklen_t tolen));
+/* Need to cast, because on NonStop Kernel, the sixth parameter is
+                                                   size_t tolen.  */
+_GL_CXXALIAS_SYS_CAST (sendto, ssize_t,
+                       (int fd, const void *buf, size_t len, int flags,
+                        const struct sockaddr *to, socklen_t tolen));
 # endif
 _GL_CXXALIASWARN (sendto);
 #elif @HAVE_WINSOCK2_H@
 # endif
 _GL_CXXALIASWARN (sendto);
 #elif @HAVE_WINSOCK2_H@
@@ -550,8 +573,11 @@ _GL_FUNCDECL_RPL (setsockopt, int, (int fd, int level, int optname,
 _GL_CXXALIAS_RPL (setsockopt, int, (int fd, int level, int optname,
                                     const void * optval, socklen_t optlen));
 # else
 _GL_CXXALIAS_RPL (setsockopt, int, (int fd, int level, int optname,
                                     const void * optval, socklen_t optlen));
 # else
-_GL_CXXALIAS_SYS (setsockopt, int, (int fd, int level, int optname,
-                                    const void * optval, socklen_t optlen));
+/* Need to cast, because on NonStop Kernel, the fifth parameter is
+                                             size_t optlen.  */
+_GL_CXXALIAS_SYS_CAST (setsockopt, int,
+                       (int fd, int level, int optname,
+                        const void * optval, socklen_t optlen));
 # endif
 _GL_CXXALIASWARN (setsockopt);
 #elif @HAVE_WINSOCK2_H@
 # endif
 _GL_CXXALIASWARN (setsockopt);
 #elif @HAVE_WINSOCK2_H@
index f969ab9..3755e4e 100644 (file)
@@ -1,5 +1,5 @@
 /* Provide a more complete sys/stat header file.
 /* Provide a more complete sys/stat header file.
-   Copyright (C) 2005-2010 Free Software Foundation, Inc.
+   Copyright (C) 2005-2011 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
 
    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
@@ -461,11 +461,14 @@ _GL_CXXALIAS_RPL (mkdir, int, (char const *name, mode_t mode));
    which are included above.  */
 # if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
 
    which are included above.  */
 # if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
 
+#  if !GNULIB_defined_rpl_mkdir
 static inline int
 rpl_mkdir (char const *name, mode_t mode)
 {
   return _mkdir (name);
 }
 static inline int
 rpl_mkdir (char const *name, mode_t mode)
 {
   return _mkdir (name);
 }
+#   define GNULIB_defined_rpl_mkdir 1
+#  endif
 
 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #   define mkdir rpl_mkdir
 
 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #   define mkdir rpl_mkdir
diff --git a/lib/sys_time.in.h b/lib/sys_time.in.h
new file mode 100644 (file)
index 0000000..1dbc0f2
--- /dev/null
@@ -0,0 +1,101 @@
+/* Provide a more complete sys/time.h.
+
+   Copyright (C) 2007-2011 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, 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.  */
+
+/* Written by Paul Eggert.  */
+
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+@PRAGMA_COLUMNS@
+
+#if defined _GL_SYS_TIME_H
+
+/* Simply delegate to the system's header, without adding anything.  */
+# if @HAVE_SYS_TIME_H@
+#  @INCLUDE_NEXT@ @NEXT_SYS_TIME_H@
+# endif
+
+#else
+
+# define _GL_SYS_TIME_H
+
+# if @HAVE_SYS_TIME_H@
+#  @INCLUDE_NEXT@ @NEXT_SYS_TIME_H@
+# else
+#  include <time.h>
+# endif
+
+/* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
+
+/* The definition of _GL_ARG_NONNULL is copied here.  */
+
+/* The definition of _GL_WARN_ON_USE is copied here.  */
+
+# ifdef __cplusplus
+extern "C" {
+# endif
+
+# if ! @HAVE_STRUCT_TIMEVAL@
+
+#  if !GNULIB_defined_struct_timeval
+struct timeval
+{
+  time_t tv_sec;
+  long int tv_usec;
+};
+#   define GNULIB_defined_struct_timeval 1
+#  endif
+
+# endif
+
+# ifdef __cplusplus
+}
+# endif
+
+# if @GNULIB_GETTIMEOFDAY@
+#  if @REPLACE_GETTIMEOFDAY@
+#   if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#    undef gettimeofday
+#    define gettimeofday rpl_gettimeofday
+#   endif
+_GL_FUNCDECL_RPL (gettimeofday, int,
+                  (struct timeval *restrict, void *restrict)
+                  _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (gettimeofday, int,
+                  (struct timeval *restrict, void *restrict));
+#  else
+#   if !@HAVE_GETTIMEOFDAY@
+_GL_FUNCDECL_SYS (gettimeofday, int,
+                  (struct timeval *restrict, void *restrict)
+                  _GL_ARG_NONNULL ((1)));
+#   endif
+/* Need to cast, because on glibc systems, by default, the second argument is
+                                                  struct timezone *.  */
+_GL_CXXALIAS_SYS_CAST (gettimeofday, int,
+                       (struct timeval *restrict, void *restrict));
+#  endif
+_GL_CXXALIASWARN (gettimeofday);
+# elif defined GNULIB_POSIXCHECK
+#  undef gettimeofday
+#  if HAVE_RAW_DECL_GETTIMEOFDAY
+_GL_WARN_ON_USE (gettimeofday, "gettimeofday is unportable - "
+                 "use gnulib module gettimeofday for portability");
+#  endif
+# endif
+
+#endif /* _GL_SYS_TIME_H */
index e2974cd..afccc78 100644 (file)
@@ -1,6 +1,6 @@
 /* A more-standard <time.h>.
 
 /* A more-standard <time.h>.
 
-   Copyright (C) 2007-2010 Free Software Foundation, Inc.
+   Copyright (C) 2007-2011 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
 
    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
 extern "C" {
 #   endif
 
 extern "C" {
 #   endif
 
-#   undef timespec
-#   define timespec rpl_timespec
+#   if !GNULIB_defined_struct_timespec
+#    undef timespec
+#    define timespec rpl_timespec
 struct timespec
 {
   time_t tv_sec;
   long int tv_nsec;
 };
 struct timespec
 {
   time_t tv_sec;
   long int tv_nsec;
 };
+#    define GNULIB_defined_struct_timespec 1
+#   endif
 
 #   ifdef __cplusplus
 }
 
 #   ifdef __cplusplus
 }
@@ -84,6 +87,7 @@ struct timespec
 #  endif
 # endif
 
 #  endif
 # endif
 
+# if !GNULIB_defined_struct_time_t_must_be_integral
 /* Per http://austingroupbugs.net/view.php?id=327, POSIX requires
    time_t to be an integer type, even though C99 permits floating
    point.  We don't know of any implementation that uses floating
 /* Per http://austingroupbugs.net/view.php?id=327, POSIX requires
    time_t to be an integer type, even though C99 permits floating
    point.  We don't know of any implementation that uses floating
@@ -92,6 +96,8 @@ struct timespec
 struct __time_t_must_be_integral {
   unsigned int __floating_time_t_unsupported : (time_t) 1;
 };
 struct __time_t_must_be_integral {
   unsigned int __floating_time_t_unsupported : (time_t) 1;
 };
+#  define GNULIB_defined_struct_time_t_must_be_integral 1
+# endif
 
 /* Sleep for at least RQTP seconds unless interrupted,  If interrupted,
    return -1 and store the remaining time into RMTP.  See
 
 /* Sleep for at least RQTP seconds unless interrupted,  If interrupted,
    return -1 and store the remaining time into RMTP.  See
@@ -147,7 +153,7 @@ _GL_FUNCDECL_RPL (localtime_r, struct tm *, (time_t const *restrict __timer,
 _GL_CXXALIAS_RPL (localtime_r, struct tm *, (time_t const *restrict __timer,
                                              struct tm *restrict __result));
 #  else
 _GL_CXXALIAS_RPL (localtime_r, struct tm *, (time_t const *restrict __timer,
                                              struct tm *restrict __result));
 #  else
-#   if ! @HAVE_LOCALTIME_R@
+#   if ! @HAVE_DECL_LOCALTIME_R@
 _GL_FUNCDECL_SYS (localtime_r, struct tm *, (time_t const *restrict __timer,
                                              struct tm *restrict __result)
                                             _GL_ARG_NONNULL ((1, 2)));
 _GL_FUNCDECL_SYS (localtime_r, struct tm *, (time_t const *restrict __timer,
                                              struct tm *restrict __result)
                                             _GL_ARG_NONNULL ((1, 2)));
@@ -155,7 +161,9 @@ _GL_FUNCDECL_SYS (localtime_r, struct tm *, (time_t const *restrict __timer,
 _GL_CXXALIAS_SYS (localtime_r, struct tm *, (time_t const *restrict __timer,
                                              struct tm *restrict __result));
 #  endif
 _GL_CXXALIAS_SYS (localtime_r, struct tm *, (time_t const *restrict __timer,
                                              struct tm *restrict __result));
 #  endif
+#  if @HAVE_DECL_LOCALTIME_R@
 _GL_CXXALIASWARN (localtime_r);
 _GL_CXXALIASWARN (localtime_r);
+#  endif
 #  if @REPLACE_LOCALTIME_R@
 #   if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #    undef gmtime_r
 #  if @REPLACE_LOCALTIME_R@
 #   if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #    undef gmtime_r
@@ -167,7 +175,7 @@ _GL_FUNCDECL_RPL (gmtime_r, struct tm *, (time_t const *restrict __timer,
 _GL_CXXALIAS_RPL (gmtime_r, struct tm *, (time_t const *restrict __timer,
                                           struct tm *restrict __result));
 #  else
 _GL_CXXALIAS_RPL (gmtime_r, struct tm *, (time_t const *restrict __timer,
                                           struct tm *restrict __result));
 #  else
-#   if ! @HAVE_LOCALTIME_R@
+#   if ! @HAVE_DECL_LOCALTIME_R@
 _GL_FUNCDECL_SYS (gmtime_r, struct tm *, (time_t const *restrict __timer,
                                           struct tm *restrict __result)
                                          _GL_ARG_NONNULL ((1, 2)));
 _GL_FUNCDECL_SYS (gmtime_r, struct tm *, (time_t const *restrict __timer,
                                           struct tm *restrict __result)
                                          _GL_ARG_NONNULL ((1, 2)));
@@ -175,7 +183,9 @@ _GL_FUNCDECL_SYS (gmtime_r, struct tm *, (time_t const *restrict __timer,
 _GL_CXXALIAS_SYS (gmtime_r, struct tm *, (time_t const *restrict __timer,
                                           struct tm *restrict __result));
 #  endif
 _GL_CXXALIAS_SYS (gmtime_r, struct tm *, (time_t const *restrict __timer,
                                           struct tm *restrict __result));
 #  endif
+#  if @HAVE_DECL_LOCALTIME_R@
 _GL_CXXALIASWARN (gmtime_r);
 _GL_CXXALIASWARN (gmtime_r);
+#  endif
 # endif
 
 /* Parse BUF as a time stamp, assuming FORMAT specifies its layout, and store
 # endif
 
 /* Parse BUF as a time stamp, assuming FORMAT specifies its layout, and store
index a3c29c6..383c9d0 100644 (file)
@@ -1,6 +1,6 @@
 /* Reentrant time functions like localtime_r.
 
 /* Reentrant time functions like localtime_r.
 
-   Copyright (C) 2003, 2006-2007, 2010 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2006-2007, 2010-2011 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
 
    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
diff --git a/lib/trunc.c b/lib/trunc.c
new file mode 100644 (file)
index 0000000..f213b26
--- /dev/null
@@ -0,0 +1,113 @@
+/* Round towards zero.
+   Copyright (C) 2007, 2010-2011 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 3 of the License, 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, see <http://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include <math.h>
+
+#include <float.h>
+
+#undef MIN
+
+#ifdef USE_LONG_DOUBLE
+# define FUNC truncl
+# define DOUBLE long double
+# define MANT_DIG LDBL_MANT_DIG
+# define MIN LDBL_MIN
+# define L_(literal) literal##L
+#elif ! defined USE_FLOAT
+# define FUNC trunc
+# define DOUBLE double
+# define MANT_DIG DBL_MANT_DIG
+# define MIN DBL_MIN
+# define L_(literal) literal
+#else /* defined USE_FLOAT */
+# define FUNC truncf
+# define DOUBLE float
+# define MANT_DIG FLT_MANT_DIG
+# define MIN FLT_MIN
+# define L_(literal) literal##f
+#endif
+
+/* -0.0.  See minus-zero.h.  */
+#if defined __hpux || defined __sgi || defined __ICC
+# define MINUS_ZERO (-MIN * MIN)
+#else
+# define MINUS_ZERO L_(-0.0)
+#endif
+
+/* 2^(MANT_DIG-1).  */
+static const DOUBLE TWO_MANT_DIG =
+  /* Assume MANT_DIG <= 5 * 31.
+     Use the identity
+       n = floor(n/5) + floor((n+1)/5) + ... + floor((n+4)/5).  */
+  (DOUBLE) (1U << ((MANT_DIG - 1) / 5))
+  * (DOUBLE) (1U << ((MANT_DIG - 1 + 1) / 5))
+  * (DOUBLE) (1U << ((MANT_DIG - 1 + 2) / 5))
+  * (DOUBLE) (1U << ((MANT_DIG - 1 + 3) / 5))
+  * (DOUBLE) (1U << ((MANT_DIG - 1 + 4) / 5));
+
+DOUBLE
+FUNC (DOUBLE x)
+{
+  /* The use of 'volatile' guarantees that excess precision bits are dropped
+     at each addition step and before the following comparison at the caller's
+     site.  It is necessary on x86 systems where double-floats are not IEEE
+     compliant by default, to avoid that the results become platform and compiler
+     option dependent.  'volatile' is a portable alternative to gcc's
+     -ffloat-store option.  */
+  volatile DOUBLE y = x;
+  volatile DOUBLE z = y;
+
+  if (z > L_(0.0))
+    {
+      /* For 0 < x < 1, return +0.0 even if the current rounding mode is
+         FE_DOWNWARD.  */
+      if (z < L_(1.0))
+        z = L_(0.0);
+      /* Avoid rounding errors for values near 2^k, where k >= MANT_DIG-1.  */
+      else if (z < TWO_MANT_DIG)
+        {
+          /* Round to the next integer (nearest or up or down, doesn't matter).  */
+          z += TWO_MANT_DIG;
+          z -= TWO_MANT_DIG;
+          /* Enforce rounding down.  */
+          if (z > y)
+            z -= L_(1.0);
+        }
+    }
+  else if (z < L_(0.0))
+    {
+      /* For -1 < x < 0, return -0.0 regardless of the current rounding
+         mode.  */
+      if (z > L_(-1.0))
+        z = MINUS_ZERO;
+      /* Avoid rounding errors for values near -2^k, where k >= MANT_DIG-1.  */
+      else if (z > - TWO_MANT_DIG)
+        {
+          /* Round to the next integer (nearest or up or down, doesn't matter).  */
+          z -= TWO_MANT_DIG;
+          z += TWO_MANT_DIG;
+          /* Enforce rounding up.  */
+          if (z < y)
+            z += L_(1.0);
+        }
+    }
+  return z;
+}
index 0a4fa6b..adc9b24 100644 (file)
@@ -1,5 +1,5 @@
 /* Substitute for and wrapper around <unistd.h>.
 /* Substitute for and wrapper around <unistd.h>.
-   Copyright (C) 2003-2010 Free Software Foundation, Inc.
+   Copyright (C) 2003-2011 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
 
    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 <io.h>
 #endif
 
 # include <io.h>
 #endif
 
-/* AIX and OSF/1 5.1 declare getdomainname in <netdb.h>, not in <unistd.h>.  */
+/* AIX and OSF/1 5.1 declare getdomainname in <netdb.h>, not in <unistd.h>.
+   NonStop Kernel declares gethostname in <netdb.h>, not in <unistd.h>.  */
 /* But avoid namespace pollution on glibc systems.  */
 /* But avoid namespace pollution on glibc systems.  */
-#if @GNULIB_GETDOMAINNAME@ && (defined _AIX || defined __osf__) \
+#if ((@GNULIB_GETDOMAINNAME@ && (defined _AIX || defined __osf__)) \
+     || (@GNULIB_GETHOSTNAME@ && defined __TANDEM)) \
     && !defined __GLIBC__
 # include <netdb.h>
 #endif
     && !defined __GLIBC__
 # include <netdb.h>
 #endif
@@ -712,13 +714,22 @@ _GL_WARN_ON_USE (getlogin, "getlogin is unportable - "
      ${LOGNAME-$USER}        on Unix platforms,
      $USERNAME               on native Windows platforms.
  */
      ${LOGNAME-$USER}        on Unix platforms,
      $USERNAME               on native Windows platforms.
  */
-# if !@HAVE_DECL_GETLOGIN_R@
+# if @REPLACE_GETLOGIN_R@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define getlogin_r rpl_getlogin_r
+#  endif
+_GL_FUNCDECL_RPL (getlogin_r, int, (char *name, size_t size)
+                                   _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (getlogin_r, int, (char *name, size_t size));
+# else
+#  if !@HAVE_DECL_GETLOGIN_R@
 _GL_FUNCDECL_SYS (getlogin_r, int, (char *name, size_t size)
                                    _GL_ARG_NONNULL ((1)));
 _GL_FUNCDECL_SYS (getlogin_r, int, (char *name, size_t size)
                                    _GL_ARG_NONNULL ((1)));
-# endif
+#  endif
 /* Need to cast, because on Solaris 10 systems, the second argument is
                                                      int size.  */
 _GL_CXXALIAS_SYS_CAST (getlogin_r, int, (char *name, size_t size));
 /* Need to cast, because on Solaris 10 systems, the second argument is
                                                      int size.  */
 _GL_CXXALIAS_SYS_CAST (getlogin_r, int, (char *name, size_t size));
+# endif
 _GL_CXXALIASWARN (getlogin_r);
 #elif defined GNULIB_POSIXCHECK
 # undef getlogin_r
 _GL_CXXALIASWARN (getlogin_r);
 #elif defined GNULIB_POSIXCHECK
 # undef getlogin_r
@@ -785,11 +796,14 @@ _GL_CXXALIAS_RPL (getpagesize, int, (void));
 #    if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #     define getpagesize() _gl_getpagesize ()
 #    else
 #    if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #     define getpagesize() _gl_getpagesize ()
 #    else
+#     if !GNULIB_defined_getpagesize_function
 static inline int
 getpagesize ()
 {
   return _gl_getpagesize ();
 }
 static inline int
 getpagesize ()
 {
   return _gl_getpagesize ();
 }
+#      define GNULIB_defined_getpagesize_function 1
+#     endif
 #    endif
 #   endif
 #  endif
 #    endif
 #   endif
 #  endif
index 2164d9d..c665aa8 100644 (file)
@@ -1,5 +1,5 @@
 /* Elementary Unicode string functions.
 /* Elementary Unicode string functions.
-   Copyright (C) 2001-2002, 2005-2010 Free Software Foundation, Inc.
+   Copyright (C) 2001-2002, 2005-2011 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
 
    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
@@ -134,7 +134,7 @@ extern int
 /* The variants with _safe suffix are safe, even if the library is compiled
    without --enable-safety.  */
 
 /* The variants with _safe suffix are safe, even if the library is compiled
    without --enable-safety.  */
 
-#if defined GNULIB_UNISTR_U8_MBTOUC_UNSAFE || HAVE_LIBUNISTRING
+#if GNULIB_UNISTR_U8_MBTOUC_UNSAFE || HAVE_LIBUNISTRING
 # if !HAVE_INLINE
 extern int
        u8_mbtouc_unsafe (ucs4_t *puc, const uint8_t *s, size_t n);
 # if !HAVE_INLINE
 extern int
        u8_mbtouc_unsafe (ucs4_t *puc, const uint8_t *s, size_t n);
@@ -157,7 +157,7 @@ u8_mbtouc_unsafe (ucs4_t *puc, const uint8_t *s, size_t n)
 # endif
 #endif
 
 # endif
 #endif
 
-#if defined GNULIB_UNISTR_U16_MBTOUC_UNSAFE || HAVE_LIBUNISTRING
+#if GNULIB_UNISTR_U16_MBTOUC_UNSAFE || HAVE_LIBUNISTRING
 # if !HAVE_INLINE
 extern int
        u16_mbtouc_unsafe (ucs4_t *puc, const uint16_t *s, size_t n);
 # if !HAVE_INLINE
 extern int
        u16_mbtouc_unsafe (ucs4_t *puc, const uint16_t *s, size_t n);
@@ -180,7 +180,7 @@ u16_mbtouc_unsafe (ucs4_t *puc, const uint16_t *s, size_t n)
 # endif
 #endif
 
 # endif
 #endif
 
-#if defined GNULIB_UNISTR_U32_MBTOUC_UNSAFE || HAVE_LIBUNISTRING
+#if GNULIB_UNISTR_U32_MBTOUC_UNSAFE || HAVE_LIBUNISTRING
 # if !HAVE_INLINE
 extern int
        u32_mbtouc_unsafe (ucs4_t *puc, const uint32_t *s, size_t n);
 # if !HAVE_INLINE
 extern int
        u32_mbtouc_unsafe (ucs4_t *puc, const uint32_t *s, size_t n);
@@ -191,11 +191,11 @@ u32_mbtouc_unsafe (ucs4_t *puc,
 {
   uint32_t c = *s;
 
 {
   uint32_t c = *s;
 
-#  ifdef CONFIG_UNICODE_SAFETY
+#  if CONFIG_UNICODE_SAFETY
   if (c < 0xd800 || (c >= 0xe000 && c < 0x110000))
 #  endif
     *puc = c;
   if (c < 0xd800 || (c >= 0xe000 && c < 0x110000))
 #  endif
     *puc = c;
-#  ifdef CONFIG_UNICODE_SAFETY
+#  if CONFIG_UNICODE_SAFETY
   else
     /* invalid multibyte character */
     *puc = 0xfffd;
   else
     /* invalid multibyte character */
     *puc = 0xfffd;
@@ -205,7 +205,7 @@ u32_mbtouc_unsafe (ucs4_t *puc,
 # endif
 #endif
 
 # endif
 #endif
 
-#if defined GNULIB_UNISTR_U8_MBTOUC || HAVE_LIBUNISTRING
+#if GNULIB_UNISTR_U8_MBTOUC || HAVE_LIBUNISTRING
 # if !HAVE_INLINE
 extern int
        u8_mbtouc (ucs4_t *puc, const uint8_t *s, size_t n);
 # if !HAVE_INLINE
 extern int
        u8_mbtouc (ucs4_t *puc, const uint8_t *s, size_t n);
@@ -228,7 +228,7 @@ u8_mbtouc (ucs4_t *puc, const uint8_t *s, size_t n)
 # endif
 #endif
 
 # endif
 #endif
 
-#if defined GNULIB_UNISTR_U16_MBTOUC || HAVE_LIBUNISTRING
+#if GNULIB_UNISTR_U16_MBTOUC || HAVE_LIBUNISTRING
 # if !HAVE_INLINE
 extern int
        u16_mbtouc (ucs4_t *puc, const uint16_t *s, size_t n);
 # if !HAVE_INLINE
 extern int
        u16_mbtouc (ucs4_t *puc, const uint16_t *s, size_t n);
@@ -251,7 +251,7 @@ u16_mbtouc (ucs4_t *puc, const uint16_t *s, size_t n)
 # endif
 #endif
 
 # endif
 #endif
 
-#if defined GNULIB_UNISTR_U32_MBTOUC || HAVE_LIBUNISTRING
+#if GNULIB_UNISTR_U32_MBTOUC || HAVE_LIBUNISTRING
 # if !HAVE_INLINE
 extern int
        u32_mbtouc (ucs4_t *puc, const uint32_t *s, size_t n);
 # if !HAVE_INLINE
 extern int
        u32_mbtouc (ucs4_t *puc, const uint32_t *s, size_t n);
@@ -279,17 +279,17 @@ u32_mbtouc (ucs4_t *puc, const uint32_t *s, size_t n _GL_UNUSED_PARAMETER)
 /* Similar to u*_mbtouc(), except that the return value gives more details
    about the failure, similar to mbrtowc().  */
 
 /* Similar to u*_mbtouc(), except that the return value gives more details
    about the failure, similar to mbrtowc().  */
 
-#if defined GNULIB_UNISTR_U8_MBTOUCR || HAVE_LIBUNISTRING
+#if GNULIB_UNISTR_U8_MBTOUCR || HAVE_LIBUNISTRING
 extern int
        u8_mbtoucr (ucs4_t *puc, const uint8_t *s, size_t n);
 #endif
 
 extern int
        u8_mbtoucr (ucs4_t *puc, const uint8_t *s, size_t n);
 #endif
 
-#if defined GNULIB_UNISTR_U16_MBTOUCR || HAVE_LIBUNISTRING
+#if GNULIB_UNISTR_U16_MBTOUCR || HAVE_LIBUNISTRING
 extern int
        u16_mbtoucr (ucs4_t *puc, const uint16_t *s, size_t n);
 #endif
 
 extern int
        u16_mbtoucr (ucs4_t *puc, const uint16_t *s, size_t n);
 #endif
 
-#if defined GNULIB_UNISTR_U32_MBTOUCR || HAVE_LIBUNISTRING
+#if GNULIB_UNISTR_U32_MBTOUCR || HAVE_LIBUNISTRING
 extern int
        u32_mbtoucr (ucs4_t *puc, const uint32_t *s, size_t n);
 #endif
 extern int
        u32_mbtoucr (ucs4_t *puc, const uint32_t *s, size_t n);
 #endif
@@ -300,7 +300,7 @@ extern int
 /* Similar to wctomb(), except that s must not be NULL, and the argument n
    must be specified.  */
 
 /* Similar to wctomb(), except that s must not be NULL, and the argument n
    must be specified.  */
 
-#if defined GNULIB_UNISTR_U8_UCTOMB || HAVE_LIBUNISTRING
+#if GNULIB_UNISTR_U8_UCTOMB || HAVE_LIBUNISTRING
 /* Auxiliary function, also used by u8_chr, u8_strchr, u8_strrchr.  */
 extern int
        u8_uctomb_aux (uint8_t *s, ucs4_t uc, int n);
 /* Auxiliary function, also used by u8_chr, u8_strchr, u8_strrchr.  */
 extern int
        u8_uctomb_aux (uint8_t *s, ucs4_t uc, int n);
@@ -322,7 +322,7 @@ u8_uctomb (uint8_t *s, ucs4_t uc, int n)
 # endif
 #endif
 
 # endif
 #endif
 
-#if defined GNULIB_UNISTR_U16_UCTOMB || HAVE_LIBUNISTRING
+#if GNULIB_UNISTR_U16_UCTOMB || HAVE_LIBUNISTRING
 /* Auxiliary function, also used by u16_chr, u16_strchr, u16_strrchr.  */
 extern int
        u16_uctomb_aux (uint16_t *s, ucs4_t uc, int n);
 /* Auxiliary function, also used by u16_chr, u16_strchr, u16_strrchr.  */
 extern int
        u16_uctomb_aux (uint16_t *s, ucs4_t uc, int n);
@@ -344,7 +344,7 @@ u16_uctomb (uint16_t *s, ucs4_t uc, int n)
 # endif
 #endif
 
 # endif
 #endif
 
-#if defined GNULIB_UNISTR_U32_UCTOMB || HAVE_LIBUNISTRING
+#if GNULIB_UNISTR_U32_UCTOMB || HAVE_LIBUNISTRING
 # if !HAVE_INLINE
 extern int
        u32_uctomb (uint32_t *s, ucs4_t uc, int n);
 # if !HAVE_INLINE
 extern int
        u32_uctomb (uint32_t *s, ucs4_t uc, int n);
index 3786802..1ac2957 100644 (file)
@@ -1,5 +1,5 @@
 /* Conversion UTF-8 to UCS-4.
 /* Conversion UTF-8 to UCS-4.
-   Copyright (C) 2001-2002, 2006-2007, 2009-2010 Free Software Foundation, Inc.
+   Copyright (C) 2001-2002, 2006-2007, 2009-2011 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2001.
 
    This program is free software: you can redistribute it and/or modify it
    Written by Bruno Haible <bruno@clisp.org>, 2001.
 
    This program is free software: you can redistribute it and/or modify it
index 1965e96..deea151 100644 (file)
@@ -1,5 +1,5 @@
 /* Conversion UTF-8 to UCS-4.
 /* Conversion UTF-8 to UCS-4.
-   Copyright (C) 2001-2002, 2006-2007, 2009-2010 Free Software Foundation, Inc.
+   Copyright (C) 2001-2002, 2006-2007, 2009-2011 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2001.
 
    This program is free software: you can redistribute it and/or modify it
    Written by Bruno Haible <bruno@clisp.org>, 2001.
 
    This program is free software: you can redistribute it and/or modify it
index 16af8f9..b298925 100644 (file)
@@ -1,5 +1,5 @@
 /* Look at first character in UTF-8 string.
 /* Look at first character in UTF-8 string.
-   Copyright (C) 1999-2002, 2006-2007, 2009-2010 Free Software Foundation, Inc.
+   Copyright (C) 1999-2002, 2006-2007, 2009-2011 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2001.
 
    This program is free software: you can redistribute it and/or modify it
    Written by Bruno Haible <bruno@clisp.org>, 2001.
 
    This program is free software: you can redistribute it and/or modify it
index 2ddd864..a62539e 100644 (file)
@@ -1,5 +1,5 @@
 /* Look at first character in UTF-8 string.
 /* Look at first character in UTF-8 string.
-   Copyright (C) 1999-2002, 2006-2007, 2009-2010 Free Software Foundation, Inc.
+   Copyright (C) 1999-2002, 2006-2007, 2009-2011 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2001.
 
    This program is free software: you can redistribute it and/or modify it
    Written by Bruno Haible <bruno@clisp.org>, 2001.
 
    This program is free software: you can redistribute it and/or modify it
index a749c48..ffcc134 100644 (file)
@@ -1,5 +1,5 @@
 /* Look at first character in UTF-8 string, returning an error code.
 /* Look at first character in UTF-8 string, returning an error code.
-   Copyright (C) 1999-2002, 2006-2007, 2009-2010 Free Software Foundation, Inc.
+   Copyright (C) 1999-2002, 2006-2007, 2009-2011 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2001.
 
    This program is free software: you can redistribute it and/or modify it
    Written by Bruno Haible <bruno@clisp.org>, 2001.
 
    This program is free software: you can redistribute it and/or modify it
index 47f89b4..29118d6 100644 (file)
@@ -1,5 +1,5 @@
 /* Iterate over previous character in UTF-8 string.
 /* Iterate over previous character in UTF-8 string.
-   Copyright (C) 2002, 2006-2007, 2009-2010 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2006-2007, 2009-2011 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2002.
 
    This program is free software: you can redistribute it and/or modify it
    Written by Bruno Haible <bruno@clisp.org>, 2002.
 
    This program is free software: you can redistribute it and/or modify it
index 695921d..2014c8c 100644 (file)
@@ -1,5 +1,5 @@
 /* Conversion UCS-4 to UTF-8.
 /* Conversion UCS-4 to UTF-8.
-   Copyright (C) 2002, 2006-2007, 2009-2010 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2006-2007, 2009-2011 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2002.
 
    This program is free software: you can redistribute it and/or modify it
    Written by Bruno Haible <bruno@clisp.org>, 2002.
 
    This program is free software: you can redistribute it and/or modify it
index fd33c05..65a4053 100644 (file)
@@ -1,5 +1,5 @@
 /* Store a character in UTF-8 string.
 /* Store a character in UTF-8 string.
-   Copyright (C) 2002, 2005-2006, 2009-2010 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2005-2006, 2009-2011 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2002.
 
    This program is free software: you can redistribute it and/or modify it
    Written by Bruno Haible <bruno@clisp.org>, 2002.
 
    This program is free software: you can redistribute it and/or modify it
index 3e524f8..e78c97d 100644 (file)
@@ -1,5 +1,5 @@
 /* Elementary types for the GNU UniString library.
 /* Elementary types for the GNU UniString library.
-   Copyright (C) 2002, 2005-2006, 2009-2010 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2005-2006, 2009-2011 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
 
    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
index 13e0ebc..cad862f 100644 (file)
@@ -1,5 +1,5 @@
 /* vsprintf with automatic memory allocation.
 /* vsprintf with automatic memory allocation.
-   Copyright (C) 1999, 2002-2010 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2002-2011 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
 
    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
@@ -1753,8 +1753,9 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
     return NULL;
 
 #define CLEANUP() \
     return NULL;
 
 #define CLEANUP() \
-  free (d.dir);                                                         \
-  if (a.arg)                                                            \
+  if (d.dir != d.direct_alloc_dir)                                      \
+    free (d.dir);                                                       \
+  if (a.arg != a.direct_alloc_arg)                                      \
     free (a.arg);
 
   if (PRINTF_FETCHARGS (args, &a) < 0)
     free (a.arg);
 
   if (PRINTF_FETCHARGS (args, &a) < 0)
index b55faf5..7ae03da 100644 (file)
@@ -1,5 +1,5 @@
 /* vsprintf with automatic memory allocation.
 /* vsprintf with automatic memory allocation.
-   Copyright (C) 2002-2004, 2007-2010 Free Software Foundation, Inc.
+   Copyright (C) 2002-2004, 2007-2011 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
 
    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
index 9bd9cb8..a40d58a 100644 (file)
@@ -1,6 +1,6 @@
 /* Compile-time assert-like macros.
 
 /* Compile-time assert-like macros.
 
-   Copyright (C) 2005-2006, 2009-2010 Free Software Foundation, Inc.
+   Copyright (C) 2005-2006, 2009-2011 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
 
    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
index 926a696..17c8bc3 100644 (file)
@@ -1,5 +1,5 @@
 /* Variable with FSF copyright information, for version-etc.
 /* Variable with FSF copyright information, for version-etc.
-   Copyright (C) 1999-2006, 2009-2010 Free Software Foundation, Inc.
+   Copyright (C) 1999-2006, 2009-2011 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
 
    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
index 2648c9a..60c6f01 100644 (file)
@@ -1,5 +1,5 @@
 /* Print --version and bug-reporting information in a consistent format.
 /* Print --version and bug-reporting information in a consistent format.
-   Copyright (C) 1999-2010 Free Software Foundation, Inc.
+   Copyright (C) 1999-2011 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
 
    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
@@ -38,7 +38,7 @@
 # define PACKAGE PACKAGE_TARNAME
 #endif
 
 # define PACKAGE PACKAGE_TARNAME
 #endif
 
-enum { COPYRIGHT_YEAR = 2010 };
+enum { COPYRIGHT_YEAR = 2011 };
 
 /* The three functions below display the --version information the
    standard way.
 
 /* The three functions below display the --version information the
    standard way.
index 1cbbe32..9446dec 100644 (file)
@@ -1,5 +1,5 @@
 /* Print --version and bug-reporting information in a consistent format.
 /* Print --version and bug-reporting information in a consistent format.
-   Copyright (C) 1999, 2003, 2005, 2009-2010 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2003, 2005, 2009-2011 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
 
    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
index 35eba15..9abb7a9 100644 (file)
@@ -1,5 +1,5 @@
 /* Formatted output to strings.
 /* Formatted output to strings.
-   Copyright (C) 2004, 2006-2010 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2006-2011 Free Software Foundation, Inc.
    Written by Simon Josefsson and Yoann Vandoorselaere <yoann@prelude-ids.org>.
 
    This program is free software; you can redistribute it and/or modify
    Written by Simon Josefsson and Yoann Vandoorselaere <yoann@prelude-ids.org>.
 
    This program is free software; you can redistribute it and/or modify
index bc0845c..28b0f82 100644 (file)
@@ -1,6 +1,6 @@
 /* w32sock.h --- internal auxilliary functions for Windows socket functions
 
 /* w32sock.h --- internal auxilliary functions for Windows socket functions
 
-   Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
+   Copyright (C) 2008-2011 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
 
    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
index 0cd471a..4abc875 100644 (file)
@@ -1,6 +1,6 @@
 /* A substitute for ISO C99 <wchar.h>, for platforms that have issues.
 
 /* A substitute for ISO C99 <wchar.h>, for platforms that have issues.
 
-   Copyright (C) 2007-2010 Free Software Foundation, Inc.
+   Copyright (C) 2007-2011 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
 
    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
    On IRIX 6.5, sizeof (mbstate_t) == 1, which is not sufficient for
    implementing mbrtowc for encodings like UTF-8.  */
 #if !(@HAVE_MBSINIT@ && @HAVE_MBRTOWC@) || @REPLACE_MBSTATE_T@
    On IRIX 6.5, sizeof (mbstate_t) == 1, which is not sufficient for
    implementing mbrtowc for encodings like UTF-8.  */
 #if !(@HAVE_MBSINIT@ && @HAVE_MBRTOWC@) || @REPLACE_MBSTATE_T@
+# if !GNULIB_defined_mbstate_t
 typedef int rpl_mbstate_t;
 typedef int rpl_mbstate_t;
-# undef mbstate_t
-# define mbstate_t rpl_mbstate_t
-# define GNULIB_defined_mbstate_t 1
+#  undef mbstate_t
+#  define mbstate_t rpl_mbstate_t
+#  define GNULIB_defined_mbstate_t 1
+# endif
 #endif
 
 
 #endif
 
 
@@ -428,6 +430,493 @@ _GL_WARN_ON_USE (wcwidth, "wcwidth is unportable - "
 #endif
 
 
 #endif
 
 
+/* Search N wide characters of S for C.  */
+#if @GNULIB_WMEMCHR@
+# if !@HAVE_WMEMCHR@
+_GL_FUNCDECL_SYS (wmemchr, wchar_t *, (const wchar_t *s, wchar_t c, size_t n));
+# endif
+_GL_CXXALIAS_SYS (wmemchr, wchar_t *, (const wchar_t *s, wchar_t c, size_t n));
+_GL_CXXALIASWARN (wmemchr);
+#elif defined GNULIB_POSIXCHECK
+# undef wmemchr
+# if HAVE_RAW_DECL_WMEMCHR
+_GL_WARN_ON_USE (wmemchr, "wmemchr is unportable - "
+                 "use gnulib module wmemchr for portability");
+# endif
+#endif
+
+
+/* Compare N wide characters of S1 and S2.  */
+#if @GNULIB_WMEMCMP@
+# if !@HAVE_WMEMCMP@
+_GL_FUNCDECL_SYS (wmemcmp, int,
+                  (const wchar_t *s1, const wchar_t *s2, size_t n));
+# endif
+_GL_CXXALIAS_SYS (wmemcmp, int,
+                  (const wchar_t *s1, const wchar_t *s2, size_t n));
+_GL_CXXALIASWARN (wmemcmp);
+#elif defined GNULIB_POSIXCHECK
+# undef wmemcmp
+# if HAVE_RAW_DECL_WMEMCMP
+_GL_WARN_ON_USE (wmemcmp, "wmemcmp is unportable - "
+                 "use gnulib module wmemcmp for portability");
+# endif
+#endif
+
+
+/* Copy N wide characters of SRC to DEST.  */
+#if @GNULIB_WMEMCPY@
+# if !@HAVE_WMEMCPY@
+_GL_FUNCDECL_SYS (wmemcpy, wchar_t *,
+                  (wchar_t *dest, const wchar_t *src, size_t n));
+# endif
+_GL_CXXALIAS_SYS (wmemcpy, wchar_t *,
+                  (wchar_t *dest, const wchar_t *src, size_t n));
+_GL_CXXALIASWARN (wmemcpy);
+#elif defined GNULIB_POSIXCHECK
+# undef wmemcpy
+# if HAVE_RAW_DECL_WMEMCPY
+_GL_WARN_ON_USE (wmemcpy, "wmemcpy is unportable - "
+                 "use gnulib module wmemcpy for portability");
+# endif
+#endif
+
+
+/* Copy N wide characters of SRC to DEST, guaranteeing correct behavior for
+   overlapping memory areas.  */
+#if @GNULIB_WMEMMOVE@
+# if !@HAVE_WMEMMOVE@
+_GL_FUNCDECL_SYS (wmemmove, wchar_t *,
+                  (wchar_t *dest, const wchar_t *src, size_t n));
+# endif
+_GL_CXXALIAS_SYS (wmemmove, wchar_t *,
+                  (wchar_t *dest, const wchar_t *src, size_t n));
+_GL_CXXALIASWARN (wmemmove);
+#elif defined GNULIB_POSIXCHECK
+# undef wmemmove
+# if HAVE_RAW_DECL_WMEMMOVE
+_GL_WARN_ON_USE (wmemmove, "wmemmove is unportable - "
+                 "use gnulib module wmemmove for portability");
+# endif
+#endif
+
+
+/* Set N wide characters of S to C.  */
+#if @GNULIB_WMEMSET@
+# if !@HAVE_WMEMSET@
+_GL_FUNCDECL_SYS (wmemset, wchar_t *, (wchar_t *s, wchar_t c, size_t n));
+# endif
+_GL_CXXALIAS_SYS (wmemset, wchar_t *, (wchar_t *s, wchar_t c, size_t n));
+_GL_CXXALIASWARN (wmemset);
+#elif defined GNULIB_POSIXCHECK
+# undef wmemset
+# if HAVE_RAW_DECL_WMEMSET
+_GL_WARN_ON_USE (wmemset, "wmemset is unportable - "
+                 "use gnulib module wmemset for portability");
+# endif
+#endif
+
+
+/* Return the number of wide characters in S.  */
+#if @GNULIB_WCSLEN@
+# if !@HAVE_WCSLEN@
+_GL_FUNCDECL_SYS (wcslen, size_t, (const wchar_t *s));
+# endif
+_GL_CXXALIAS_SYS (wcslen, size_t, (const wchar_t *s));
+_GL_CXXALIASWARN (wcslen);
+#elif defined GNULIB_POSIXCHECK
+# undef wcslen
+# if HAVE_RAW_DECL_WCSLEN
+_GL_WARN_ON_USE (wcslen, "wcslen is unportable - "
+                 "use gnulib module wcslen for portability");
+# endif
+#endif
+
+
+/* Return the number of wide characters in S, but at most MAXLEN.  */
+#if @GNULIB_WCSNLEN@
+# if !@HAVE_WCSNLEN@
+_GL_FUNCDECL_SYS (wcsnlen, size_t, (const wchar_t *s, size_t maxlen));
+# endif
+_GL_CXXALIAS_SYS (wcsnlen, size_t, (const wchar_t *s, size_t maxlen));
+_GL_CXXALIASWARN (wcsnlen);
+#elif defined GNULIB_POSIXCHECK
+# undef wcsnlen
+# if HAVE_RAW_DECL_WCSNLEN
+_GL_WARN_ON_USE (wcsnlen, "wcsnlen is unportable - "
+                 "use gnulib module wcsnlen for portability");
+# endif
+#endif
+
+
+/* Copy SRC to DEST.  */
+#if @GNULIB_WCSCPY@
+# if !@HAVE_WCSCPY@
+_GL_FUNCDECL_SYS (wcscpy, wchar_t *, (wchar_t *dest, const wchar_t *src));
+# endif
+_GL_CXXALIAS_SYS (wcscpy, wchar_t *, (wchar_t *dest, const wchar_t *src));
+_GL_CXXALIASWARN (wcscpy);
+#elif defined GNULIB_POSIXCHECK
+# undef wcscpy
+# if HAVE_RAW_DECL_WCSCPY
+_GL_WARN_ON_USE (wcscpy, "wcscpy is unportable - "
+                 "use gnulib module wcscpy for portability");
+# endif
+#endif
+
+
+/* Copy SRC to DEST, returning the address of the terminating L'\0' in DEST.  */
+#if @GNULIB_WCPCPY@
+# if !@HAVE_WCPCPY@
+_GL_FUNCDECL_SYS (wcpcpy, wchar_t *, (wchar_t *dest, const wchar_t *src));
+# endif
+_GL_CXXALIAS_SYS (wcpcpy, wchar_t *, (wchar_t *dest, const wchar_t *src));
+_GL_CXXALIASWARN (wcpcpy);
+#elif defined GNULIB_POSIXCHECK
+# undef wcpcpy
+# if HAVE_RAW_DECL_WCPCPY
+_GL_WARN_ON_USE (wcpcpy, "wcpcpy is unportable - "
+                 "use gnulib module wcpcpy for portability");
+# endif
+#endif
+
+
+/* Copy no more than N wide characters of SRC to DEST.  */
+#if @GNULIB_WCSNCPY@
+# if !@HAVE_WCSNCPY@
+_GL_FUNCDECL_SYS (wcsncpy, wchar_t *,
+                  (wchar_t *dest, const wchar_t *src, size_t n));
+# endif
+_GL_CXXALIAS_SYS (wcsncpy, wchar_t *,
+                  (wchar_t *dest, const wchar_t *src, size_t n));
+_GL_CXXALIASWARN (wcsncpy);
+#elif defined GNULIB_POSIXCHECK
+# undef wcsncpy
+# if HAVE_RAW_DECL_WCSNCPY
+_GL_WARN_ON_USE (wcsncpy, "wcsncpy is unportable - "
+                 "use gnulib module wcsncpy for portability");
+# endif
+#endif
+
+
+/* Copy no more than N characters of SRC to DEST, returning the address of
+   the last character written into DEST.  */
+#if @GNULIB_WCPNCPY@
+# if !@HAVE_WCPNCPY@
+_GL_FUNCDECL_SYS (wcpncpy, wchar_t *,
+                  (wchar_t *dest, const wchar_t *src, size_t n));
+# endif
+_GL_CXXALIAS_SYS (wcpncpy, wchar_t *,
+                  (wchar_t *dest, const wchar_t *src, size_t n));
+_GL_CXXALIASWARN (wcpncpy);
+#elif defined GNULIB_POSIXCHECK
+# undef wcpncpy
+# if HAVE_RAW_DECL_WCPNCPY
+_GL_WARN_ON_USE (wcpncpy, "wcpncpy is unportable - "
+                 "use gnulib module wcpncpy for portability");
+# endif
+#endif
+
+
+/* Append SRC onto DEST.  */
+#if @GNULIB_WCSCAT@
+# if !@HAVE_WCSCAT@
+_GL_FUNCDECL_SYS (wcscat, wchar_t *, (wchar_t *dest, const wchar_t *src));
+# endif
+_GL_CXXALIAS_SYS (wcscat, wchar_t *, (wchar_t *dest, const wchar_t *src));
+_GL_CXXALIASWARN (wcscat);
+#elif defined GNULIB_POSIXCHECK
+# undef wcscat
+# if HAVE_RAW_DECL_WCSCAT
+_GL_WARN_ON_USE (wcscat, "wcscat is unportable - "
+                 "use gnulib module wcscat for portability");
+# endif
+#endif
+
+
+/* Append no more than N wide characters of SRC onto DEST.  */
+#if @GNULIB_WCSNCAT@
+# if !@HAVE_WCSNCAT@
+_GL_FUNCDECL_SYS (wcsncat, wchar_t *,
+                  (wchar_t *dest, const wchar_t *src, size_t n));
+# endif
+_GL_CXXALIAS_SYS (wcsncat, wchar_t *,
+                  (wchar_t *dest, const wchar_t *src, size_t n));
+_GL_CXXALIASWARN (wcsncat);
+#elif defined GNULIB_POSIXCHECK
+# undef wcsncat
+# if HAVE_RAW_DECL_WCSNCAT
+_GL_WARN_ON_USE (wcsncat, "wcsncat is unportable - "
+                 "use gnulib module wcsncat for portability");
+# endif
+#endif
+
+
+/* Compare S1 and S2.  */
+#if @GNULIB_WCSCMP@
+# if !@HAVE_WCSCMP@
+_GL_FUNCDECL_SYS (wcscmp, int, (const wchar_t *s1, const wchar_t *s2));
+# endif
+_GL_CXXALIAS_SYS (wcscmp, int, (const wchar_t *s1, const wchar_t *s2));
+_GL_CXXALIASWARN (wcscmp);
+#elif defined GNULIB_POSIXCHECK
+# undef wcscmp
+# if HAVE_RAW_DECL_WCSCMP
+_GL_WARN_ON_USE (wcscmp, "wcscmp is unportable - "
+                 "use gnulib module wcscmp for portability");
+# endif
+#endif
+
+
+/* Compare no more than N wide characters of S1 and S2.  */
+#if @GNULIB_WCSNCMP@
+# if !@HAVE_WCSNCMP@
+_GL_FUNCDECL_SYS (wcsncmp, int,
+                  (const wchar_t *s1, const wchar_t *s2, size_t n));
+# endif
+_GL_CXXALIAS_SYS (wcsncmp, int,
+                  (const wchar_t *s1, const wchar_t *s2, size_t n));
+_GL_CXXALIASWARN (wcsncmp);
+#elif defined GNULIB_POSIXCHECK
+# undef wcsncmp
+# if HAVE_RAW_DECL_WCSNCMP
+_GL_WARN_ON_USE (wcsncmp, "wcsncmp is unportable - "
+                 "use gnulib module wcsncmp for portability");
+# endif
+#endif
+
+
+/* Compare S1 and S2, ignoring case.  */
+#if @GNULIB_WCSCASECMP@
+# if !@HAVE_WCSCASECMP@
+_GL_FUNCDECL_SYS (wcscasecmp, int, (const wchar_t *s1, const wchar_t *s2));
+# endif
+_GL_CXXALIAS_SYS (wcscasecmp, int, (const wchar_t *s1, const wchar_t *s2));
+_GL_CXXALIASWARN (wcscasecmp);
+#elif defined GNULIB_POSIXCHECK
+# undef wcscasecmp
+# if HAVE_RAW_DECL_WCSCASECMP
+_GL_WARN_ON_USE (wcscasecmp, "wcscasecmp is unportable - "
+                 "use gnulib module wcscasecmp for portability");
+# endif
+#endif
+
+
+/* Compare no more than N chars of S1 and S2, ignoring case.  */
+#if @GNULIB_WCSNCASECMP@
+# if !@HAVE_WCSNCASECMP@
+_GL_FUNCDECL_SYS (wcsncasecmp, int,
+                  (const wchar_t *s1, const wchar_t *s2, size_t n));
+# endif
+_GL_CXXALIAS_SYS (wcsncasecmp, int,
+                  (const wchar_t *s1, const wchar_t *s2, size_t n));
+_GL_CXXALIASWARN (wcsncasecmp);
+#elif defined GNULIB_POSIXCHECK
+# undef wcsncasecmp
+# if HAVE_RAW_DECL_WCSNCASECMP
+_GL_WARN_ON_USE (wcsncasecmp, "wcsncasecmp is unportable - "
+                 "use gnulib module wcsncasecmp for portability");
+# endif
+#endif
+
+
+/* Compare S1 and S2, both interpreted as appropriate to the LC_COLLATE
+   category of the current locale.  */
+#if @GNULIB_WCSCOLL@
+# if !@HAVE_WCSCOLL@
+_GL_FUNCDECL_SYS (wcscoll, int, (const wchar_t *s1, const wchar_t *s2));
+# endif
+_GL_CXXALIAS_SYS (wcscoll, int, (const wchar_t *s1, const wchar_t *s2));
+_GL_CXXALIASWARN (wcscoll);
+#elif defined GNULIB_POSIXCHECK
+# undef wcscoll
+# if HAVE_RAW_DECL_WCSCOLL
+_GL_WARN_ON_USE (wcscoll, "wcscoll is unportable - "
+                 "use gnulib module wcscoll for portability");
+# endif
+#endif
+
+
+/* Transform S2 into array pointed to by S1 such that if wcscmp is applied
+   to two transformed strings the result is the as applying 'wcscoll' to the
+   original strings.  */
+#if @GNULIB_WCSXFRM@
+# if !@HAVE_WCSXFRM@
+_GL_FUNCDECL_SYS (wcsxfrm, size_t, (wchar_t *s1, const wchar_t *s2, size_t n));
+# endif
+_GL_CXXALIAS_SYS (wcsxfrm, size_t, (wchar_t *s1, const wchar_t *s2, size_t n));
+_GL_CXXALIASWARN (wcsxfrm);
+#elif defined GNULIB_POSIXCHECK
+# undef wcsxfrm
+# if HAVE_RAW_DECL_WCSXFRM
+_GL_WARN_ON_USE (wcsxfrm, "wcsxfrm is unportable - "
+                 "use gnulib module wcsxfrm for portability");
+# endif
+#endif
+
+
+/* Duplicate S, returning an identical malloc'd string.  */
+#if @GNULIB_WCSDUP@
+# if !@HAVE_WCSDUP@
+_GL_FUNCDECL_SYS (wcsdup, wchar_t *, (const wchar_t *s));
+# endif
+_GL_CXXALIAS_SYS (wcsdup, wchar_t *, (const wchar_t *s));
+_GL_CXXALIASWARN (wcsdup);
+#elif defined GNULIB_POSIXCHECK
+# undef wcsdup
+# if HAVE_RAW_DECL_WCSDUP
+_GL_WARN_ON_USE (wcsdup, "wcsdup is unportable - "
+                 "use gnulib module wcsdup for portability");
+# endif
+#endif
+
+
+/* Find the first occurrence of WC in WCS.  */
+#if @GNULIB_WCSCHR@
+# if !@HAVE_WCSCHR@
+_GL_FUNCDECL_SYS (wcschr, wchar_t *, (const wchar_t *wcs, wchar_t wc));
+# endif
+_GL_CXXALIAS_SYS (wcschr, wchar_t *, (const wchar_t *wcs, wchar_t wc));
+_GL_CXXALIASWARN (wcschr);
+#elif defined GNULIB_POSIXCHECK
+# undef wcschr
+# if HAVE_RAW_DECL_WCSCHR
+_GL_WARN_ON_USE (wcschr, "wcschr is unportable - "
+                 "use gnulib module wcschr for portability");
+# endif
+#endif
+
+
+/* Find the last occurrence of WC in WCS.  */
+#if @GNULIB_WCSRCHR@
+# if !@HAVE_WCSRCHR@
+_GL_FUNCDECL_SYS (wcsrchr, wchar_t *, (const wchar_t *wcs, wchar_t wc));
+# endif
+_GL_CXXALIAS_SYS (wcsrchr, wchar_t *, (const wchar_t *wcs, wchar_t wc));
+_GL_CXXALIASWARN (wcsrchr);
+#elif defined GNULIB_POSIXCHECK
+# undef wcsrchr
+# if HAVE_RAW_DECL_WCSRCHR
+_GL_WARN_ON_USE (wcsrchr, "wcsrchr is unportable - "
+                 "use gnulib module wcsrchr for portability");
+# endif
+#endif
+
+
+/* Return the length of the initial segmet of WCS which consists entirely
+   of wide characters not in REJECT.  */
+#if @GNULIB_WCSCSPN@
+# if !@HAVE_WCSCSPN@
+_GL_FUNCDECL_SYS (wcscspn, size_t, (const wchar_t *wcs, const wchar_t *reject));
+# endif
+_GL_CXXALIAS_SYS (wcscspn, size_t, (const wchar_t *wcs, const wchar_t *reject));
+_GL_CXXALIASWARN (wcscspn);
+#elif defined GNULIB_POSIXCHECK
+# undef wcscspn
+# if HAVE_RAW_DECL_WCSCSPN
+_GL_WARN_ON_USE (wcscspn, "wcscspn is unportable - "
+                 "use gnulib module wcscspn for portability");
+# endif
+#endif
+
+
+/* Return the length of the initial segmet of WCS which consists entirely
+   of wide characters in ACCEPT.  */
+#if @GNULIB_WCSSPN@
+# if !@HAVE_WCSSPN@
+_GL_FUNCDECL_SYS (wcsspn, size_t, (const wchar_t *wcs, const wchar_t *accept));
+# endif
+_GL_CXXALIAS_SYS (wcsspn, size_t, (const wchar_t *wcs, const wchar_t *accept));
+_GL_CXXALIASWARN (wcsspn);
+#elif defined GNULIB_POSIXCHECK
+# undef wcsspn
+# if HAVE_RAW_DECL_WCSSPN
+_GL_WARN_ON_USE (wcsspn, "wcsspn is unportable - "
+                 "use gnulib module wcsspn for portability");
+# endif
+#endif
+
+
+/* Find the first occurrence in WCS of any character in ACCEPT.  */
+#if @GNULIB_WCSPBRK@
+# if !@HAVE_WCSPBRK@
+_GL_FUNCDECL_SYS (wcspbrk, wchar_t *,
+                  (const wchar_t *wcs, const wchar_t *accept));
+# endif
+_GL_CXXALIAS_SYS (wcspbrk, wchar_t *,
+                  (const wchar_t *wcs, const wchar_t *accept));
+_GL_CXXALIASWARN (wcspbrk);
+#elif defined GNULIB_POSIXCHECK
+# undef wcspbrk
+# if HAVE_RAW_DECL_WCSPBRK
+_GL_WARN_ON_USE (wcspbrk, "wcspbrk is unportable - "
+                 "use gnulib module wcspbrk for portability");
+# endif
+#endif
+
+
+/* Find the first occurrence of NEEDLE in HAYSTACK.  */
+#if @GNULIB_WCSSTR@
+# if !@HAVE_WCSSTR@
+_GL_FUNCDECL_SYS (wcsstr, wchar_t *,
+                  (const wchar_t *haystack, const wchar_t *needle));
+# endif
+_GL_CXXALIAS_SYS (wcsstr, wchar_t *,
+                  (const wchar_t *haystack, const wchar_t *needle));
+_GL_CXXALIASWARN (wcsstr);
+#elif defined GNULIB_POSIXCHECK
+# undef wcsstr
+# if HAVE_RAW_DECL_WCSSTR
+_GL_WARN_ON_USE (wcsstr, "wcsstr is unportable - "
+                 "use gnulib module wcsstr for portability");
+# endif
+#endif
+
+
+/* Divide WCS into tokens separated by characters in DELIM.  */
+#if @GNULIB_WCSTOK@
+# if !@HAVE_WCSTOK@
+_GL_FUNCDECL_SYS (wcstok, wchar_t *,
+                  (wchar_t *wcs, const wchar_t *delim, wchar_t **ptr));
+# endif
+_GL_CXXALIAS_SYS (wcstok, wchar_t *,
+                  (wchar_t *wcs, const wchar_t *delim, wchar_t **ptr));
+_GL_CXXALIASWARN (wcstok);
+#elif defined GNULIB_POSIXCHECK
+# undef wcstok
+# if HAVE_RAW_DECL_WCSTOK
+_GL_WARN_ON_USE (wcstok, "wcstok is unportable - "
+                 "use gnulib module wcstok for portability");
+# endif
+#endif
+
+
+/* Determine number of column positions required for first N wide
+   characters (or fewer if S ends before this) in S.  */
+#if @GNULIB_WCSWIDTH@
+# if @REPLACE_WCSWIDTH@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef wcswidth
+#   define wcswidth rpl_wcswidth
+#  endif
+_GL_FUNCDECL_RPL (wcswidth, int, (const wchar_t *s, size_t n));
+_GL_CXXALIAS_RPL (wcswidth, int, (const wchar_t *s, size_t n));
+# else
+#  if !@HAVE_WCSWIDTH@
+_GL_FUNCDECL_SYS (wcswidth, int, (const wchar_t *s, size_t n));
+#  endif
+_GL_CXXALIAS_SYS (wcswidth, int, (const wchar_t *s, size_t n));
+# endif
+_GL_CXXALIASWARN (wcswidth);
+#elif defined GNULIB_POSIXCHECK
+# undef wcswidth
+# if HAVE_RAW_DECL_WCSWIDTH
+_GL_WARN_ON_USE (wcswidth, "wcswidth is unportable - "
+                 "use gnulib module wcswidth for portability");
+# endif
+#endif
+
+
 #endif /* _GL_WCHAR_H */
 #endif /* _GL_WCHAR_H */
 #endif
 #endif /* _GL_WCHAR_H */
 #endif /* _GL_WCHAR_H */
 #endif
index 8e64659..7d02daa 100644 (file)
@@ -1,5 +1,5 @@
 /* POSIX compatible write() function.
 /* POSIX compatible write() function.
-   Copyright (C) 2008-2010 Free Software Foundation, Inc.
+   Copyright (C) 2008-2011 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2008.
 
    This program is free software: you can redistribute it and/or modify
    Written by Bruno Haible <bruno@clisp.org>, 2008.
 
    This program is free software: you can redistribute it and/or modify
index 3382280..1bd9ca7 100644 (file)
@@ -1,6 +1,6 @@
 /* xsize.h -- Checked size_t computations.
 
 /* xsize.h -- Checked size_t computations.
 
-   Copyright (C) 2003, 2008, 2009, 2010 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2008-2011 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
 
    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
index 301469b..7feed46 100644 (file)
@@ -1,5 +1,5 @@
 # 00gnulib.m4 serial 2
 # 00gnulib.m4 serial 2
-dnl Copyright (C) 2009-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2009-2011 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 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.
index f576d34..5c6130c 100644 (file)
@@ -1,5 +1,5 @@
 # absolute-header.m4 serial 12
 # absolute-header.m4 serial 12
-dnl Copyright (C) 2006-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2006-2011 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 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.
index 80d67aa..e2e8a05 100644 (file)
@@ -1,5 +1,5 @@
 # alloca.m4 serial 10
 # alloca.m4 serial 10
-dnl Copyright (C) 2002-2004, 2006-2007, 2009-2010 Free Software Foundation,
+dnl Copyright (C) 2002-2004, 2006-2007, 2009-2011 Free Software Foundation,
 dnl Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
index 80fdb40..d21b162 100644 (file)
@@ -1,5 +1,5 @@
-# arpa_inet_h.m4 serial 10
-dnl Copyright (C) 2006, 2008-2010 Free Software Foundation, Inc.
+# arpa_inet_h.m4 serial 11
+dnl Copyright (C) 2006, 2008-2011 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 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.
@@ -31,6 +31,9 @@ AC_DEFUN([gl_HEADER_ARPA_INET],
 #if !(defined __GLIBC__ || defined __UCLIBC__)
 # include <sys/socket.h>
 #endif
 #if !(defined __GLIBC__ || defined __UCLIBC__)
 # include <sys/socket.h>
 #endif
+#ifdef __TANDEM
+# include <netdb.h>
+#endif
 #include <arpa/inet.h>
     ]], [inet_ntop inet_pton])
 ])
 #include <arpa/inet.h>
     ]], [inet_ntop inet_pton])
 ])
index 1736cc4..15c89cc 100644 (file)
@@ -1,5 +1,5 @@
 # asm-underscore.m4 serial 1
 # asm-underscore.m4 serial 1
-dnl Copyright (C) 2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2010-2011 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 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.
index 93ccb54..04971d4 100644 (file)
@@ -1,6 +1,5 @@
 # autobuild.m4 serial 7
 # autobuild.m4 serial 7
-dnl Copyright (C) 2004, 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
-dnl Inc.
+dnl Copyright (C) 2004, 2006-2011 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 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.
index 2afd6a2..a033acd 100644 (file)
@@ -1,5 +1,5 @@
 # byteswap.m4 serial 3
 # byteswap.m4 serial 3
-dnl Copyright (C) 2005, 2007, 2009, 2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2005, 2007, 2009-2011 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 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.
index f554025..dcc6039 100644 (file)
@@ -1,6 +1,6 @@
 # canonicalize.m4 serial 17
 
 # canonicalize.m4 serial 17
 
-dnl Copyright (C) 2003-2007, 2009-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2003-2007, 2009-2011 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 This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
index e23b3d3..30bd2e4 100644 (file)
@@ -1,5 +1,5 @@
 # check-math-lib.m4 serial 3
 # check-math-lib.m4 serial 3
-dnl Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2007, 2009-2011 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 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.
diff --git a/m4/close.m4 b/m4/close.m4
new file mode 100644 (file)
index 0000000..fc13138
--- /dev/null
@@ -0,0 +1,26 @@
+# close.m4 serial 5
+dnl Copyright (C) 2008-2011 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_CLOSE],
+[
+  m4_ifdef([gl_PREREQ_SYS_H_WINSOCK2], [
+    gl_PREREQ_SYS_H_WINSOCK2
+    if test $UNISTD_H_HAVE_WINSOCK2_H = 1; then
+      dnl Even if the 'socket' module is not used here, another part of the
+      dnl application may use it and pass file descriptors that refer to
+      dnl sockets to the close() function. So enable the support for sockets.
+      gl_REPLACE_CLOSE
+    fi
+  ])
+])
+
+AC_DEFUN([gl_REPLACE_CLOSE],
+[
+  AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+  REPLACE_CLOSE=1
+  AC_LIBOBJ([close])
+  gl_REPLACE_FCLOSE
+])
diff --git a/m4/codeset.m4 b/m4/codeset.m4
deleted file mode 100644 (file)
index f722b2e..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-# codeset.m4 serial 5 (gettext-0.18.2)
-dnl Copyright (C) 2000-2002, 2006, 2008-2010 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-dnl From Bruno Haible.
-
-AC_DEFUN([AM_LANGINFO_CODESET],
-[
-  AC_CACHE_CHECK([for nl_langinfo and CODESET], [am_cv_langinfo_codeset],
-    [AC_LINK_IFELSE(
-       [AC_LANG_PROGRAM(
-          [[#include <langinfo.h>]],
-          [[char* cs = nl_langinfo(CODESET); return !cs;]])],
-       [am_cv_langinfo_codeset=yes],
-       [am_cv_langinfo_codeset=no])
-    ])
-  if test $am_cv_langinfo_codeset = yes; then
-    AC_DEFINE([HAVE_LANGINFO_CODESET], [1],
-      [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
-  fi
-])
diff --git a/m4/configmake.m4 b/m4/configmake.m4
deleted file mode 100644 (file)
index 192fab3..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-# configmake.m4 serial 1
-dnl Copyright (C) 2010 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-# gl_CONFIGMAKE_PREP
-# ------------------
-# Guarantee all of the standard directory variables, even when used with
-# autoconf 2.59 (datarootdir wasn't supported until 2.59c) or automake
-# 1.9.6 (pkglibexecdir wasn't supported until 1.10b.).
-AC_DEFUN([gl_CONFIGMAKE_PREP],
-[
-  dnl Technically, datadir should default to datarootdir.  But if
-  dnl autoconf is too old to provide datarootdir, then reversing the
-  dnl definition is a reasonable compromise.  Only AC_SUBST a variable
-  dnl if it was not already defined earlier by autoconf.
-  if test "x$datarootdir" = x; then
-    AC_SUBST([datarootdir], ['${datadir}'])
-  fi
-  dnl Copy the approach used in autoconf 2.60.
-  if test "x$docdir" = x; then
-    AC_SUBST([docdir], [m4_ifset([AC_PACKAGE_TARNAME],
-      ['${datarootdir}/doc/${PACKAGE_TARNAME}'],
-      ['${datarootdir}/doc/${PACKAGE}'])])
-  fi
-  dnl The remaining variables missing from autoconf 2.59 are easier.
-  if test "x$htmldir" = x; then
-    AC_SUBST([htmldir], ['${docdir}'])
-  fi
-  if test "x$dvidir" = x; then
-    AC_SUBST([dvidir], ['${docdir}'])
-  fi
-  if test "x$pdfdir" = x; then
-    AC_SUBST([pdfdir], ['${docdir}'])
-  fi
-  if test "x$psdir" = x; then
-    AC_SUBST([psdir], ['${docdir}'])
-  fi
-  if test "x$lispdir" = x; then
-    AC_SUBST([lispdir], ['${datarootdir}/emacs/site-lisp'])
-  fi
-  if test "x$localedir" = x; then
-    AC_SUBST([localedir], ['${datarootdir}/locale'])
-  fi
-
-  dnl Automake 1.9.6 only lacks pkglibexecdir; and since 1.11 merely
-  dnl provides it without AC_SUBST, this blind use of AC_SUBST is safe.
-  AC_SUBST([pkglibexecdir], ['${libexecdir}/${PACKAGE}'])
-])
index 5660542..ed9c4ce 100644 (file)
--- a/m4/dos.m4
+++ b/m4/dos.m4
@@ -3,7 +3,7 @@
 # Define some macros required for proper operation of code in lib/*.c
 # on MSDOS/Windows systems.
 
 # Define some macros required for proper operation of code in lib/*.c
 # on MSDOS/Windows systems.
 
-# Copyright (C) 2000-2001, 2004-2006, 2009-2010 Free Software Foundation, Inc.
+# Copyright (C) 2000-2001, 2004-2006, 2009-2011 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.
 # 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.
index 66a79c0..16a4e3e 100644 (file)
@@ -1,5 +1,5 @@
 # double-slash-root.m4 serial 4   -*- Autoconf -*-
 # double-slash-root.m4 serial 4   -*- Autoconf -*-
-dnl Copyright (C) 2006, 2008-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2006, 2008-2011 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 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.
index 6ddccb6..4393d82 100644 (file)
@@ -1,5 +1,5 @@
 # duplocale.m4 serial 5
 # duplocale.m4 serial 5
-dnl Copyright (C) 2009-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2009-2011 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 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.
index 63dd920..3006c48 100644 (file)
@@ -1,5 +1,5 @@
 # eealloc.m4 serial 2
 # eealloc.m4 serial 2
-dnl Copyright (C) 2003, 2009, 2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2003, 2009-2011 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 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.
index b9dc2ef..7457ad1 100644 (file)
@@ -1,5 +1,5 @@
 # environ.m4 serial 5
 # environ.m4 serial 5
-dnl Copyright (C) 2001-2004, 2006-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2001-2004, 2006-2011 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 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.
index e4325ac..687baff 100644 (file)
@@ -1,5 +1,5 @@
-# errno_h.m4 serial 7
-dnl Copyright (C) 2004, 2006, 2008-2010 Free Software Foundation, Inc.
+# errno_h.m4 serial 8
+dnl Copyright (C) 2004, 2006, 2008-2011 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 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.
@@ -50,7 +50,7 @@ booboo
   if test $gl_cv_header_errno_h_complete = yes; then
     ERRNO_H=''
   else
   if test $gl_cv_header_errno_h_complete = yes; then
     ERRNO_H=''
   else
-    gl_CHECK_NEXT_HEADERS([errno.h])
+    gl_NEXT_HEADERS([errno.h])
     ERRNO_H='errno.h'
   fi
   AC_SUBST([ERRNO_H])
     ERRNO_H='errno.h'
   fi
   AC_SUBST([ERRNO_H])
index ad26ddf..7e91924 100644 (file)
@@ -1,5 +1,5 @@
 # exponentd.m4 serial 2
 # exponentd.m4 serial 2
-dnl Copyright (C) 2007-2008, 2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2007-2008, 2010-2011 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 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.
index 34cf197..3a00840 100644 (file)
@@ -1,5 +1,5 @@
 # exponentf.m4 serial 2
 # exponentf.m4 serial 2
-dnl Copyright (C) 2007-2008, 2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2007-2008, 2010-2011 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 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.
index b625fea..2e706b2 100644 (file)
@@ -1,5 +1,5 @@
 # exponentl.m4 serial 3
 # exponentl.m4 serial 3
-dnl Copyright (C) 2007-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2007-2011 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 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.
index 7d9458a..1330503 100644 (file)
@@ -1,7 +1,7 @@
 # serial 9  -*- Autoconf -*-
 # Enable extensions on systems that normally disable them.
 
 # serial 9  -*- Autoconf -*-
 # Enable extensions on systems that normally disable them.
 
-# Copyright (C) 2003, 2006-2010 Free Software Foundation, Inc.
+# Copyright (C) 2003, 2006-2011 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.
 # 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.
diff --git a/m4/fclose.m4 b/m4/fclose.m4
new file mode 100644 (file)
index 0000000..278859c
--- /dev/null
@@ -0,0 +1,16 @@
+# fclose.m4 serial 2
+dnl Copyright (C) 2008-2011 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_FCLOSE],
+[
+])
+
+AC_DEFUN([gl_REPLACE_FCLOSE],
+[
+  AC_REQUIRE([gl_STDIO_H_DEFAULTS])
+  REPLACE_FCLOSE=1
+  AC_LIBOBJ([fclose])
+])
diff --git a/m4/fcntl-o.m4 b/m4/fcntl-o.m4
deleted file mode 100644 (file)
index 46fad47..0000000
+++ /dev/null
@@ -1,112 +0,0 @@
-# fcntl-o.m4 serial 3
-dnl Copyright (C) 2006, 2009-2010 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-dnl Written by Paul Eggert.
-
-# Test whether the flags O_NOATIME and O_NOFOLLOW actually work.
-# Define HAVE_WORKING_O_NOATIME to 1 if O_NOATIME works, or to 0 otherwise.
-# Define HAVE_WORKING_O_NOFOLLOW to 1 if O_NOFOLLOW works, or to 0 otherwise.
-AC_DEFUN([gl_FCNTL_O_FLAGS],
-[
-  dnl Persuade glibc <fcntl.h> to define O_NOATIME and O_NOFOLLOW.
-  dnl AC_USE_SYSTEM_EXTENSIONS was introduced in autoconf 2.60 and obsoletes
-  dnl AC_GNU_SOURCE.
-  m4_ifdef([AC_USE_SYSTEM_EXTENSIONS],
-    [AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])],
-    [AC_REQUIRE([AC_GNU_SOURCE])])
-  AC_CACHE_CHECK([for working fcntl.h], [gl_cv_header_working_fcntl_h],
-    [AC_RUN_IFELSE(
-       [AC_LANG_PROGRAM(
-          [[#include <sys/types.h>
-           #include <sys/stat.h>
-           #include <unistd.h>
-           #include <fcntl.h>
-           #ifndef O_NOATIME
-            #define O_NOATIME 0
-           #endif
-           #ifndef O_NOFOLLOW
-            #define O_NOFOLLOW 0
-           #endif
-           static int const constants[] =
-            {
-              O_CREAT, O_EXCL, O_NOCTTY, O_TRUNC, O_APPEND,
-              O_NONBLOCK, O_SYNC, O_ACCMODE, O_RDONLY, O_RDWR, O_WRONLY
-            };
-          ]],
-          [[
-            int result = !constants;
-            {
-              static char const sym[] = "conftest.sym";
-              if (symlink (".", sym) != 0)
-                result |= 2;
-              else
-                {
-                  int fd = open (sym, O_RDONLY | O_NOFOLLOW);
-                  if (fd >= 0)
-                    {
-                      close (fd);
-                      result |= 4;
-                    }
-                }
-              unlink (sym);
-            }
-            {
-              static char const file[] = "confdefs.h";
-              int fd = open (file, O_RDONLY | O_NOATIME);
-              if (fd < 0)
-                result |= 8;
-              else
-                {
-                  struct stat st0;
-                  if (fstat (fd, &st0) != 0)
-                    result |= 16;
-                  else
-                    {
-                      char c;
-                      sleep (1);
-                      if (read (fd, &c, 1) != 1)
-                        result |= 24;
-                      else
-                        {
-                          if (close (fd) != 0)
-                            result |= 32;
-                          else
-                            {
-                              struct stat st1;
-                              if (stat (file, &st1) != 0)
-                                result |= 40;
-                              else
-                                if (st0.st_atime != st1.st_atime)
-                                  result |= 64;
-                            }
-                        }
-                    }
-                }
-            }
-            return result;]])],
-       [gl_cv_header_working_fcntl_h=yes],
-       [case $? in #(
-        4) gl_cv_header_working_fcntl_h='no (bad O_NOFOLLOW)';; #(
-        64) gl_cv_header_working_fcntl_h='no (bad O_NOATIME)';; #(
-        68) gl_cv_header_working_fcntl_h='no (bad O_NOATIME, O_NOFOLLOW)';; #(
-         *) gl_cv_header_working_fcntl_h='no';;
-        esac],
-       [gl_cv_header_working_fcntl_h=cross-compiling])])
-
-  case $gl_cv_header_working_fcntl_h in #(
-  *O_NOATIME* | no | cross-compiling) ac_val=0;; #(
-  *) ac_val=1;;
-  esac
-  AC_DEFINE_UNQUOTED([HAVE_WORKING_O_NOATIME], [$ac_val],
-    [Define to 1 if O_NOATIME works.])
-
-  case $gl_cv_header_working_fcntl_h in #(
-  *O_NOFOLLOW* | no | cross-compiling) ac_val=0;; #(
-  *) ac_val=1;;
-  esac
-  AC_DEFINE_UNQUOTED([HAVE_WORKING_O_NOFOLLOW], [$ac_val],
-    [Define to 1 if O_NOFOLLOW works.])
-])
index f6099db..265a4c1 100644 (file)
@@ -1,5 +1,5 @@
-# float_h.m4 serial 4
-dnl Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc.
+# float_h.m4 serial 5
+dnl Copyright (C) 2007, 2009-2011 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 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,7 +12,7 @@ AC_DEFUN([gl_FLOAT_H],
   case "$host_os" in
     beos* | openbsd* | mirbsd*)
       FLOAT_H=float.h
   case "$host_os" in
     beos* | openbsd* | mirbsd*)
       FLOAT_H=float.h
-      gl_CHECK_NEXT_HEADERS([float.h])
+      gl_NEXT_HEADERS([float.h])
       ;;
   esac
   AC_SUBST([FLOAT_H])
       ;;
   esac
   AC_SUBST([FLOAT_H])
index ca6e24f..7d8c703 100644 (file)
@@ -1,5 +1,5 @@
-# flock.m4 serial 1
-dnl Copyright (C) 2008-2010 Free Software Foundation, Inc.
+# flock.m4 serial 2
+dnl Copyright (C) 2008-2011 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 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 @@ dnl Prerequisites of lib/flock.c.
 AC_DEFUN([gl_PREREQ_FLOCK],
 [
   AC_CHECK_FUNCS_ONCE([fcntl])
 AC_DEFUN([gl_PREREQ_FLOCK],
 [
   AC_CHECK_FUNCS_ONCE([fcntl])
-  AC_CHECK_HEADERS_ONCE([unistd.h fcntl.h])
+  AC_CHECK_HEADERS_ONCE([unistd.h])
 
   dnl Do we have a POSIX fcntl lock implementation?
   AC_CHECK_MEMBERS([struct flock.l_type],[],[],[[#include <fcntl.h>]])
 
   dnl Do we have a POSIX fcntl lock implementation?
   AC_CHECK_MEMBERS([struct flock.l_type],[],[],[[#include <fcntl.h>]])
index 532802d..7872876 100644 (file)
@@ -1,5 +1,5 @@
 # fpieee.m4 serial 1
 # fpieee.m4 serial 1
-dnl Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2007, 2009-2011 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 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.
index 698c528..dcd2d4f 100644 (file)
@@ -1,5 +1,5 @@
 # func.m4 serial 2
 # func.m4 serial 2
-dnl Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2008-2011 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 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.
index bc3066d..94c276f 100644 (file)
@@ -1,5 +1,5 @@
 # getaddrinfo.m4 serial 23
 # getaddrinfo.m4 serial 23
-dnl Copyright (C) 2004-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2004-2011 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 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.
diff --git a/m4/glibc21.m4 b/m4/glibc21.m4
deleted file mode 100644 (file)
index bd08b38..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-# glibc21.m4 serial 5
-dnl Copyright (C) 2000-2002, 2004, 2008, 2010 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-# Test for the GNU C Library, version 2.1 or newer, or uClibc.
-# From Bruno Haible.
-
-AC_DEFUN([gl_GLIBC21],
-  [
-    AC_CACHE_CHECK([whether we are using the GNU C Library >= 2.1 or uClibc],
-      [ac_cv_gnu_library_2_1],
-      [AC_EGREP_CPP([Lucky],
-        [
-#include <features.h>
-#ifdef __GNU_LIBRARY__
- #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
-  Lucky GNU user
- #endif
-#endif
-#ifdef __UCLIBC__
- Lucky user
-#endif
-        ],
-        [ac_cv_gnu_library_2_1=yes],
-        [ac_cv_gnu_library_2_1=no])
-      ]
-    )
-    AC_SUBST([GLIBC21])
-    GLIBC21="$ac_cv_gnu_library_2_1"
-  ]
-)
index b0312d1..eabea40 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2010 Free Software Foundation, Inc.
+# Copyright (C) 2002-2011 Free Software Foundation, Inc.
 #
 # This file is free software, distributed under the terms of the GNU
 # General Public License.  As a special exception to the GNU General
 #
 # This file is free software, distributed under the terms of the GNU
 # General Public License.  As a special exception to the GNU General
 
 
 # Specification in the form of a command-line invocation:
 
 
 # Specification in the form of a command-line invocation:
-#   gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --lgpl=3 --libtool --macro-prefix=gl --no-vc-files alignof alloca-opt announce-gen autobuild byteswap canonicalize-lgpl duplocale environ extensions flock fpieee full-read full-write func gendocs getaddrinfo git-version-gen gitlog-to-changelog gnu-web-doc-update gnupload havelib iconv_open-utf inet_ntop inet_pton isinf isnan lib-symbol-versions lib-symbol-visibility libunistring locale maintainer-makefile nproc putenv stat-time stdlib strcase strftime striconveh string sys_stat verify version-etc-fsf vsnprintf warnings
+#   gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --lgpl=3 --libtool --macro-prefix=gl --no-vc-files accept alignof alloca-opt announce-gen autobuild bind byteswap canonicalize-lgpl close connect duplocale environ extensions flock fpieee full-read full-write func gendocs getaddrinfo getpeername getsockname getsockopt git-version-gen gitlog-to-changelog gnu-web-doc-update gnupload havelib iconv_open-utf inet_ntop inet_pton isinf isnan lib-symbol-versions lib-symbol-visibility libunistring listen locale maintainer-makefile malloc malloca nproc putenv recv recvfrom send sendto setsockopt shutdown socket sockets stat-time stdlib strcase strftime striconveh string sys_stat trunc verify version-etc-fsf vsnprintf warnings
 
 # Specification in the form of a few gnulib-tool.m4 macro invocations:
 gl_LOCAL_DIR([])
 gl_MODULES([
 
 # Specification in the form of a few gnulib-tool.m4 macro invocations:
 gl_LOCAL_DIR([])
 gl_MODULES([
+  accept
   alignof
   alloca-opt
   announce-gen
   autobuild
   alignof
   alloca-opt
   announce-gen
   autobuild
+  bind
   byteswap
   canonicalize-lgpl
   byteswap
   canonicalize-lgpl
+  close
+  connect
   duplocale
   environ
   extensions
   duplocale
   environ
   extensions
@@ -36,6 +40,9 @@ gl_MODULES([
   func
   gendocs
   getaddrinfo
   func
   gendocs
   getaddrinfo
+  getpeername
+  getsockname
+  getsockopt
   git-version-gen
   gitlog-to-changelog
   gnu-web-doc-update
   git-version-gen
   gitlog-to-changelog
   gnu-web-doc-update
@@ -49,10 +56,21 @@ gl_MODULES([
   lib-symbol-versions
   lib-symbol-visibility
   libunistring
   lib-symbol-versions
   lib-symbol-visibility
   libunistring
+  listen
   locale
   maintainer-makefile
   locale
   maintainer-makefile
+  malloc
+  malloca
   nproc
   putenv
   nproc
   putenv
+  recv
+  recvfrom
+  send
+  sendto
+  setsockopt
+  shutdown
+  socket
+  sockets
   stat-time
   stdlib
   strcase
   stat-time
   stdlib
   strcase
@@ -60,6 +78,7 @@ gl_MODULES([
   striconveh
   string
   sys_stat
   striconveh
   string
   sys_stat
+  trunc
   verify
   version-etc-fsf
   vsnprintf
   verify
   version-etc-fsf
   vsnprintf
index d0c8b66..ecbf336 100644 (file)
@@ -1,5 +1,5 @@
-# gnulib-common.m4 serial 21
-dnl Copyright (C) 2007-2010 Free Software Foundation, Inc.
+# gnulib-common.m4 serial 23
+dnl Copyright (C) 2007-2011 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 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.
@@ -102,6 +102,26 @@ AC_DEFUN([gl_MODULE_INDICATOR_FOR_TESTS],
     [Define to 1 when the gnulib module $1 should be tested.])
 ])
 
     [Define to 1 when the gnulib module $1 should be tested.])
 ])
 
+# gl_ASSERT_NO_GNULIB_POSIXCHECK
+# asserts that there will never be a need to #define GNULIB_POSIXCHECK.
+# and thereby enables an optimization of configure and config.h.
+# Used by Emacs.
+AC_DEFUN([gl_ASSERT_NO_GNULIB_POSIXCHECK],
+[
+  dnl Override gl_WARN_ON_USE_PREPARE.
+  AC_DEFUN([gl_WARN_ON_USE_PREPARE], [])
+])
+
+# gl_ASSERT_NO_GNULIB_TESTS
+# asserts that there will be no gnulib tests in the scope of the configure.ac
+# and thereby enables an optimization of config.h.
+# Used by Emacs.
+AC_DEFUN([gl_ASSERT_NO_GNULIB_TESTS],
+[
+  dnl Override gl_MODULE_INDICATOR_FOR_TESTS.
+  AC_DEFUN([gl_MODULE_INDICATOR_FOR_TESTS], [])
+])
+
 # Test whether <features.h> exists.
 # Set HAVE_FEATURES_H.
 AC_DEFUN([gl_FEATURES_H],
 # Test whether <features.h> exists.
 # Set HAVE_FEATURES_H.
 AC_DEFUN([gl_FEATURES_H],
index 11ae3c7..bb700f7 100644 (file)
@@ -1,5 +1,5 @@
 # DO NOT EDIT! GENERATED AUTOMATICALLY!
 # DO NOT EDIT! GENERATED AUTOMATICALLY!
-# Copyright (C) 2002-2010 Free Software Foundation, Inc.
+# Copyright (C) 2002-2011 Free Software Foundation, Inc.
 #
 # This file is free software, distributed under the terms of the GNU
 # General Public License.  As a special exception to the GNU General
 #
 # This file is free software, distributed under the terms of the GNU
 # General Public License.  As a special exception to the GNU General
@@ -27,6 +27,7 @@ AC_DEFUN([gl_EARLY],
   m4_pattern_allow([^gl_LTLIBOBJS$])dnl a variable
   AC_REQUIRE([AC_PROG_RANLIB])
   AC_REQUIRE([AM_PROG_CC_C_O])
   m4_pattern_allow([^gl_LTLIBOBJS$])dnl a variable
   AC_REQUIRE([AC_PROG_RANLIB])
   AC_REQUIRE([AM_PROG_CC_C_O])
+  # Code from module accept:
   # Code from module alignof:
   # Code from module alloca-opt:
   # Code from module announce-gen:
   # Code from module alignof:
   # Code from module alloca-opt:
   # Code from module announce-gen:
@@ -34,19 +35,22 @@ AC_DEFUN([gl_EARLY],
   # Code from module arpa_inet:
   # Code from module autobuild:
   AB_INIT
   # Code from module arpa_inet:
   # Code from module autobuild:
   AB_INIT
+  # Code from module bind:
   # Code from module byteswap:
   # Code from module c++defs:
   # Code from module c-ctype:
   # Code from module c-strcase:
   # Code from module c-strcaseeq:
   # Code from module canonicalize-lgpl:
   # Code from module byteswap:
   # Code from module c++defs:
   # Code from module c-ctype:
   # Code from module c-strcase:
   # Code from module c-strcaseeq:
   # Code from module canonicalize-lgpl:
+  # Code from module close:
   # Code from module close-hook:
   # Code from module close-hook:
-  # Code from module configmake:
+  # Code from module connect:
   # Code from module duplocale:
   # Code from module environ:
   # Code from module errno:
   # Code from module extensions:
   AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
   # Code from module duplocale:
   # Code from module environ:
   # Code from module errno:
   # Code from module extensions:
   AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+  # Code from module fclose:
   # Code from module float:
   # Code from module flock:
   # Code from module fpieee:
   # Code from module float:
   # Code from module flock:
   # Code from module fpieee:
@@ -56,6 +60,9 @@ AC_DEFUN([gl_EARLY],
   # Code from module func:
   # Code from module gendocs:
   # Code from module getaddrinfo:
   # Code from module func:
   # Code from module gendocs:
   # Code from module getaddrinfo:
+  # Code from module getpeername:
+  # Code from module getsockname:
+  # Code from module getsockopt:
   # Code from module gettext-h:
   # Code from module git-version-gen:
   # Code from module gitlog-to-changelog:
   # Code from module gettext-h:
   # Code from module git-version-gen:
   # Code from module gitlog-to-changelog:
@@ -81,16 +88,15 @@ AC_DEFUN([gl_EARLY],
   # Code from module lib-symbol-versions:
   # Code from module lib-symbol-visibility:
   # Code from module libunistring:
   # Code from module lib-symbol-versions:
   # Code from module lib-symbol-visibility:
   # Code from module libunistring:
-  # Code from module localcharset:
+  # Code from module listen:
   # Code from module locale:
   # Code from module lstat:
   # Code from module maintainer-makefile:
   # Code from module locale:
   # Code from module lstat:
   # Code from module maintainer-makefile:
+  # Code from module malloc:
+  # Code from module malloc-gnu:
   # Code from module malloc-posix:
   # Code from module malloca:
   # Code from module math:
   # Code from module malloc-posix:
   # Code from module malloca:
   # Code from module math:
-  # Code from module mbrlen:
-  # Code from module mbrtowc:
-  # Code from module mbsinit:
   # Code from module memchr:
   # Code from module multiarch:
   # Code from module netdb:
   # Code from module memchr:
   # Code from module multiarch:
   # Code from module netdb:
@@ -99,11 +105,18 @@ AC_DEFUN([gl_EARLY],
   # Code from module pathmax:
   # Code from module putenv:
   # Code from module readlink:
   # Code from module pathmax:
   # Code from module putenv:
   # Code from module readlink:
+  # Code from module recv:
+  # Code from module recvfrom:
   # Code from module safe-read:
   # Code from module safe-write:
   # Code from module safe-read:
   # Code from module safe-write:
+  # Code from module send:
+  # Code from module sendto:
   # Code from module servent:
   # Code from module servent:
+  # Code from module setsockopt:
+  # Code from module shutdown:
   # Code from module size_max:
   # Code from module snprintf:
   # Code from module size_max:
   # Code from module snprintf:
+  # Code from module socket:
   # Code from module socketlib:
   # Code from module sockets:
   # Code from module socklen:
   # Code from module socketlib:
   # Code from module sockets:
   # Code from module socklen:
@@ -122,7 +135,6 @@ AC_DEFUN([gl_EARLY],
   # Code from module stdio:
   # Code from module stdlib:
   # Code from module strcase:
   # Code from module stdio:
   # Code from module stdlib:
   # Code from module strcase:
-  # Code from module streq:
   # Code from module strftime:
   # Code from module striconveh:
   # Code from module string:
   # Code from module strftime:
   # Code from module striconveh:
   # Code from module string:
@@ -130,8 +142,10 @@ AC_DEFUN([gl_EARLY],
   # Code from module sys_file:
   # Code from module sys_socket:
   # Code from module sys_stat:
   # Code from module sys_file:
   # Code from module sys_socket:
   # Code from module sys_stat:
+  # Code from module sys_time:
   # Code from module time:
   # Code from module time_r:
   # Code from module time:
   # Code from module time_r:
+  # Code from module trunc:
   # Code from module unistd:
   # Code from module unistr/base:
   # Code from module unistr/u8-mbtouc:
   # Code from module unistd:
   # Code from module unistr/base:
   # Code from module unistr/u8-mbtouc:
@@ -169,6 +183,12 @@ AC_DEFUN([gl_INIT],
   m4_pushdef([gl_LIBSOURCES_DIR], [])
   gl_COMMON
   gl_source_base='lib'
   m4_pushdef([gl_LIBSOURCES_DIR], [])
   gl_COMMON
   gl_source_base='lib'
+  # Code from module accept:
+  AC_REQUIRE([gl_HEADER_SYS_SOCKET])
+  if test "$ac_cv_header_winsock2_h" = yes; then
+    AC_LIBOBJ([accept])
+  fi
+  gl_SYS_SOCKET_MODULE_INDICATOR([accept])
   # Code from module alignof:
   # Code from module alloca-opt:
   gl_FUNC_ALLOCA
   # Code from module alignof:
   # Code from module alloca-opt:
   gl_FUNC_ALLOCA
@@ -178,6 +198,12 @@ AC_DEFUN([gl_INIT],
   gl_HEADER_ARPA_INET
   AC_PROG_MKDIR_P
   # Code from module autobuild:
   gl_HEADER_ARPA_INET
   AC_PROG_MKDIR_P
   # Code from module autobuild:
+  # Code from module bind:
+  AC_REQUIRE([gl_HEADER_SYS_SOCKET])
+  if test "$ac_cv_header_winsock2_h" = yes; then
+    AC_LIBOBJ([bind])
+  fi
+  gl_SYS_SOCKET_MODULE_INDICATOR([bind])
   # Code from module byteswap:
   gl_BYTESWAP
   # Code from module c++defs:
   # Code from module byteswap:
   gl_BYTESWAP
   # Code from module c++defs:
@@ -189,9 +215,16 @@ AC_DEFUN([gl_INIT],
   gl_MODULE_INDICATOR([canonicalize-lgpl])
   gl_STDLIB_MODULE_INDICATOR([canonicalize_file_name])
   gl_STDLIB_MODULE_INDICATOR([realpath])
   gl_MODULE_INDICATOR([canonicalize-lgpl])
   gl_STDLIB_MODULE_INDICATOR([canonicalize_file_name])
   gl_STDLIB_MODULE_INDICATOR([realpath])
+  # Code from module close:
+  gl_FUNC_CLOSE
+  gl_UNISTD_MODULE_INDICATOR([close])
   # Code from module close-hook:
   # Code from module close-hook:
-  # Code from module configmake:
-  gl_CONFIGMAKE_PREP
+  # Code from module connect:
+  AC_REQUIRE([gl_HEADER_SYS_SOCKET])
+  if test "$ac_cv_header_winsock2_h" = yes; then
+    AC_LIBOBJ([connect])
+  fi
+  gl_SYS_SOCKET_MODULE_INDICATOR([connect])
   # Code from module duplocale:
   gl_FUNC_DUPLOCALE
   gl_LOCALE_MODULE_INDICATOR([duplocale])
   # Code from module duplocale:
   gl_FUNC_DUPLOCALE
   gl_LOCALE_MODULE_INDICATOR([duplocale])
@@ -201,6 +234,9 @@ AC_DEFUN([gl_INIT],
   # Code from module errno:
   gl_HEADER_ERRNO_H
   # Code from module extensions:
   # Code from module errno:
   gl_HEADER_ERRNO_H
   # Code from module extensions:
+  # Code from module fclose:
+  gl_FUNC_FCLOSE
+  gl_STDIO_MODULE_INDICATOR([fclose])
   # Code from module float:
   gl_FLOAT_H
   # Code from module flock:
   # Code from module float:
   gl_FLOAT_H
   # Code from module flock:
@@ -215,6 +251,24 @@ AC_DEFUN([gl_INIT],
   # Code from module getaddrinfo:
   gl_GETADDRINFO
   gl_NETDB_MODULE_INDICATOR([getaddrinfo])
   # Code from module getaddrinfo:
   gl_GETADDRINFO
   gl_NETDB_MODULE_INDICATOR([getaddrinfo])
+  # Code from module getpeername:
+  AC_REQUIRE([gl_HEADER_SYS_SOCKET])
+  if test "$ac_cv_header_winsock2_h" = yes; then
+    AC_LIBOBJ([getpeername])
+  fi
+  gl_SYS_SOCKET_MODULE_INDICATOR([getpeername])
+  # Code from module getsockname:
+  AC_REQUIRE([gl_HEADER_SYS_SOCKET])
+  if test "$ac_cv_header_winsock2_h" = yes; then
+    AC_LIBOBJ([getsockname])
+  fi
+  gl_SYS_SOCKET_MODULE_INDICATOR([getsockname])
+  # Code from module getsockopt:
+  AC_REQUIRE([gl_HEADER_SYS_SOCKET])
+  if test "$ac_cv_header_winsock2_h" = yes; then
+    AC_LIBOBJ([getsockopt])
+  fi
+  gl_SYS_SOCKET_MODULE_INDICATOR([getsockopt])
   # Code from module gettext-h:
   AC_SUBST([LIBINTL])
   AC_SUBST([LTLIBINTL])
   # Code from module gettext-h:
   AC_SUBST([LIBINTL])
   AC_SUBST([LTLIBINTL])
@@ -277,10 +331,12 @@ AC_DEFUN([gl_INIT],
   gl_VISIBILITY
   # Code from module libunistring:
   gl_LIBUNISTRING
   gl_VISIBILITY
   # Code from module libunistring:
   gl_LIBUNISTRING
-  # Code from module localcharset:
-  gl_LOCALCHARSET
-  LOCALCHARSET_TESTS_ENVIRONMENT="CHARSETALIASDIR=\"\$(top_builddir)/$gl_source_base\""
-  AC_SUBST([LOCALCHARSET_TESTS_ENVIRONMENT])
+  # Code from module listen:
+  AC_REQUIRE([gl_HEADER_SYS_SOCKET])
+  if test "$ac_cv_header_winsock2_h" = yes; then
+    AC_LIBOBJ([listen])
+  fi
+  gl_SYS_SOCKET_MODULE_INDICATOR([listen])
   # Code from module locale:
   gl_LOCALE_H
   # Code from module lstat:
   # Code from module locale:
   gl_LOCALE_H
   # Code from module lstat:
@@ -289,6 +345,10 @@ AC_DEFUN([gl_INIT],
   # Code from module maintainer-makefile:
   AC_CONFIG_COMMANDS_PRE([m4_ifdef([AH_HEADER],
     [AC_SUBST([CONFIG_INCLUDE], m4_defn([AH_HEADER]))])])
   # Code from module maintainer-makefile:
   AC_CONFIG_COMMANDS_PRE([m4_ifdef([AH_HEADER],
     [AC_SUBST([CONFIG_INCLUDE], m4_defn([AH_HEADER]))])])
+  # Code from module malloc:
+  # Code from module malloc-gnu:
+  gl_FUNC_MALLOC_GNU
+  gl_MODULE_INDICATOR([malloc-gnu])
   # Code from module malloc-posix:
   gl_FUNC_MALLOC_POSIX
   gl_STDLIB_MODULE_INDICATOR([malloc-posix])
   # Code from module malloc-posix:
   gl_FUNC_MALLOC_POSIX
   gl_STDLIB_MODULE_INDICATOR([malloc-posix])
@@ -296,15 +356,6 @@ AC_DEFUN([gl_INIT],
   gl_MALLOCA
   # Code from module math:
   gl_MATH_H
   gl_MALLOCA
   # Code from module math:
   gl_MATH_H
-  # Code from module mbrlen:
-  gl_FUNC_MBRLEN
-  gl_WCHAR_MODULE_INDICATOR([mbrlen])
-  # Code from module mbrtowc:
-  gl_FUNC_MBRTOWC
-  gl_WCHAR_MODULE_INDICATOR([mbrtowc])
-  # Code from module mbsinit:
-  gl_FUNC_MBSINIT
-  gl_WCHAR_MODULE_INDICATOR([mbsinit])
   # Code from module memchr:
   gl_FUNC_MEMCHR
   gl_STRING_MODULE_INDICATOR([memchr])
   # Code from module memchr:
   gl_FUNC_MEMCHR
   gl_STRING_MODULE_INDICATOR([memchr])
@@ -325,17 +376,69 @@ AC_DEFUN([gl_INIT],
   # Code from module readlink:
   gl_FUNC_READLINK
   gl_UNISTD_MODULE_INDICATOR([readlink])
   # Code from module readlink:
   gl_FUNC_READLINK
   gl_UNISTD_MODULE_INDICATOR([readlink])
+  # Code from module recv:
+  AC_REQUIRE([gl_HEADER_SYS_SOCKET])
+  if test "$ac_cv_header_winsock2_h" = yes; then
+    AC_LIBOBJ([recv])
+  fi
+  gl_SYS_SOCKET_MODULE_INDICATOR([recv])
+  # Code from module recvfrom:
+  AC_REQUIRE([gl_HEADER_SYS_SOCKET])
+  if test "$ac_cv_header_winsock2_h" = yes; then
+    AC_LIBOBJ([recvfrom])
+  fi
+  gl_SYS_SOCKET_MODULE_INDICATOR([recvfrom])
   # Code from module safe-read:
   gl_SAFE_READ
   # Code from module safe-write:
   gl_SAFE_WRITE
   # Code from module safe-read:
   gl_SAFE_READ
   # Code from module safe-write:
   gl_SAFE_WRITE
+  # Code from module send:
+  AC_REQUIRE([gl_HEADER_SYS_SOCKET])
+  if test "$ac_cv_header_winsock2_h" = yes; then
+    AC_LIBOBJ([send])
+  fi
+  gl_SYS_SOCKET_MODULE_INDICATOR([send])
+  # Code from module sendto:
+  AC_REQUIRE([gl_HEADER_SYS_SOCKET])
+  if test "$ac_cv_header_winsock2_h" = yes; then
+    AC_LIBOBJ([sendto])
+  fi
+  gl_SYS_SOCKET_MODULE_INDICATOR([sendto])
   # Code from module servent:
   gl_SERVENT
   # Code from module servent:
   gl_SERVENT
+  # Code from module setsockopt:
+  AC_REQUIRE([gl_HEADER_SYS_SOCKET])
+  if test "$ac_cv_header_winsock2_h" = yes; then
+    AC_LIBOBJ([setsockopt])
+  fi
+  gl_SYS_SOCKET_MODULE_INDICATOR([setsockopt])
+  # Code from module shutdown:
+  AC_REQUIRE([gl_HEADER_SYS_SOCKET])
+  if test "$ac_cv_header_winsock2_h" = yes; then
+    AC_LIBOBJ([shutdown])
+  fi
+  gl_SYS_SOCKET_MODULE_INDICATOR([shutdown])
   # Code from module size_max:
   gl_SIZE_MAX
   # Code from module snprintf:
   gl_FUNC_SNPRINTF
   gl_STDIO_MODULE_INDICATOR([snprintf])
   # Code from module size_max:
   gl_SIZE_MAX
   # Code from module snprintf:
   gl_FUNC_SNPRINTF
   gl_STDIO_MODULE_INDICATOR([snprintf])
+  gl_MODULE_INDICATOR([snprintf])
+  # Code from module socket:
+  AC_REQUIRE([gl_HEADER_SYS_SOCKET])
+  if test "$ac_cv_header_winsock2_h" = yes; then
+    AC_LIBOBJ([socket])
+  fi
+  # When this module is used, sockets may actually occur as file descriptors,
+  # hence it is worth warning if the modules 'close' and 'ioctl' are not used.
+  m4_ifdef([gl_UNISTD_H_DEFAULTS], [AC_REQUIRE([gl_UNISTD_H_DEFAULTS])])
+  m4_ifdef([gl_SYS_IOCTL_H_DEFAULTS], [AC_REQUIRE([gl_SYS_IOCTL_H_DEFAULTS])])
+  AC_REQUIRE([gl_PREREQ_SYS_H_WINSOCK2])
+  if test "$ac_cv_header_winsock2_h" = yes; then
+    UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS=1
+    SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS=1
+  fi
+  gl_SYS_SOCKET_MODULE_INDICATOR([socket])
   # Code from module socketlib:
   gl_SOCKETLIB
   # Code from module sockets:
   # Code from module socketlib:
   gl_SOCKETLIB
   # Code from module sockets:
@@ -364,7 +467,6 @@ AC_DEFUN([gl_INIT],
   gl_STDLIB_H
   # Code from module strcase:
   gl_STRCASE
   gl_STDLIB_H
   # Code from module strcase:
   gl_STRCASE
-  # Code from module streq:
   # Code from module strftime:
   gl_FUNC_GNU_STRFTIME
   # Code from module striconveh:
   # Code from module strftime:
   gl_FUNC_GNU_STRFTIME
   # Code from module striconveh:
@@ -385,11 +487,17 @@ AC_DEFUN([gl_INIT],
   # Code from module sys_stat:
   gl_HEADER_SYS_STAT_H
   AC_PROG_MKDIR_P
   # Code from module sys_stat:
   gl_HEADER_SYS_STAT_H
   AC_PROG_MKDIR_P
+  # Code from module sys_time:
+  gl_HEADER_SYS_TIME_H
+  AC_PROG_MKDIR_P
   # Code from module time:
   gl_HEADER_TIME_H
   # Code from module time_r:
   gl_TIME_R
   gl_TIME_MODULE_INDICATOR([time_r])
   # Code from module time:
   gl_HEADER_TIME_H
   # Code from module time_r:
   gl_TIME_R
   gl_TIME_MODULE_INDICATOR([time_r])
+  # Code from module trunc:
+  gl_FUNC_TRUNC
+  gl_MATH_MODULE_INDICATOR([trunc])
   # Code from module unistd:
   gl_UNISTD_H
   # Code from module unistr/base:
   # Code from module unistd:
   gl_UNISTD_H
   # Code from module unistr/base:
@@ -582,10 +690,12 @@ AC_DEFUN([gl_FILE_LIST], [
   build-aux/vc-list-files
   build-aux/warn-on-use.h
   doc/gendocs_template
   build-aux/vc-list-files
   build-aux/warn-on-use.h
   doc/gendocs_template
+  lib/accept.c
   lib/alignof.h
   lib/alloca.in.h
   lib/arpa_inet.in.h
   lib/asnprintf.c
   lib/alignof.h
   lib/alloca.in.h
   lib/arpa_inet.in.h
   lib/asnprintf.c
+  lib/bind.c
   lib/byteswap.in.h
   lib/c-ctype.c
   lib/c-ctype.h
   lib/byteswap.in.h
   lib/c-ctype.c
   lib/c-ctype.h
@@ -596,9 +706,11 @@ AC_DEFUN([gl_FILE_LIST], [
   lib/canonicalize-lgpl.c
   lib/close-hook.c
   lib/close-hook.h
   lib/canonicalize-lgpl.c
   lib/close-hook.c
   lib/close-hook.h
-  lib/config.charset
+  lib/close.c
+  lib/connect.c
   lib/duplocale.c
   lib/errno.in.h
   lib/duplocale.c
   lib/errno.in.h
+  lib/fclose.c
   lib/float+.h
   lib/float.in.h
   lib/flock.c
   lib/float+.h
   lib/float.in.h
   lib/flock.c
@@ -608,6 +720,9 @@ AC_DEFUN([gl_FILE_LIST], [
   lib/full-write.h
   lib/gai_strerror.c
   lib/getaddrinfo.c
   lib/full-write.h
   lib/gai_strerror.c
   lib/getaddrinfo.c
+  lib/getpeername.c
+  lib/getsockname.c
+  lib/getsockopt.c
   lib/gettext.h
   lib/iconv.c
   lib/iconv.in.h
   lib/gettext.h
   lib/iconv.c
   lib/iconv.in.h
@@ -627,8 +742,7 @@ AC_DEFUN([gl_FILE_LIST], [
   lib/isnanf.c
   lib/isnanl.c
   lib/libunistring.valgrind
   lib/isnanf.c
   lib/isnanl.c
   lib/libunistring.valgrind
-  lib/localcharset.c
-  lib/localcharset.h
+  lib/listen.c
   lib/locale.in.h
   lib/lstat.c
   lib/malloc.c
   lib/locale.in.h
   lib/lstat.c
   lib/malloc.c
@@ -636,9 +750,6 @@ AC_DEFUN([gl_FILE_LIST], [
   lib/malloca.h
   lib/malloca.valgrind
   lib/math.in.h
   lib/malloca.h
   lib/malloca.valgrind
   lib/math.in.h
-  lib/mbrlen.c
-  lib/mbrtowc.c
-  lib/mbsinit.c
   lib/memchr.c
   lib/memchr.valgrind
   lib/netdb.in.h
   lib/memchr.c
   lib/memchr.valgrind
   lib/netdb.in.h
@@ -652,14 +763,19 @@ AC_DEFUN([gl_FILE_LIST], [
   lib/printf-parse.h
   lib/putenv.c
   lib/readlink.c
   lib/printf-parse.h
   lib/putenv.c
   lib/readlink.c
-  lib/ref-add.sin
-  lib/ref-del.sin
+  lib/recv.c
+  lib/recvfrom.c
   lib/safe-read.c
   lib/safe-read.h
   lib/safe-write.c
   lib/safe-write.h
   lib/safe-read.c
   lib/safe-read.h
   lib/safe-write.c
   lib/safe-write.h
+  lib/send.c
+  lib/sendto.c
+  lib/setsockopt.c
+  lib/shutdown.c
   lib/size_max.h
   lib/snprintf.c
   lib/size_max.h
   lib/snprintf.c
+  lib/socket.c
   lib/sockets.c
   lib/sockets.h
   lib/stat-time.h
   lib/sockets.c
   lib/sockets.h
   lib/stat-time.h
@@ -672,7 +788,6 @@ AC_DEFUN([gl_FILE_LIST], [
   lib/stdio.in.h
   lib/stdlib.in.h
   lib/strcasecmp.c
   lib/stdio.in.h
   lib/stdlib.in.h
   lib/strcasecmp.c
-  lib/streq.h
   lib/strftime.c
   lib/strftime.h
   lib/striconveh.c
   lib/strftime.c
   lib/strftime.h
   lib/striconveh.c
@@ -683,8 +798,10 @@ AC_DEFUN([gl_FILE_LIST], [
   lib/sys_file.in.h
   lib/sys_socket.in.h
   lib/sys_stat.in.h
   lib/sys_file.in.h
   lib/sys_socket.in.h
   lib/sys_stat.in.h
+  lib/sys_time.in.h
   lib/time.in.h
   lib/time_r.c
   lib/time.in.h
   lib/time_r.c
+  lib/trunc.c
   lib/unistd.in.h
   lib/unistr.in.h
   lib/unistr/u8-mbtouc-aux.c
   lib/unistd.in.h
   lib/unistr.in.h
   lib/unistr/u8-mbtouc-aux.c
@@ -716,8 +833,7 @@ AC_DEFUN([gl_FILE_LIST], [
   m4/byteswap.m4
   m4/canonicalize.m4
   m4/check-math-lib.m4
   m4/byteswap.m4
   m4/canonicalize.m4
   m4/check-math-lib.m4
-  m4/codeset.m4
-  m4/configmake.m4
+  m4/close.m4
   m4/dos.m4
   m4/double-slash-root.m4
   m4/duplocale.m4
   m4/dos.m4
   m4/double-slash-root.m4
   m4/duplocale.m4
@@ -728,13 +844,12 @@ AC_DEFUN([gl_FILE_LIST], [
   m4/exponentf.m4
   m4/exponentl.m4
   m4/extensions.m4
   m4/exponentf.m4
   m4/exponentl.m4
   m4/extensions.m4
-  m4/fcntl-o.m4
+  m4/fclose.m4
   m4/float_h.m4
   m4/flock.m4
   m4/fpieee.m4
   m4/func.m4
   m4/getaddrinfo.m4
   m4/float_h.m4
   m4/flock.m4
   m4/fpieee.m4
   m4/func.m4
   m4/getaddrinfo.m4
-  m4/glibc21.m4
   m4/gnulib-common.m4
   m4/hostent.m4
   m4/iconv.m4
   m4/gnulib-common.m4
   m4/hostent.m4
   m4/iconv.m4
@@ -757,20 +872,12 @@ AC_DEFUN([gl_FILE_LIST], [
   m4/lib-prefix.m4
   m4/libunistring-base.m4
   m4/libunistring.m4
   m4/lib-prefix.m4
   m4/libunistring-base.m4
   m4/libunistring.m4
-  m4/localcharset.m4
-  m4/locale-fr.m4
-  m4/locale-ja.m4
-  m4/locale-zh.m4
   m4/locale_h.m4
   m4/longlong.m4
   m4/lstat.m4
   m4/malloc.m4
   m4/malloca.m4
   m4/math_h.m4
   m4/locale_h.m4
   m4/longlong.m4
   m4/lstat.m4
   m4/malloc.m4
   m4/malloca.m4
   m4/math_h.m4
-  m4/mbrlen.m4
-  m4/mbrtowc.m4
-  m4/mbsinit.m4
-  m4/mbstate_t.m4
   m4/memchr.m4
   m4/mmap-anon.m4
   m4/multiarch.m4
   m4/memchr.m4
   m4/mmap-anon.m4
   m4/multiarch.m4
@@ -807,9 +914,11 @@ AC_DEFUN([gl_FILE_LIST], [
   m4/sys_file_h.m4
   m4/sys_socket_h.m4
   m4/sys_stat_h.m4
   m4/sys_file_h.m4
   m4/sys_socket_h.m4
   m4/sys_stat_h.m4
+  m4/sys_time_h.m4
   m4/time_h.m4
   m4/time_r.m4
   m4/tm_gmtoff.m4
   m4/time_h.m4
   m4/time_r.m4
   m4/tm_gmtoff.m4
+  m4/trunc.m4
   m4/unistd_h.m4
   m4/vasnprintf.m4
   m4/version-etc.m4
   m4/unistd_h.m4
   m4/vasnprintf.m4
   m4/version-etc.m4
index 69e7733..ed41e9d 100644 (file)
@@ -1,5 +1,5 @@
 # gnulib-tool.m4 serial 2
 # gnulib-tool.m4 serial 2
-dnl Copyright (C) 2004-2005, 2009-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2004-2005, 2009-2011 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 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.
index 7104b30..36ade7e 100644 (file)
@@ -1,5 +1,5 @@
 # hostent.m4 serial 2
 # hostent.m4 serial 2
-dnl Copyright (C) 2008, 2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2008, 2010-2011 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 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.
index 006c907..085cd06 100644 (file)
@@ -1,5 +1,5 @@
 # iconv.m4 serial 17 (gettext-0.18.2)
 # iconv.m4 serial 17 (gettext-0.18.2)
-dnl Copyright (C) 2000-2002, 2007-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2000-2002, 2007-2011 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 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.
index 3b9987b..abfacff 100644 (file)
@@ -1,5 +1,5 @@
 # iconv_h.m4 serial 7
 # iconv_h.m4 serial 7
-dnl Copyright (C) 2007-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2007-2011 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 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.
index f0ec5da..b062e73 100644 (file)
@@ -1,5 +1,5 @@
 # iconv_open.m4 serial 12
 # iconv_open.m4 serial 12
-dnl Copyright (C) 2007-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2007-2011 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 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.
index e37eb05..b3c7849 100644 (file)
@@ -1,5 +1,5 @@
-# include_next.m4 serial 16
-dnl Copyright (C) 2006-2010 Free Software Foundation, Inc.
+# include_next.m4 serial 18
+dnl Copyright (C) 2006-2011 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 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.
@@ -147,11 +147,33 @@ choke me
 # Note: This macro assumes that the header file is not empty after
 # preprocessing, i.e. it does not only define preprocessor macros but also
 # provides some type/enum definitions or function/variable declarations.
 # Note: This macro assumes that the header file is not empty after
 # preprocessing, i.e. it does not only define preprocessor macros but also
 # provides some type/enum definitions or function/variable declarations.
+#
+# This macro also checks whether each header exists, by invoking
+# AC_CHECK_HEADERS_ONCE or AC_CHECK_HEADERS on each argument.
 AC_DEFUN([gl_CHECK_NEXT_HEADERS],
 AC_DEFUN([gl_CHECK_NEXT_HEADERS],
+[
+  gl_NEXT_HEADERS_INTERNAL([$1], [check])
+])
+
+# gl_NEXT_HEADERS(HEADER1 HEADER2 ...)
+# ------------------------------------
+# Like gl_CHECK_NEXT_HEADERS, except do not check whether the headers exist.
+# This is suitable for headers like <stddef.h> that are standardized by C89
+# and therefore can be assumed to exist.
+AC_DEFUN([gl_NEXT_HEADERS],
+[
+  gl_NEXT_HEADERS_INTERNAL([$1], [assume])
+])
+
+# The guts of gl_CHECK_NEXT_HEADERS and gl_NEXT_HEADERS.
+AC_DEFUN([gl_NEXT_HEADERS_INTERNAL],
 [
   AC_REQUIRE([gl_INCLUDE_NEXT])
   AC_REQUIRE([AC_CANONICAL_HOST])
 [
   AC_REQUIRE([gl_INCLUDE_NEXT])
   AC_REQUIRE([AC_CANONICAL_HOST])
-  AC_CHECK_HEADERS_ONCE([$1])
+
+  m4_if([$2], [check],
+    [AC_CHECK_HEADERS_ONCE([$1])
+    ])
 
   m4_foreach_w([gl_HEADER_NAME], [$1],
     [AS_VAR_PUSHDEF([gl_next_header],
 
   m4_foreach_w([gl_HEADER_NAME], [$1],
     [AS_VAR_PUSHDEF([gl_next_header],
@@ -162,39 +184,44 @@ AC_DEFUN([gl_CHECK_NEXT_HEADERS],
        AC_CACHE_CHECK(
          [absolute name of <]m4_defn([gl_HEADER_NAME])[>],
          m4_defn([gl_next_header]),
        AC_CACHE_CHECK(
          [absolute name of <]m4_defn([gl_HEADER_NAME])[>],
          m4_defn([gl_next_header]),
-         [AS_VAR_PUSHDEF([gl_header_exists],
-                         [ac_cv_header_]m4_defn([gl_HEADER_NAME]))
-          if test AS_VAR_GET(gl_header_exists) = yes; then
-            AC_LANG_CONFTEST(
-              [AC_LANG_SOURCE(
-                 [[#include <]]m4_dquote(m4_defn([gl_HEADER_NAME]))[[>]]
-               )])
-            dnl AIX "xlc -E" and "cc -E" omit #line directives for header files
-            dnl that contain only a #include of other header files and no
-            dnl non-comment tokens of their own. This leads to a failure to
-            dnl detect the absolute name of <dirent.h>, <signal.h>, <poll.h>
-            dnl and others. The workaround is to force preservation of comments
-            dnl through option -C. This ensures all necessary #line directives
-            dnl are present. GCC supports option -C as well.
-            case "$host_os" in
-              aix*) gl_absname_cpp="$ac_cpp -C" ;;
-              *)    gl_absname_cpp="$ac_cpp" ;;
-            esac
-            dnl eval is necessary to expand gl_absname_cpp.
-            dnl Ultrix and Pyramid sh refuse to redirect output of eval,
-            dnl so use subshell.
-            AS_VAR_SET([gl_next_header],
-              ['"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD |
-               sed -n '\#/]m4_defn([gl_HEADER_NAME])[#{
-                 s#.*"\(.*/]m4_defn([gl_HEADER_NAME])[\)".*#\1#
-                 s#^/[^/]#//&#
-                 p
-                 q
-               }'`'"'])
-          else
-            AS_VAR_SET([gl_next_header], ['<'gl_HEADER_NAME'>'])
-          fi
-          AS_VAR_POPDEF([gl_header_exists])])
+         [m4_if([$2], [check],
+            [AS_VAR_PUSHDEF([gl_header_exists],
+                            [ac_cv_header_]m4_defn([gl_HEADER_NAME]))
+             if test AS_VAR_GET(gl_header_exists) = yes; then
+             AS_VAR_POPDEF([gl_header_exists])
+            ])
+               AC_LANG_CONFTEST(
+                 [AC_LANG_SOURCE(
+                    [[#include <]]m4_dquote(m4_defn([gl_HEADER_NAME]))[[>]]
+                  )])
+               dnl AIX "xlc -E" and "cc -E" omit #line directives for header
+               dnl files that contain only a #include of other header files and
+               dnl no non-comment tokens of their own. This leads to a failure
+               dnl to detect the absolute name of <dirent.h>, <signal.h>,
+               dnl <poll.h> and others. The workaround is to force preservation
+               dnl of comments through option -C. This ensures all necessary
+               dnl #line directives are present. GCC supports option -C as well.
+               case "$host_os" in
+                 aix*) gl_absname_cpp="$ac_cpp -C" ;;
+                 *)    gl_absname_cpp="$ac_cpp" ;;
+               esac
+               dnl eval is necessary to expand gl_absname_cpp.
+               dnl Ultrix and Pyramid sh refuse to redirect output of eval,
+               dnl so use subshell.
+               AS_VAR_SET([gl_next_header],
+                 ['"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD |
+                  sed -n '\#/]m4_defn([gl_HEADER_NAME])[#{
+                    s#.*"\(.*/]m4_defn([gl_HEADER_NAME])[\)".*#\1#
+                    s#^/[^/]#//&#
+                    p
+                    q
+                  }'`'"'])
+          m4_if([$2], [check],
+            [else
+               AS_VAR_SET([gl_next_header], ['<'gl_HEADER_NAME'>'])
+             fi
+            ])
+         ])
      fi
      AC_SUBST(
        AS_TR_CPP([NEXT_]m4_defn([gl_HEADER_NAME])),
      fi
      AC_SUBST(
        AS_TR_CPP([NEXT_]m4_defn([gl_HEADER_NAME])),
index a6d219c..57580b8 100644 (file)
@@ -1,5 +1,5 @@
-# inet_ntop.m4 serial 12
-dnl Copyright (C) 2005, 2006, 2008, 2009, 2010 Free Software Foundation, Inc.
+# inet_ntop.m4 serial 13
+dnl Copyright (C) 2005-2006, 2008-2011 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 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.
@@ -29,7 +29,13 @@ AC_DEFUN([gl_FUNC_INET_NTOP],
 
 # Prerequisites of lib/inet_ntop.c.
 AC_DEFUN([gl_PREREQ_INET_NTOP], [
 
 # Prerequisites of lib/inet_ntop.c.
 AC_DEFUN([gl_PREREQ_INET_NTOP], [
-  AC_CHECK_DECLS([inet_ntop],,,[#include <arpa/inet.h>])
+  AC_CHECK_HEADERS_ONCE([netdb.h])
+  AC_CHECK_DECLS([inet_ntop],,,
+    [#include <arpa/inet.h>
+     #if HAVE_NETDB_H
+     # include <netdb.h>
+     #endif
+    ])
   if test $ac_cv_have_decl_inet_ntop = no; then
     HAVE_DECL_INET_NTOP=0
   fi
   if test $ac_cv_have_decl_inet_ntop = no; then
     HAVE_DECL_INET_NTOP=0
   fi
index 193f17d..9a7ad3b 100644 (file)
@@ -1,5 +1,5 @@
-# inet_pton.m4 serial 10
-dnl Copyright (C) 2006, 2008, 2009, 2010 Free Software Foundation, Inc.
+# inet_pton.m4 serial 11
+dnl Copyright (C) 2006, 2008-2011 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 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.
@@ -29,7 +29,13 @@ AC_DEFUN([gl_FUNC_INET_PTON],
 
 # Prerequisites of lib/inet_pton.c.
 AC_DEFUN([gl_PREREQ_INET_PTON], [
 
 # Prerequisites of lib/inet_pton.c.
 AC_DEFUN([gl_PREREQ_INET_PTON], [
-  AC_CHECK_DECLS([inet_pton],,,[#include <arpa/inet.h>])
+  AC_CHECK_HEADERS_ONCE([netdb.h])
+  AC_CHECK_DECLS([inet_pton],,,
+    [#include <arpa/inet.h>
+     #if HAVE_NETDB_H
+     # include <netdb.h>
+     #endif
+    ])
   if test $ac_cv_have_decl_inet_pton = no; then
     HAVE_DECL_INET_PTON=0
   fi
   if test $ac_cv_have_decl_inet_pton = no; then
     HAVE_DECL_INET_PTON=0
   fi
index 4ef768d..a459080 100644 (file)
@@ -1,5 +1,5 @@
 # inline.m4 serial 4
 # inline.m4 serial 4
-dnl Copyright (C) 2006, 2009, 2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2006, 2009-2011 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 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.
index 493e4a9..7341054 100644 (file)
@@ -1,5 +1,5 @@
 # intmax_t.m4 serial 8
 # intmax_t.m4 serial 8
-dnl Copyright (C) 1997-2004, 2006-2007, 2009-2010 Free Software Foundation,
+dnl Copyright (C) 1997-2004, 2006-2007, 2009-2011 Free Software Foundation,
 dnl Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
index 9d8f926..f10fd54 100644 (file)
@@ -1,5 +1,5 @@
 # inttypes_h.m4 serial 10
 # inttypes_h.m4 serial 10
-dnl Copyright (C) 1997-2004, 2006, 2008-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 1997-2004, 2006, 2008-2011 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 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.
index 6a24123..ab3cf9e 100644 (file)
@@ -1,5 +1,5 @@
 # isinf.m4 serial 3
 # isinf.m4 serial 3
-dnl Copyright (C) 2007-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2007-2011 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 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.
index eb61d56..dc3e290 100644 (file)
@@ -1,5 +1,5 @@
 # isnan.m4 serial 3
 # isnan.m4 serial 3
-dnl Copyright (C) 2007-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2007-2011 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 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.
index 31764f7..fb2c0f9 100644 (file)
@@ -1,5 +1,5 @@
-# isnand.m4 serial 7
-dnl Copyright (C) 2007-2010 Free Software Foundation, Inc.
+# isnand.m4 serial 8
+dnl Copyright (C) 2007-2011 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 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 @@ AC_DEFUN([gl_HAVE_ISNAND_IN_LIBM],
            [[#include <math.h>
              #if __GNUC__ >= 4
              # undef isnand
            [[#include <math.h>
              #if __GNUC__ >= 4
              # undef isnand
-             # define isnand(x) __builtin_isnand ((double)(x))
+             # define isnand(x) __builtin_isnan ((double)(x))
              #elif defined isnan
              # undef isnand
              # define isnand(x) isnan ((double)(x))
              #elif defined isnan
              # undef isnand
              # define isnand(x) isnan ((double)(x))
index f1a28e8..92024bb 100644 (file)
@@ -1,5 +1,5 @@
 # isnanf.m4 serial 12
 # isnanf.m4 serial 12
-dnl Copyright (C) 2007-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2007-2011 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 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.
index 0f425a1..5d73759 100644 (file)
@@ -1,5 +1,5 @@
 # isnanl.m4 serial 14
 # isnanl.m4 serial 14
-dnl Copyright (C) 2007-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2007-2011 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 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.
index 8fd8c89..aec2f41 100644 (file)
@@ -1,5 +1,5 @@
 # ld-version-script.m4 serial 2
 # ld-version-script.m4 serial 2
-dnl Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2008-2011 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 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.
index 294db72..ae003f7 100644 (file)
@@ -1,5 +1,5 @@
 # lib-ld.m4 serial 5 (gettext-0.18.2)
 # lib-ld.m4 serial 5 (gettext-0.18.2)
-dnl Copyright (C) 1996-2003, 2009-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 1996-2003, 2009-2011 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 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.
index 2ea9d6d..b024dd4 100644 (file)
@@ -1,5 +1,5 @@
 # lib-link.m4 serial 25 (gettext-0.18.2)
 # lib-link.m4 serial 25 (gettext-0.18.2)
-dnl Copyright (C) 2001-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2001-2011 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 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.
index 1601cea..7e5f0bd 100644 (file)
@@ -1,5 +1,5 @@
 # lib-prefix.m4 serial 7 (gettext-0.18)
 # lib-prefix.m4 serial 7 (gettext-0.18)
-dnl Copyright (C) 2001-2005, 2008-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2001-2005, 2008-2011 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 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.
index 8335ec5..9831448 100644 (file)
@@ -1,5 +1,5 @@
 # libunistring-base.m4 serial 5
 # libunistring-base.m4 serial 5
-dnl Copyright (C) 2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2010-2011 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 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.
index 61b7cc9..19c6860 100644 (file)
@@ -1,5 +1,5 @@
 # libunistring.m4 serial 11
 # libunistring.m4 serial 11
-dnl Copyright (C) 2009-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2009-2011 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 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.
diff --git a/m4/localcharset.m4 b/m4/localcharset.m4
deleted file mode 100644 (file)
index ee2e801..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-# localcharset.m4 serial 7
-dnl Copyright (C) 2002, 2004, 2006, 2009, 2010 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-AC_DEFUN([gl_LOCALCHARSET],
-[
-  dnl Prerequisites of lib/localcharset.c.
-  AC_REQUIRE([AM_LANGINFO_CODESET])
-  AC_REQUIRE([gl_FCNTL_O_FLAGS])
-  AC_CHECK_DECLS_ONCE([getc_unlocked])
-
-  dnl Prerequisites of the lib/Makefile.am snippet.
-  AC_REQUIRE([AC_CANONICAL_HOST])
-  AC_REQUIRE([gl_GLIBC21])
-])
diff --git a/m4/locale-fr.m4 b/m4/locale-fr.m4
deleted file mode 100644 (file)
index e353432..0000000
+++ /dev/null
@@ -1,188 +0,0 @@
-# locale-fr.m4 serial 12
-dnl Copyright (C) 2003, 2005-2010 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-dnl From Bruno Haible.
-
-dnl Determine the name of a french locale with traditional encoding.
-AC_DEFUN([gt_LOCALE_FR],
-[
-  AC_REQUIRE([AC_CANONICAL_HOST])
-  AC_REQUIRE([AM_LANGINFO_CODESET])
-  AC_CACHE_CHECK([for a traditional french locale], [gt_cv_locale_fr], [
-    AC_LANG_CONFTEST([AC_LANG_SOURCE([
-changequote(,)dnl
-#include <locale.h>
-#include <time.h>
-#if HAVE_LANGINFO_CODESET
-# include <langinfo.h>
-#endif
-#include <stdlib.h>
-#include <string.h>
-struct tm t;
-char buf[16];
-int main () {
-  /* Check whether the given locale name is recognized by the system.  */
-  if (setlocale (LC_ALL, "") == NULL) return 1;
-  /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
-     On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
-     is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
-     On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
-     succeeds but then nl_langinfo(CODESET) is "646". In this situation,
-     some unit tests fail.
-     On MirBSD 10, when an unsupported locale is specified, setlocale()
-     succeeds but then nl_langinfo(CODESET) is "UTF-8".  */
-#if HAVE_LANGINFO_CODESET
-  {
-    const char *cs = nl_langinfo (CODESET);
-    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
-        || strcmp (cs, "UTF-8") == 0)
-      return 1;
-  }
-#endif
-#ifdef __CYGWIN__
-  /* On Cygwin, avoid locale names without encoding suffix, because the
-     locale_charset() function relies on the encoding suffix.  Note that
-     LC_ALL is set on the command line.  */
-  if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
-#endif
-  /* Check whether in the abbreviation of the second month, the second
-     character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only
-     one byte long. This excludes the UTF-8 encoding.  */
-  t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
-  if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1;
-  /* Check whether the decimal separator is a comma.
-     On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point
-     are nl_langinfo(RADIXCHAR) are both ".".  */
-  if (localeconv () ->decimal_point[0] != ',') return 1;
-  return 0;
-}
-changequote([,])dnl
-      ])])
-    if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then
-      # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
-      # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the
-      # configure script would override the LC_ALL setting. Likewise for
-      # LC_CTYPE, which is also set at the beginning of the configure script.
-      # Test for the usual locale name.
-      if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
-        gt_cv_locale_fr=fr_FR
-      else
-        # Test for the locale name with explicit encoding suffix.
-        if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
-          gt_cv_locale_fr=fr_FR.ISO-8859-1
-        else
-          # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name.
-          if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
-            gt_cv_locale_fr=fr_FR.ISO8859-1
-          else
-            # Test for the HP-UX locale name.
-            if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
-              gt_cv_locale_fr=fr_FR.iso88591
-            else
-              # Test for the Solaris 7 locale name.
-              if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
-                gt_cv_locale_fr=fr
-              else
-                # None found.
-                gt_cv_locale_fr=none
-              fi
-            fi
-          fi
-        fi
-      fi
-    fi
-    rm -fr conftest*
-  ])
-  LOCALE_FR=$gt_cv_locale_fr
-  AC_SUBST([LOCALE_FR])
-])
-
-dnl Determine the name of a french locale with UTF-8 encoding.
-AC_DEFUN([gt_LOCALE_FR_UTF8],
-[
-  AC_REQUIRE([AM_LANGINFO_CODESET])
-  AC_CACHE_CHECK([for a french Unicode locale], [gt_cv_locale_fr_utf8], [
-    AC_LANG_CONFTEST([AC_LANG_SOURCE([
-changequote(,)dnl
-#include <locale.h>
-#include <time.h>
-#if HAVE_LANGINFO_CODESET
-# include <langinfo.h>
-#endif
-#include <stdlib.h>
-#include <string.h>
-struct tm t;
-char buf[16];
-int main () {
-  /* On BeOS and Haiku, locales are not implemented in libc.  Rather, libintl
-     imitates locale dependent behaviour by looking at the environment
-     variables, and all locales use the UTF-8 encoding.  */
-#if !(defined __BEOS__ || defined __HAIKU__)
-  /* Check whether the given locale name is recognized by the system.  */
-  if (setlocale (LC_ALL, "") == NULL) return 1;
-  /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
-     On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
-     is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
-     On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
-     succeeds but then nl_langinfo(CODESET) is "646". In this situation,
-     some unit tests fail.  */
-# if HAVE_LANGINFO_CODESET
-  {
-    const char *cs = nl_langinfo (CODESET);
-    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0)
-      return 1;
-  }
-# endif
-# ifdef __CYGWIN__
-  /* On Cygwin, avoid locale names without encoding suffix, because the
-     locale_charset() function relies on the encoding suffix.  Note that
-     LC_ALL is set on the command line.  */
-  if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
-# endif
-  /* Check whether in the abbreviation of the second month, the second
-     character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is
-     two bytes long, with UTF-8 encoding.  */
-  t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
-  if (strftime (buf, sizeof (buf), "%b", &t) < 4
-      || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v')
-    return 1;
-#endif
-  /* Check whether the decimal separator is a comma.
-     On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point
-     are nl_langinfo(RADIXCHAR) are both ".".  */
-  if (localeconv () ->decimal_point[0] != ',') return 1;
-  return 0;
-}
-changequote([,])dnl
-      ])])
-    if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then
-      # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
-      # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the
-      # configure script would override the LC_ALL setting. Likewise for
-      # LC_CTYPE, which is also set at the beginning of the configure script.
-      # Test for the usual locale name.
-      if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
-        gt_cv_locale_fr_utf8=fr_FR
-      else
-        # Test for the locale name with explicit encoding suffix.
-        if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
-          gt_cv_locale_fr_utf8=fr_FR.UTF-8
-        else
-          # Test for the Solaris 7 locale name.
-          if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
-            gt_cv_locale_fr_utf8=fr.UTF-8
-          else
-            # None found.
-            gt_cv_locale_fr_utf8=none
-          fi
-        fi
-      fi
-    fi
-    rm -fr conftest*
-  ])
-  LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8
-  AC_SUBST([LOCALE_FR_UTF8])
-])
diff --git a/m4/locale-ja.m4 b/m4/locale-ja.m4
deleted file mode 100644 (file)
index 3168400..0000000
+++ /dev/null
@@ -1,110 +0,0 @@
-# locale-ja.m4 serial 8
-dnl Copyright (C) 2003, 2005-2010 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-dnl From Bruno Haible.
-
-dnl Determine the name of a japanese locale with EUC-JP encoding.
-AC_DEFUN([gt_LOCALE_JA],
-[
-  AC_REQUIRE([AC_CANONICAL_HOST])
-  AC_REQUIRE([AM_LANGINFO_CODESET])
-  AC_CACHE_CHECK([for a traditional japanese locale], [gt_cv_locale_ja], [
-    AC_LANG_CONFTEST([AC_LANG_SOURCE([
-changequote(,)dnl
-#include <locale.h>
-#include <time.h>
-#if HAVE_LANGINFO_CODESET
-# include <langinfo.h>
-#endif
-#include <stdlib.h>
-#include <string.h>
-struct tm t;
-char buf[16];
-int main ()
-{
-  const char *p;
-  /* Check whether the given locale name is recognized by the system.  */
-  if (setlocale (LC_ALL, "") == NULL) return 1;
-  /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
-     On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
-     is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
-     On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
-     succeeds but then nl_langinfo(CODESET) is "646". In this situation,
-     some unit tests fail.
-     On MirBSD 10, when an unsupported locale is specified, setlocale()
-     succeeds but then nl_langinfo(CODESET) is "UTF-8".  */
-#if HAVE_LANGINFO_CODESET
-  {
-    const char *cs = nl_langinfo (CODESET);
-    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
-        || strcmp (cs, "UTF-8") == 0)
-      return 1;
-  }
-#endif
-#ifdef __CYGWIN__
-  /* On Cygwin, avoid locale names without encoding suffix, because the
-     locale_charset() function relies on the encoding suffix.  Note that
-     LC_ALL is set on the command line.  */
-  if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
-#endif
-  /* Check whether MB_CUR_MAX is > 1.  This excludes the dysfunctional locales
-     on Cygwin 1.5.x.  */
-  if (MB_CUR_MAX == 1)
-    return 1;
-  /* Check whether in a month name, no byte in the range 0x80..0x9F occurs.
-     This excludes the UTF-8 encoding (except on MirBSD).  */
-  t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
-  if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1;
-  for (p = buf; *p != '\0'; p++)
-    if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0)
-      return 1;
-  return 0;
-}
-changequote([,])dnl
-      ])])
-    if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then
-      # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
-      # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the
-      # configure script would override the LC_ALL setting. Likewise for
-      # LC_CTYPE, which is also set at the beginning of the configure script.
-      # Test for the AIX locale name.
-      if (LC_ALL=ja_JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
-        gt_cv_locale_ja=ja_JP
-      else
-        # Test for the locale name with explicit encoding suffix.
-        if (LC_ALL=ja_JP.EUC-JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
-          gt_cv_locale_ja=ja_JP.EUC-JP
-        else
-          # Test for the HP-UX, OSF/1, NetBSD locale name.
-          if (LC_ALL=ja_JP.eucJP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
-            gt_cv_locale_ja=ja_JP.eucJP
-          else
-            # Test for the IRIX, FreeBSD locale name.
-            if (LC_ALL=ja_JP.EUC LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
-              gt_cv_locale_ja=ja_JP.EUC
-            else
-              # Test for the Solaris 7 locale name.
-              if (LC_ALL=ja LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
-                gt_cv_locale_ja=ja
-              else
-                # Special test for NetBSD 1.6.
-                if test -f /usr/share/locale/ja_JP.eucJP/LC_CTYPE; then
-                  gt_cv_locale_ja=ja_JP.eucJP
-                else
-                  # None found.
-                  gt_cv_locale_ja=none
-                fi
-              fi
-            fi
-          fi
-        fi
-      fi
-    fi
-    rm -fr conftest*
-  ])
-  LOCALE_JA=$gt_cv_locale_ja
-  AC_SUBST([LOCALE_JA])
-])
diff --git a/m4/locale-zh.m4 b/m4/locale-zh.m4
deleted file mode 100644 (file)
index be176c1..0000000
+++ /dev/null
@@ -1,95 +0,0 @@
-# locale-zh.m4 serial 7
-dnl Copyright (C) 2003, 2005-2010 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-dnl From Bruno Haible.
-
-dnl Determine the name of a chinese locale with GB18030 encoding.
-AC_DEFUN([gt_LOCALE_ZH_CN],
-[
-  AC_REQUIRE([AC_CANONICAL_HOST])
-  AC_REQUIRE([AM_LANGINFO_CODESET])
-  AC_CACHE_CHECK([for a transitional chinese locale], [gt_cv_locale_zh_CN], [
-    AC_LANG_CONFTEST([AC_LANG_SOURCE([
-changequote(,)dnl
-#include <locale.h>
-#include <stdlib.h>
-#include <time.h>
-#if HAVE_LANGINFO_CODESET
-# include <langinfo.h>
-#endif
-#include <stdlib.h>
-#include <string.h>
-struct tm t;
-char buf[16];
-int main ()
-{
-  const char *p;
-  /* Check whether the given locale name is recognized by the system.  */
-  if (setlocale (LC_ALL, "") == NULL) return 1;
-  /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
-     On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
-     is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
-     On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
-     succeeds but then nl_langinfo(CODESET) is "646". In this situation,
-     some unit tests fail.
-     On MirBSD 10, when an unsupported locale is specified, setlocale()
-     succeeds but then nl_langinfo(CODESET) is "UTF-8".  */
-#if HAVE_LANGINFO_CODESET
-  {
-    const char *cs = nl_langinfo (CODESET);
-    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
-        || strcmp (cs, "UTF-8") == 0)
-      return 1;
-  }
-#endif
-#ifdef __CYGWIN__
-  /* On Cygwin, avoid locale names without encoding suffix, because the
-     locale_charset() function relies on the encoding suffix.  Note that
-     LC_ALL is set on the command line.  */
-  if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
-#endif
-  /* Check whether in a month name, no byte in the range 0x80..0x9F occurs.
-     This excludes the UTF-8 encoding (except on MirBSD).  */
-  t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
-  if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1;
-  for (p = buf; *p != '\0'; p++)
-    if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0)
-      return 1;
-  /* Check whether a typical GB18030 multibyte sequence is recognized as a
-     single wide character.  This excludes the GB2312 and GBK encodings.  */
-  if (mblen ("\203\062\332\066", 5) != 4)
-    return 1;
-  return 0;
-}
-changequote([,])dnl
-      ])])
-    if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then
-      # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
-      # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the
-      # configure script would override the LC_ALL setting. Likewise for
-      # LC_CTYPE, which is also set at the beginning of the configure script.
-      # Test for the locale name without encoding suffix.
-      if (LC_ALL=zh_CN LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
-        gt_cv_locale_zh_CN=zh_CN
-      else
-        # Test for the locale name with explicit encoding suffix.
-        if (LC_ALL=zh_CN.GB18030 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
-          gt_cv_locale_zh_CN=zh_CN.GB18030
-        else
-          # None found.
-          gt_cv_locale_zh_CN=none
-        fi
-      fi
-    else
-      # If there was a link error, due to mblen(), the system is so old that
-      # it certainly doesn't have a chinese locale.
-      gt_cv_locale_zh_CN=none
-    fi
-    rm -fr conftest*
-  ])
-  LOCALE_ZH_CN=$gt_cv_locale_zh_CN
-  AC_SUBST([LOCALE_ZH_CN])
-])
index 8f4f3d4..4d0f894 100644 (file)
@@ -1,5 +1,5 @@
-# locale_h.m4 serial 11
-dnl Copyright (C) 2007, 2009-2010 Free Software Foundation, Inc.
+# locale_h.m4 serial 13
+dnl Copyright (C) 2007, 2009-2011 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 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.
@@ -55,7 +55,7 @@ AC_DEFUN([gl_LOCALE_H],
   AC_SUBST([HAVE_XLOCALE_H])
 
   dnl <locale.h> is always overridden, because of GNULIB_POSIXCHECK.
   AC_SUBST([HAVE_XLOCALE_H])
 
   dnl <locale.h> is always overridden, because of GNULIB_POSIXCHECK.
-  gl_CHECK_NEXT_HEADERS([locale.h])
+  gl_NEXT_HEADERS([locale.h])
 
   if test -n "$STDDEF_H" \
      || test $gl_cv_header_locale_h_posix2001 = no \
 
   if test -n "$STDDEF_H" \
      || test $gl_cv_header_locale_h_posix2001 = no \
@@ -70,7 +70,8 @@ AC_DEFUN([gl_LOCALE_H],
 #if HAVE_XLOCALE_H
 # include <xlocale.h>
 #endif
 #if HAVE_XLOCALE_H
 # include <xlocale.h>
 #endif
-   ]], [duplocale])
+    ]],
+    [setlocale duplocale])
 ])
 
 dnl Unconditionally enables the replacement of <locale.h>.
 ])
 
 dnl Unconditionally enables the replacement of <locale.h>.
@@ -91,8 +92,10 @@ AC_DEFUN([gl_LOCALE_MODULE_INDICATOR],
 
 AC_DEFUN([gl_LOCALE_H_DEFAULTS],
 [
 
 AC_DEFUN([gl_LOCALE_H_DEFAULTS],
 [
+  GNULIB_SETLOCALE=0;  AC_SUBST([GNULIB_SETLOCALE])
   GNULIB_DUPLOCALE=0;  AC_SUBST([GNULIB_DUPLOCALE])
   dnl Assume proper GNU behavior unless another module says otherwise.
   HAVE_DUPLOCALE=1;    AC_SUBST([HAVE_DUPLOCALE])
   GNULIB_DUPLOCALE=0;  AC_SUBST([GNULIB_DUPLOCALE])
   dnl Assume proper GNU behavior unless another module says otherwise.
   HAVE_DUPLOCALE=1;    AC_SUBST([HAVE_DUPLOCALE])
+  REPLACE_SETLOCALE=0; AC_SUBST([REPLACE_SETLOCALE])
   REPLACE_DUPLOCALE=0; AC_SUBST([REPLACE_DUPLOCALE])
 ])
   REPLACE_DUPLOCALE=0; AC_SUBST([REPLACE_DUPLOCALE])
 ])
index cca3c1a..a4d95aa 100644 (file)
@@ -1,5 +1,5 @@
 # longlong.m4 serial 14
 # longlong.m4 serial 14
-dnl Copyright (C) 1999-2007, 2009-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 1999-2007, 2009-2011 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 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.
index 236af54..b9b22a6 100644 (file)
@@ -1,6 +1,6 @@
 # serial 21
 
 # serial 21
 
-# Copyright (C) 1997-2001, 2003-2010 Free Software Foundation, Inc.
+# Copyright (C) 1997-2001, 2003-2011 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
index 7a74925..8094444 100644 (file)
@@ -1,5 +1,5 @@
 # malloc.m4 serial 12
 # malloc.m4 serial 12
-dnl Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2007, 2009-2011 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 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.
index e07c6d9..aec43f5 100644 (file)
@@ -1,5 +1,5 @@
 # malloca.m4 serial 1
 # malloca.m4 serial 1
-dnl Copyright (C) 2003-2004, 2006-2007, 2009-2010 Free Software Foundation,
+dnl Copyright (C) 2003-2004, 2006-2007, 2009-2011 Free Software Foundation,
 dnl Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
index 2d89ca3..7b46aee 100644 (file)
@@ -1,5 +1,5 @@
-# math_h.m4 serial 21
-dnl Copyright (C) 2007-2010 Free Software Foundation, Inc.
+# math_h.m4 serial 25
+dnl Copyright (C) 2007-2011 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 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.
@@ -57,10 +57,12 @@ AC_DEFUN([gl_MATH_H_DEFAULTS],
   GNULIB_ACOSL=0;    AC_SUBST([GNULIB_ACOSL])
   GNULIB_ASINL=0;    AC_SUBST([GNULIB_ASINL])
   GNULIB_ATANL=0;    AC_SUBST([GNULIB_ATANL])
   GNULIB_ACOSL=0;    AC_SUBST([GNULIB_ACOSL])
   GNULIB_ASINL=0;    AC_SUBST([GNULIB_ASINL])
   GNULIB_ATANL=0;    AC_SUBST([GNULIB_ATANL])
+  GNULIB_CEIL=0;     AC_SUBST([GNULIB_CEIL])
   GNULIB_CEILF=0;    AC_SUBST([GNULIB_CEILF])
   GNULIB_CEILL=0;    AC_SUBST([GNULIB_CEILL])
   GNULIB_COSL=0;     AC_SUBST([GNULIB_COSL])
   GNULIB_EXPL=0;     AC_SUBST([GNULIB_EXPL])
   GNULIB_CEILF=0;    AC_SUBST([GNULIB_CEILF])
   GNULIB_CEILL=0;    AC_SUBST([GNULIB_CEILL])
   GNULIB_COSL=0;     AC_SUBST([GNULIB_COSL])
   GNULIB_EXPL=0;     AC_SUBST([GNULIB_EXPL])
+  GNULIB_FLOOR=0;    AC_SUBST([GNULIB_FLOOR])
   GNULIB_FLOORF=0;   AC_SUBST([GNULIB_FLOORF])
   GNULIB_FLOORL=0;   AC_SUBST([GNULIB_FLOORL])
   GNULIB_FREXP=0;    AC_SUBST([GNULIB_FREXP])
   GNULIB_FLOORF=0;   AC_SUBST([GNULIB_FLOORF])
   GNULIB_FLOORL=0;   AC_SUBST([GNULIB_FLOORL])
   GNULIB_FREXP=0;    AC_SUBST([GNULIB_FREXP])
@@ -119,8 +121,10 @@ AC_DEFUN([gl_MATH_H_DEFAULTS],
   HAVE_DECL_TRUNC=1;           AC_SUBST([HAVE_DECL_TRUNC])
   HAVE_DECL_TRUNCF=1;          AC_SUBST([HAVE_DECL_TRUNCF])
   HAVE_DECL_TRUNCL=1;          AC_SUBST([HAVE_DECL_TRUNCL])
   HAVE_DECL_TRUNC=1;           AC_SUBST([HAVE_DECL_TRUNC])
   HAVE_DECL_TRUNCF=1;          AC_SUBST([HAVE_DECL_TRUNCF])
   HAVE_DECL_TRUNCL=1;          AC_SUBST([HAVE_DECL_TRUNCL])
+  REPLACE_CEIL=0;              AC_SUBST([REPLACE_CEIL])
   REPLACE_CEILF=0;             AC_SUBST([REPLACE_CEILF])
   REPLACE_CEILL=0;             AC_SUBST([REPLACE_CEILL])
   REPLACE_CEILF=0;             AC_SUBST([REPLACE_CEILF])
   REPLACE_CEILL=0;             AC_SUBST([REPLACE_CEILL])
+  REPLACE_FLOOR=0;             AC_SUBST([REPLACE_FLOOR])
   REPLACE_FLOORF=0;            AC_SUBST([REPLACE_FLOORF])
   REPLACE_FLOORL=0;            AC_SUBST([REPLACE_FLOORL])
   REPLACE_FREXP=0;             AC_SUBST([REPLACE_FREXP])
   REPLACE_FLOORF=0;            AC_SUBST([REPLACE_FLOORF])
   REPLACE_FLOORL=0;            AC_SUBST([REPLACE_FLOORL])
   REPLACE_FREXP=0;             AC_SUBST([REPLACE_FREXP])
@@ -136,5 +140,7 @@ AC_DEFUN([gl_MATH_H_DEFAULTS],
   REPLACE_ROUNDL=0;            AC_SUBST([REPLACE_ROUNDL])
   REPLACE_SIGNBIT=0;           AC_SUBST([REPLACE_SIGNBIT])
   REPLACE_SIGNBIT_USING_GCC=0; AC_SUBST([REPLACE_SIGNBIT_USING_GCC])
   REPLACE_ROUNDL=0;            AC_SUBST([REPLACE_ROUNDL])
   REPLACE_SIGNBIT=0;           AC_SUBST([REPLACE_SIGNBIT])
   REPLACE_SIGNBIT_USING_GCC=0; AC_SUBST([REPLACE_SIGNBIT_USING_GCC])
+  REPLACE_TRUNC=0;             AC_SUBST([REPLACE_TRUNC])
+  REPLACE_TRUNCF=0;            AC_SUBST([REPLACE_TRUNCF])
   REPLACE_TRUNCL=0;            AC_SUBST([REPLACE_TRUNCL])
 ])
   REPLACE_TRUNCL=0;            AC_SUBST([REPLACE_TRUNCL])
 ])
diff --git a/m4/mbrlen.m4 b/m4/mbrlen.m4
deleted file mode 100644 (file)
index c08cb85..0000000
+++ /dev/null
@@ -1,201 +0,0 @@
-# mbrlen.m4 serial 4
-dnl Copyright (C) 2008, 2010 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-AC_DEFUN([gl_FUNC_MBRLEN],
-[
-  AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
-
-  AC_REQUIRE([AC_TYPE_MBSTATE_T])
-  AC_REQUIRE([gl_FUNC_MBRTOWC])
-  AC_CHECK_FUNCS_ONCE([mbrlen])
-  if test $ac_cv_func_mbrlen = no; then
-    HAVE_MBRLEN=0
-  else
-    dnl Most bugs affecting the system's mbrtowc function also affect the
-    dnl mbrlen function. So override mbrlen whenever mbrtowc is overridden.
-    dnl We could also run the individual tests below; the results would be
-    dnl the same.
-    if test $REPLACE_MBRTOWC = 1; then
-      REPLACE_MBRLEN=1
-    fi
-  fi
-  if test $HAVE_MBRLEN = 0 || test $REPLACE_MBRLEN = 1; then
-    gl_REPLACE_WCHAR_H
-    AC_LIBOBJ([mbrlen])
-    gl_PREREQ_MBRLEN
-  fi
-])
-
-dnl Test whether mbrlen puts the state into non-initial state when parsing an
-dnl incomplete multibyte character.
-dnl Result is gl_cv_func_mbrlen_incomplete_state.
-
-AC_DEFUN([gl_MBRLEN_INCOMPLETE_STATE],
-[
-  AC_REQUIRE([AC_PROG_CC])
-  AC_REQUIRE([gt_LOCALE_JA])
-  AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
-  AC_CACHE_CHECK([whether mbrlen handles incomplete characters],
-    [gl_cv_func_mbrlen_incomplete_state],
-    [
-      dnl Initial guess, used when cross-compiling or when no suitable locale
-      dnl is present.
-changequote(,)dnl
-      case "$host_os" in
-                     # Guess no on AIX and OSF/1.
-        aix* | osf*) gl_cv_func_mbrlen_incomplete_state="guessing no" ;;
-                     # Guess yes otherwise.
-        *)           gl_cv_func_mbrlen_incomplete_state="guessing yes" ;;
-      esac
-changequote([,])dnl
-      if test $LOCALE_JA != none; then
-        AC_RUN_IFELSE(
-          [AC_LANG_SOURCE([[
-#include <locale.h>
-#include <string.h>
-#include <wchar.h>
-int main ()
-{
-  if (setlocale (LC_ALL, "$LOCALE_JA") != NULL)
-    {
-      const char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */
-      mbstate_t state;
-
-      memset (&state, '\0', sizeof (mbstate_t));
-      if (mbrlen (input + 1, 1, &state) == (size_t)(-2))
-        if (mbsinit (&state))
-          return 1;
-    }
-  return 0;
-}]])],
-          [gl_cv_func_mbrlen_incomplete_state=yes],
-          [gl_cv_func_mbrlen_incomplete_state=no],
-          [])
-      fi
-    ])
-])
-
-dnl Test whether mbrlen, when parsing the end of a multibyte character,
-dnl correctly returns the number of bytes that were needed to complete the
-dnl character (not the total number of bytes of the multibyte character).
-dnl Result is gl_cv_func_mbrlen_retval.
-
-AC_DEFUN([gl_MBRLEN_RETVAL],
-[
-  AC_REQUIRE([AC_PROG_CC])
-  AC_REQUIRE([gt_LOCALE_FR_UTF8])
-  AC_REQUIRE([gt_LOCALE_JA])
-  AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
-  AC_CACHE_CHECK([whether mbrlen has a correct return value],
-    [gl_cv_func_mbrlen_retval],
-    [
-      dnl Initial guess, used when cross-compiling or when no suitable locale
-      dnl is present.
-changequote(,)dnl
-      case "$host_os" in
-                          # Guess no on HP-UX and Solaris.
-        hpux* | solaris*) gl_cv_func_mbrlen_retval="guessing no" ;;
-                          # Guess yes otherwise.
-        *)                gl_cv_func_mbrlen_retval="guessing yes" ;;
-      esac
-changequote([,])dnl
-      if test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none; then
-        AC_RUN_IFELSE(
-          [AC_LANG_SOURCE([[
-#include <locale.h>
-#include <string.h>
-#include <wchar.h>
-int main ()
-{
-  int result = 0;
-  /* This fails on Solaris.  */
-  if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
-    {
-      char input[] = "B\303\274\303\237er"; /* "Büßer" */
-      mbstate_t state;
-
-      memset (&state, '\0', sizeof (mbstate_t));
-      if (mbrlen (input + 1, 1, &state) == (size_t)(-2))
-        {
-          input[1] = '\0';
-          if (mbrlen (input + 2, 5, &state) != 1)
-            result |= 1;
-        }
-    }
-  /* This fails on HP-UX 11.11.  */
-  if (setlocale (LC_ALL, "$LOCALE_JA") != NULL)
-    {
-      char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */
-      mbstate_t state;
-
-      memset (&state, '\0', sizeof (mbstate_t));
-      if (mbrlen (input + 1, 1, &state) == (size_t)(-2))
-        {
-          input[1] = '\0';
-          if (mbrlen (input + 2, 5, &state) != 2)
-            result |= 2;
-        }
-    }
-  return result;
-}]])],
-          [gl_cv_func_mbrlen_retval=yes],
-          [gl_cv_func_mbrlen_retval=no],
-          [])
-      fi
-    ])
-])
-
-dnl Test whether mbrlen, when parsing a NUL character, correctly returns 0.
-dnl Result is gl_cv_func_mbrlen_nul_retval.
-
-AC_DEFUN([gl_MBRLEN_NUL_RETVAL],
-[
-  AC_REQUIRE([AC_PROG_CC])
-  AC_REQUIRE([gt_LOCALE_ZH_CN])
-  AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
-  AC_CACHE_CHECK([whether mbrlen returns 0 when parsing a NUL character],
-    [gl_cv_func_mbrlen_nul_retval],
-    [
-      dnl Initial guess, used when cross-compiling or when no suitable locale
-      dnl is present.
-changequote(,)dnl
-      case "$host_os" in
-                    # Guess no on Solaris 9.
-        solaris2.9) gl_cv_func_mbrlen_nul_retval="guessing no" ;;
-                    # Guess yes otherwise.
-        *)          gl_cv_func_mbrlen_nul_retval="guessing yes" ;;
-      esac
-changequote([,])dnl
-      if test $LOCALE_ZH_CN != none; then
-        AC_RUN_IFELSE(
-          [AC_LANG_SOURCE([[
-#include <locale.h>
-#include <string.h>
-#include <wchar.h>
-int main ()
-{
-  /* This crashes on Solaris 9 inside __mbrtowc_dense_gb18030.  */
-  if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
-    {
-      mbstate_t state;
-
-      memset (&state, '\0', sizeof (mbstate_t));
-      if (mbrlen ("", 1, &state) != 0)
-        return 1;
-    }
-  return 0;
-}]])],
-          [gl_cv_func_mbrlen_nul_retval=yes],
-          [gl_cv_func_mbrlen_nul_retval=no],
-          [])
-      fi
-    ])
-])
-
-# Prerequisites of lib/mbrlen.c.
-AC_DEFUN([gl_PREREQ_MBRLEN], [
-  :
-])
diff --git a/m4/mbrtowc.m4 b/m4/mbrtowc.m4
deleted file mode 100644 (file)
index 1de9aab..0000000
+++ /dev/null
@@ -1,394 +0,0 @@
-# mbrtowc.m4 serial 19
-dnl Copyright (C) 2001-2002, 2004-2005, 2008-2010 Free Software Foundation,
-dnl 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_MBRTOWC],
-[
-  AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
-
-  AC_REQUIRE([AC_TYPE_MBSTATE_T])
-  gl_MBSTATE_T_BROKEN
-
-  AC_CHECK_FUNCS_ONCE([mbrtowc])
-  if test $ac_cv_func_mbrtowc = no; then
-    HAVE_MBRTOWC=0
-  else
-    if test $REPLACE_MBSTATE_T = 1; then
-      REPLACE_MBRTOWC=1
-    else
-      gl_MBRTOWC_NULL_ARG
-      gl_MBRTOWC_RETVAL
-      gl_MBRTOWC_NUL_RETVAL
-      case "$gl_cv_func_mbrtowc_null_arg" in
-        *yes) ;;
-        *) AC_DEFINE([MBRTOWC_NULL_ARG_BUG], [1],
-             [Define if the mbrtowc function has the NULL string argument bug.])
-           REPLACE_MBRTOWC=1
-           ;;
-      esac
-      case "$gl_cv_func_mbrtowc_retval" in
-        *yes) ;;
-        *) AC_DEFINE([MBRTOWC_RETVAL_BUG], [1],
-             [Define if the mbrtowc function returns a wrong return value.])
-           REPLACE_MBRTOWC=1
-           ;;
-      esac
-      case "$gl_cv_func_mbrtowc_nul_retval" in
-        *yes) ;;
-        *) AC_DEFINE([MBRTOWC_NUL_RETVAL_BUG], [1],
-             [Define if the mbrtowc function does not return 0 for a NUL character.])
-           REPLACE_MBRTOWC=1
-           ;;
-      esac
-    fi
-  fi
-  if test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1; then
-    gl_REPLACE_WCHAR_H
-    AC_LIBOBJ([mbrtowc])
-    gl_PREREQ_MBRTOWC
-  fi
-])
-
-dnl Test whether mbsinit() and mbrtowc() need to be overridden in a way that
-dnl redefines the semantics of the given mbstate_t type.
-dnl Result is REPLACE_MBSTATE_T.
-dnl When this is set to 1, we replace both mbsinit() and mbrtowc(), in order to
-dnl avoid inconsistencies.
-
-AC_DEFUN([gl_MBSTATE_T_BROKEN],
-[
-  AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
-
-  AC_REQUIRE([AC_TYPE_MBSTATE_T])
-  AC_CHECK_FUNCS_ONCE([mbsinit])
-  AC_CHECK_FUNCS_ONCE([mbrtowc])
-  if test $ac_cv_func_mbsinit = yes && test $ac_cv_func_mbrtowc = yes; then
-    gl_MBRTOWC_INCOMPLETE_STATE
-    gl_MBRTOWC_SANITYCHECK
-    REPLACE_MBSTATE_T=0
-    case "$gl_cv_func_mbrtowc_incomplete_state" in
-      *yes) ;;
-      *) REPLACE_MBSTATE_T=1 ;;
-    esac
-    case "$gl_cv_func_mbrtowc_sanitycheck" in
-      *yes) ;;
-      *) REPLACE_MBSTATE_T=1 ;;
-    esac
-  else
-    REPLACE_MBSTATE_T=1
-  fi
-  if test $REPLACE_MBSTATE_T = 1; then
-    gl_REPLACE_WCHAR_H
-  fi
-])
-
-dnl Test whether mbrtowc puts the state into non-initial state when parsing an
-dnl incomplete multibyte character.
-dnl Result is gl_cv_func_mbrtowc_incomplete_state.
-
-AC_DEFUN([gl_MBRTOWC_INCOMPLETE_STATE],
-[
-  AC_REQUIRE([AC_PROG_CC])
-  AC_REQUIRE([gt_LOCALE_JA])
-  AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
-  AC_CACHE_CHECK([whether mbrtowc handles incomplete characters],
-    [gl_cv_func_mbrtowc_incomplete_state],
-    [
-      dnl Initial guess, used when cross-compiling or when no suitable locale
-      dnl is present.
-changequote(,)dnl
-      case "$host_os" in
-                     # Guess no on AIX and OSF/1.
-        aix* | osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;;
-                     # Guess yes otherwise.
-        *)           gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;;
-      esac
-changequote([,])dnl
-      if test $LOCALE_JA != none; then
-        AC_RUN_IFELSE(
-          [AC_LANG_SOURCE([[
-#include <locale.h>
-#include <string.h>
-#include <wchar.h>
-int main ()
-{
-  if (setlocale (LC_ALL, "$LOCALE_JA") != NULL)
-    {
-      const char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */
-      mbstate_t state;
-      wchar_t wc;
-
-      memset (&state, '\0', sizeof (mbstate_t));
-      if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
-        if (mbsinit (&state))
-          return 1;
-    }
-  return 0;
-}]])],
-          [gl_cv_func_mbrtowc_incomplete_state=yes],
-          [gl_cv_func_mbrtowc_incomplete_state=no],
-          [:])
-      fi
-    ])
-])
-
-dnl Test whether mbrtowc works not worse than mbtowc.
-dnl Result is gl_cv_func_mbrtowc_sanitycheck.
-
-AC_DEFUN([gl_MBRTOWC_SANITYCHECK],
-[
-  AC_REQUIRE([AC_PROG_CC])
-  AC_REQUIRE([gt_LOCALE_ZH_CN])
-  AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
-  AC_CACHE_CHECK([whether mbrtowc works as well as mbtowc],
-    [gl_cv_func_mbrtowc_sanitycheck],
-    [
-      dnl Initial guess, used when cross-compiling or when no suitable locale
-      dnl is present.
-changequote(,)dnl
-      case "$host_os" in
-                    # Guess no on Solaris 8.
-        solaris2.8) gl_cv_func_mbrtowc_sanitycheck="guessing no" ;;
-                    # Guess yes otherwise.
-        *)          gl_cv_func_mbrtowc_sanitycheck="guessing yes" ;;
-      esac
-changequote([,])dnl
-      if test $LOCALE_ZH_CN != none; then
-        AC_RUN_IFELSE(
-          [AC_LANG_SOURCE([[
-#include <locale.h>
-#include <stdlib.h>
-#include <string.h>
-#include <wchar.h>
-int main ()
-{
-  /* This fails on Solaris 8:
-     mbrtowc returns 2, and sets wc to 0x00F0.
-     mbtowc returns 4 (correct) and sets wc to 0x5EDC.  */
-  if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
-    {
-      char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */
-      mbstate_t state;
-      wchar_t wc;
-
-      memset (&state, '\0', sizeof (mbstate_t));
-      if (mbrtowc (&wc, input + 3, 6, &state) != 4
-          && mbtowc (&wc, input + 3, 6) == 4)
-        return 1;
-    }
-  return 0;
-}]])],
-          [gl_cv_func_mbrtowc_sanitycheck=yes],
-          [gl_cv_func_mbrtowc_sanitycheck=no],
-          [:])
-      fi
-    ])
-])
-
-dnl Test whether mbrtowc supports a NULL string argument correctly.
-dnl Result is gl_cv_func_mbrtowc_null_arg.
-
-AC_DEFUN([gl_MBRTOWC_NULL_ARG],
-[
-  AC_REQUIRE([AC_PROG_CC])
-  AC_REQUIRE([gt_LOCALE_FR_UTF8])
-  AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
-  AC_CACHE_CHECK([whether mbrtowc handles a NULL string argument],
-    [gl_cv_func_mbrtowc_null_arg],
-    [
-      dnl Initial guess, used when cross-compiling or when no suitable locale
-      dnl is present.
-changequote(,)dnl
-      case "$host_os" in
-              # Guess no on OSF/1.
-        osf*) gl_cv_func_mbrtowc_null_arg="guessing no" ;;
-              # Guess yes otherwise.
-        *)    gl_cv_func_mbrtowc_null_arg="guessing yes" ;;
-      esac
-changequote([,])dnl
-      if test $LOCALE_FR_UTF8 != none; then
-        AC_RUN_IFELSE(
-          [AC_LANG_SOURCE([[
-#include <locale.h>
-#include <string.h>
-#include <wchar.h>
-int main ()
-{
-  if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
-    {
-      mbstate_t state;
-      wchar_t wc;
-      int ret;
-
-      memset (&state, '\0', sizeof (mbstate_t));
-      wc = (wchar_t) 0xBADFACE;
-      mbrtowc (&wc, NULL, 5, &state);
-      /* Check that wc was not modified.  */
-      if (wc != (wchar_t) 0xBADFACE)
-        return 1;
-    }
-  return 0;
-}]])],
-          [gl_cv_func_mbrtowc_null_arg=yes],
-          [gl_cv_func_mbrtowc_null_arg=no],
-          [:])
-      fi
-    ])
-])
-
-dnl Test whether mbrtowc, when parsing the end of a multibyte character,
-dnl correctly returns the number of bytes that were needed to complete the
-dnl character (not the total number of bytes of the multibyte character).
-dnl Result is gl_cv_func_mbrtowc_retval.
-
-AC_DEFUN([gl_MBRTOWC_RETVAL],
-[
-  AC_REQUIRE([AC_PROG_CC])
-  AC_REQUIRE([gt_LOCALE_FR_UTF8])
-  AC_REQUIRE([gt_LOCALE_JA])
-  AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
-  AC_CACHE_CHECK([whether mbrtowc has a correct return value],
-    [gl_cv_func_mbrtowc_retval],
-    [
-      dnl Initial guess, used when cross-compiling or when no suitable locale
-      dnl is present.
-changequote(,)dnl
-      case "$host_os" in
-                          # Guess no on HP-UX and Solaris.
-        hpux* | solaris*) gl_cv_func_mbrtowc_retval="guessing no" ;;
-                          # Guess yes otherwise.
-        *)                gl_cv_func_mbrtowc_retval="guessing yes" ;;
-      esac
-changequote([,])dnl
-      if test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none; then
-        AC_RUN_IFELSE(
-          [AC_LANG_SOURCE([[
-#include <locale.h>
-#include <string.h>
-#include <wchar.h>
-int main ()
-{
-  int result = 0;
-  /* This fails on Solaris.  */
-  if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
-    {
-      char input[] = "B\303\274\303\237er"; /* "Büßer" */
-      mbstate_t state;
-      wchar_t wc;
-
-      memset (&state, '\0', sizeof (mbstate_t));
-      if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
-        {
-          input[1] = '\0';
-          if (mbrtowc (&wc, input + 2, 5, &state) != 1)
-            result |= 1;
-        }
-    }
-  /* This fails on HP-UX 11.11.  */
-  if (setlocale (LC_ALL, "$LOCALE_JA") != NULL)
-    {
-      char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */
-      mbstate_t state;
-      wchar_t wc;
-
-      memset (&state, '\0', sizeof (mbstate_t));
-      if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
-        {
-          input[1] = '\0';
-          if (mbrtowc (&wc, input + 2, 5, &state) != 2)
-            result |= 2;
-        }
-    }
-  return result;
-}]])],
-          [gl_cv_func_mbrtowc_retval=yes],
-          [gl_cv_func_mbrtowc_retval=no],
-          [:])
-      fi
-    ])
-])
-
-dnl Test whether mbrtowc, when parsing a NUL character, correctly returns 0.
-dnl Result is gl_cv_func_mbrtowc_nul_retval.
-
-AC_DEFUN([gl_MBRTOWC_NUL_RETVAL],
-[
-  AC_REQUIRE([AC_PROG_CC])
-  AC_REQUIRE([gt_LOCALE_ZH_CN])
-  AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
-  AC_CACHE_CHECK([whether mbrtowc returns 0 when parsing a NUL character],
-    [gl_cv_func_mbrtowc_nul_retval],
-    [
-      dnl Initial guess, used when cross-compiling or when no suitable locale
-      dnl is present.
-changequote(,)dnl
-      case "$host_os" in
-                       # Guess no on Solaris 8 and 9.
-        solaris2.[89]) gl_cv_func_mbrtowc_nul_retval="guessing no" ;;
-                       # Guess yes otherwise.
-        *)             gl_cv_func_mbrtowc_nul_retval="guessing yes" ;;
-      esac
-changequote([,])dnl
-      if test $LOCALE_ZH_CN != none; then
-        AC_RUN_IFELSE(
-          [AC_LANG_SOURCE([[
-#include <locale.h>
-#include <string.h>
-#include <wchar.h>
-int main ()
-{
-  /* This fails on Solaris 8 and 9.  */
-  if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
-    {
-      mbstate_t state;
-      wchar_t wc;
-
-      memset (&state, '\0', sizeof (mbstate_t));
-      if (mbrtowc (&wc, "", 1, &state) != 0)
-        return 1;
-    }
-  return 0;
-}]])],
-          [gl_cv_func_mbrtowc_nul_retval=yes],
-          [gl_cv_func_mbrtowc_nul_retval=no],
-          [:])
-      fi
-    ])
-])
-
-# Prerequisites of lib/mbrtowc.c.
-AC_DEFUN([gl_PREREQ_MBRTOWC], [
-  :
-])
-
-
-dnl From Paul Eggert
-
-dnl This override of an autoconf macro can be removed when autoconf 2.60 or
-dnl newer can be assumed everywhere.
-
-m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.60]),[-1],[
-AC_DEFUN([AC_FUNC_MBRTOWC],
-[
-  dnl Same as AC_FUNC_MBRTOWC in autoconf-2.60.
-  AC_CACHE_CHECK([whether mbrtowc and mbstate_t are properly declared],
-    gl_cv_func_mbrtowc,
-    [AC_LINK_IFELSE(
-       [AC_LANG_PROGRAM(
-            [[#include <wchar.h>]],
-            [[wchar_t wc;
-              char const s[] = "";
-              size_t n = 1;
-              mbstate_t state;
-              return ! (sizeof state && (mbrtowc) (&wc, s, n, &state));]])],
-       gl_cv_func_mbrtowc=yes,
-       gl_cv_func_mbrtowc=no)])
-  if test $gl_cv_func_mbrtowc = yes; then
-    AC_DEFINE([HAVE_MBRTOWC], [1],
-      [Define to 1 if mbrtowc and mbstate_t are properly declared.])
-  fi
-])
-])
diff --git a/m4/mbsinit.m4 b/m4/mbsinit.m4
deleted file mode 100644 (file)
index 46c106f..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-# mbsinit.m4 serial 4
-dnl Copyright (C) 2008, 2010 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-AC_DEFUN([gl_FUNC_MBSINIT],
-[
-  AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
-
-  AC_REQUIRE([AC_TYPE_MBSTATE_T])
-  gl_MBSTATE_T_BROKEN
-
-  AC_CHECK_FUNCS_ONCE([mbsinit])
-  if test $ac_cv_func_mbsinit = no; then
-    HAVE_MBSINIT=0
-  else
-    if test $REPLACE_MBSTATE_T = 1; then
-      REPLACE_MBSINIT=1
-    fi
-  fi
-  if test $HAVE_MBSINIT = 0 || test $REPLACE_MBSINIT = 1; then
-    gl_REPLACE_WCHAR_H
-    AC_LIBOBJ([mbsinit])
-    gl_PREREQ_MBSINIT
-  fi
-])
-
-# Prerequisites of lib/mbsinit.c.
-AC_DEFUN([gl_PREREQ_MBSINIT], [
-  :
-])
diff --git a/m4/mbstate_t.m4 b/m4/mbstate_t.m4
deleted file mode 100644 (file)
index 3e2df29..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-# mbstate_t.m4 serial 12
-dnl Copyright (C) 2000-2002, 2008-2010 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-# From Paul Eggert.
-
-# BeOS 5 has <wchar.h> but does not define mbstate_t,
-# so you can't declare an object of that type.
-# Check for this incompatibility with Standard C.
-
-# AC_TYPE_MBSTATE_T
-# -----------------
-AC_DEFUN([AC_TYPE_MBSTATE_T],
-[
-   AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) dnl for HP-UX 11.11
-
-   AC_CACHE_CHECK([for mbstate_t], [ac_cv_type_mbstate_t],
-     [AC_COMPILE_IFELSE(
-        [AC_LANG_PROGRAM(
-           [AC_INCLUDES_DEFAULT[
-#           include <wchar.h>]],
-           [[mbstate_t x; return sizeof x;]])],
-        [ac_cv_type_mbstate_t=yes],
-        [ac_cv_type_mbstate_t=no])])
-   if test $ac_cv_type_mbstate_t = yes; then
-     AC_DEFINE([HAVE_MBSTATE_T], [1],
-               [Define to 1 if <wchar.h> declares mbstate_t.])
-   else
-     AC_DEFINE([mbstate_t], [int],
-               [Define to a type if <wchar.h> does not define.])
-   fi
-])
index 46db9fb..3c2b313 100644 (file)
@@ -1,5 +1,5 @@
 # memchr.m4 serial 10
 # memchr.m4 serial 10
-dnl Copyright (C) 2002-2004, 2009-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2004, 2009-2011 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 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.
index e20fc3c..7ba7fd2 100644 (file)
@@ -1,5 +1,5 @@
 # mmap-anon.m4 serial 9
 # mmap-anon.m4 serial 9
-dnl Copyright (C) 2005, 2007, 2009-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2005, 2007, 2009-2011 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 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.
index 389bd2b..691d892 100644 (file)
@@ -1,5 +1,5 @@
-# multiarch.m4 serial 5
-dnl Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
+# multiarch.m4 serial 6
+dnl Copyright (C) 2008-2011 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 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,7 @@ dnl with or without modifications, as long as this notice is preserved.
 #                 CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
 #                 CPP="gcc -E" CXXCPP="g++ -E"
 #
 #                 CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
 #                 CPP="gcc -E" CXXCPP="g++ -E"
 #
-# Detect this situation and set the macro AA_APPLE_UNIVERSAL_BUILD at the
-# beginning of config.h and set APPLE_UNIVERSAL_BUILD accordingly.
+# Detect this situation and set APPLE_UNIVERSAL_BUILD accordingly.
 
 AC_DEFUN_ONCE([gl_MULTIARCH],
 [
 
 AC_DEFUN_ONCE([gl_MULTIARCH],
 [
@@ -55,8 +54,6 @@ AC_DEFUN_ONCE([gl_MULTIARCH],
      done
     ])
   if test $gl_cv_c_multiarch = yes; then
      done
     ])
   if test $gl_cv_c_multiarch = yes; then
-    AC_DEFINE([AA_APPLE_UNIVERSAL_BUILD], [1],
-      [Define if the compiler is building for multiple architectures of Apple platforms at once.])
     APPLE_UNIVERSAL_BUILD=1
   else
     APPLE_UNIVERSAL_BUILD=0
     APPLE_UNIVERSAL_BUILD=1
   else
     APPLE_UNIVERSAL_BUILD=0
index c870fb6..9a01cd6 100644 (file)
@@ -1,5 +1,5 @@
-# netdb_h.m4 serial 9
-dnl Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
+# netdb_h.m4 serial 10
+dnl Copyright (C) 2008-2011 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 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,7 +7,6 @@ dnl with or without modifications, as long as this notice is preserved.
 AC_DEFUN([gl_HEADER_NETDB],
 [
   AC_REQUIRE([gl_NETDB_H_DEFAULTS])
 AC_DEFUN([gl_HEADER_NETDB],
 [
   AC_REQUIRE([gl_NETDB_H_DEFAULTS])
-  AC_CHECK_HEADERS_ONCE([netdb.h])
   gl_CHECK_NEXT_HEADERS([netdb.h])
   if test $ac_cv_header_netdb_h = yes; then
     HAVE_NETDB_H=1
   gl_CHECK_NEXT_HEADERS([netdb.h])
   if test $ac_cv_header_netdb_h = yes; then
     HAVE_NETDB_H=1
index cc7a44c..e2d022d 100644 (file)
@@ -1,5 +1,5 @@
 # netinet_in_h.m4 serial 4
 # netinet_in_h.m4 serial 4
-dnl Copyright (C) 2006-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2006-2011 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 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.
index 06bec97..4664ffb 100644 (file)
@@ -1,5 +1,5 @@
 # nproc.m4 serial 4
 # nproc.m4 serial 4
-dnl Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2009-2011 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 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.
index 6a3f857..17b3d64 100644 (file)
@@ -1,5 +1,5 @@
 # pathmax.m4 serial 8
 # pathmax.m4 serial 8
-dnl Copyright (C) 2002-2003, 2005-2006, 2009-2010 Free Software Foundation,
+dnl Copyright (C) 2002-2003, 2005-2006, 2009-2011 Free Software Foundation,
 dnl Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
index 6d1cbfe..9c2ed1e 100644 (file)
@@ -1,5 +1,5 @@
-# printf.m4 serial 40
-dnl Copyright (C) 2003, 2007-2010 Free Software Foundation, Inc.
+# printf.m4 serial 42
+dnl Copyright (C) 2003, 2007-2011 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 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.
@@ -71,8 +71,8 @@ changequote(,)dnl
                                  gl_cv_func_printf_sizes_c99="guessing no";;
            openbsd*)             gl_cv_func_printf_sizes_c99="guessing yes";;
                                  # Guess yes on Solaris >= 2.10.
                                  gl_cv_func_printf_sizes_c99="guessing no";;
            openbsd*)             gl_cv_func_printf_sizes_c99="guessing yes";;
                                  # Guess yes on Solaris >= 2.10.
-           solaris2.[0-9]*)      gl_cv_func_printf_sizes_c99="guessing no";;
-           solaris*)             gl_cv_func_printf_sizes_c99="guessing yes";;
+           solaris2.[1-9][0-9]*) gl_cv_func_printf_sizes_c99="guessing yes";;
+           solaris*)             gl_cv_func_printf_sizes_c99="guessing no";;
                                  # Guess yes on NetBSD >= 3.
            netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
                                  gl_cv_func_printf_sizes_c99="guessing no";;
                                  # Guess yes on NetBSD >= 3.
            netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
                                  gl_cv_func_printf_sizes_c99="guessing no";;
@@ -591,8 +591,8 @@ changequote(,)dnl
            darwin[1-6].*)        gl_cv_func_printf_directive_f="guessing no";;
            darwin*)              gl_cv_func_printf_directive_f="guessing yes";;
                                  # Guess yes on Solaris >= 2.10.
            darwin[1-6].*)        gl_cv_func_printf_directive_f="guessing no";;
            darwin*)              gl_cv_func_printf_directive_f="guessing yes";;
                                  # Guess yes on Solaris >= 2.10.
-           solaris2.[0-9]*)      gl_cv_func_printf_directive_f="guessing no";;
-           solaris*)             gl_cv_func_printf_directive_f="guessing yes";;
+           solaris2.[1-9][0-9]*) gl_cv_func_printf_sizes_c99="guessing yes";;
+           solaris*)             gl_cv_func_printf_sizes_c99="guessing no";;
                                  # If we don't know, assume the worst.
            *)                    gl_cv_func_printf_directive_f="guessing no";;
          esac
                                  # If we don't know, assume the worst.
            *)                    gl_cv_func_printf_directive_f="guessing no";;
          esac
@@ -890,8 +890,9 @@ changequote([,])dnl
 dnl Test whether the *printf family of functions supports large precisions.
 dnl On mingw, precisions larger than 512 are treated like 512, in integer,
 dnl floating-point or pointer output. On Solaris 10/x86, precisions larger
 dnl Test whether the *printf family of functions supports large precisions.
 dnl On mingw, precisions larger than 512 are treated like 512, in integer,
 dnl floating-point or pointer output. On Solaris 10/x86, precisions larger
-dnl than 510 in floating-point output crash the program. On BeOS, precisions
-dnl larger than 1044 crash the program.
+dnl than 510 in floating-point output crash the program. On Solaris 10/SPARC,
+dnl precisions larger than 510 in floating-point output yield wrong results.
+dnl On BeOS, precisions larger than 1044 crash the program.
 dnl Result is gl_cv_func_printf_precision.
 
 AC_DEFUN([gl_PRINTF_PRECISION],
 dnl Result is gl_cv_func_printf_precision.
 
 AC_DEFUN([gl_PRINTF_PRECISION],
@@ -917,6 +918,9 @@ int main ()
     result |= 1;
   if (sprintf (buf, "%.4000f %d", 1.0, 33, 44) < 4000 + 5)
     result |= 2;
     result |= 1;
   if (sprintf (buf, "%.4000f %d", 1.0, 33, 44) < 4000 + 5)
     result |= 2;
+  if (sprintf (buf, "%.511f %d", 1.0, 33, 44) < 511 + 5
+      || buf[0] != '1')
+    result |= 4;
   return result;
 }]])],
         [gl_cv_func_printf_precision=yes],
   return result;
 }]])],
         [gl_cv_func_printf_precision=yes],
@@ -1102,7 +1106,8 @@ changequote(,)dnl
                                  gl_cv_func_snprintf_truncation_c99="guessing no";;
            openbsd*)             gl_cv_func_snprintf_truncation_c99="guessing yes";;
                                  # Guess yes on Solaris >= 2.6.
                                  gl_cv_func_snprintf_truncation_c99="guessing no";;
            openbsd*)             gl_cv_func_snprintf_truncation_c99="guessing yes";;
                                  # Guess yes on Solaris >= 2.6.
-           solaris2.[0-5]*)      gl_cv_func_snprintf_truncation_c99="guessing no";;
+           solaris2.[0-5] | solaris2.[0-5].*)
+                                 gl_cv_func_snprintf_truncation_c99="guessing no";;
            solaris*)             gl_cv_func_snprintf_truncation_c99="guessing yes";;
                                  # Guess yes on AIX >= 4.
            aix[1-3]*)            gl_cv_func_snprintf_truncation_c99="guessing no";;
            solaris*)             gl_cv_func_snprintf_truncation_c99="guessing yes";;
                                  # Guess yes on AIX >= 4.
            aix[1-3]*)            gl_cv_func_snprintf_truncation_c99="guessing no";;
@@ -1161,6 +1166,10 @@ int main ()
   strcpy (buf, "ABCDEF");
   if (snprintf (buf, 3, "%d %d", 4567, 89) != 7)
     return 1;
   strcpy (buf, "ABCDEF");
   if (snprintf (buf, 3, "%d %d", 4567, 89) != 7)
     return 1;
+  if (snprintf (buf, 0, "%d %d", 4567, 89) != 7)
+    return 2;
+  if (snprintf (NULL, 0, "%d %d", 4567, 89) != 7)
+    return 3;
   return 0;
 }]])],
         [gl_cv_func_snprintf_retval_c99=yes],
   return 0;
 }]])],
         [gl_cv_func_snprintf_retval_c99=yes],
@@ -1180,9 +1189,9 @@ changequote(,)dnl
            openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*)
                                  gl_cv_func_snprintf_retval_c99="guessing no";;
            openbsd*)             gl_cv_func_snprintf_retval_c99="guessing yes";;
            openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*)
                                  gl_cv_func_snprintf_retval_c99="guessing no";;
            openbsd*)             gl_cv_func_snprintf_retval_c99="guessing yes";;
-                                 # Guess yes on Solaris >= 2.6.
-           solaris2.[0-5]*)      gl_cv_func_snprintf_retval_c99="guessing no";;
-           solaris*)             gl_cv_func_snprintf_retval_c99="guessing yes";;
+                                 # Guess yes on Solaris >= 2.10.
+           solaris2.[1-9][0-9]*) gl_cv_func_printf_sizes_c99="guessing yes";;
+           solaris*)             gl_cv_func_printf_sizes_c99="guessing no";;
                                  # Guess yes on AIX >= 4.
            aix[1-3]*)            gl_cv_func_snprintf_retval_c99="guessing no";;
            aix*)                 gl_cv_func_snprintf_retval_c99="guessing yes";;
                                  # Guess yes on AIX >= 4.
            aix[1-3]*)            gl_cv_func_snprintf_retval_c99="guessing no";;
            aix*)                 gl_cv_func_snprintf_retval_c99="guessing yes";;
@@ -1243,7 +1252,8 @@ changequote(,)dnl
            darwin[1-6].*)        gl_cv_func_snprintf_directive_n="guessing no";;
            darwin*)              gl_cv_func_snprintf_directive_n="guessing yes";;
                                  # Guess yes on Solaris >= 2.6.
            darwin[1-6].*)        gl_cv_func_snprintf_directive_n="guessing no";;
            darwin*)              gl_cv_func_snprintf_directive_n="guessing yes";;
                                  # Guess yes on Solaris >= 2.6.
-           solaris2.[0-5]*)      gl_cv_func_snprintf_directive_n="guessing no";;
+           solaris2.[0-5] | solaris2.[0-5].*)
+                                 gl_cv_func_snprintf_directive_n="guessing no";;
            solaris*)             gl_cv_func_snprintf_directive_n="guessing yes";;
                                  # Guess yes on AIX >= 4.
            aix[1-3]*)            gl_cv_func_snprintf_directive_n="guessing no";;
            solaris*)             gl_cv_func_snprintf_directive_n="guessing yes";;
                                  # Guess yes on AIX >= 4.
            aix[1-3]*)            gl_cv_func_snprintf_directive_n="guessing no";;
@@ -1371,7 +1381,8 @@ changequote(,)dnl
                                  # Guess yes on Cygwin.
            cygwin*)              gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
                                  # Guess yes on Solaris >= 2.6.
                                  # Guess yes on Cygwin.
            cygwin*)              gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
                                  # Guess yes on Solaris >= 2.6.
-           solaris2.[0-5]*)      gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
+           solaris2.[0-5] | solaris2.[0-5].*)
+                                 gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
            solaris*)             gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
                                  # Guess yes on AIX >= 4.
            aix[1-3]*)            gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
            solaris*)             gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
                                  # Guess yes on AIX >= 4.
            aix[1-3]*)            gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
@@ -1452,10 +1463,10 @@ dnl   Cygwin 1.5.25 (2008)           .  .  .  #  #  .  .  #  .  .  .  .  .  #  .
 dnl   Cygwin 1.5.19 (2006)           #  .  .  #  #  #  .  #  .  #  .  #  #  #  .  .  .  .  .  .
 dnl   Solaris 11 2010-11             .  .  #  #  #  .  .  #  .  .  .  #  .  .  .  .  .  .  .  .
 dnl   Solaris 10                     .  .  #  #  #  .  .  #  .  .  .  #  #  .  .  .  .  .  .  .
 dnl   Cygwin 1.5.19 (2006)           #  .  .  #  #  #  .  #  .  #  .  #  #  #  .  .  .  .  .  .
 dnl   Solaris 11 2010-11             .  .  #  #  #  .  .  #  .  .  .  #  .  .  .  .  .  .  .  .
 dnl   Solaris 10                     .  .  #  #  #  .  .  #  .  .  .  #  #  .  .  .  .  .  .  .
-dnl   Solaris 2.6 ... 9              #  .  #  #  #  #  .  #  .  .  .  #  .  .  .  .  .  .  .  .
+dnl   Solaris 2.6 ... 9              #  .  #  #  #  #  .  #  .  .  .  #  #  .  .  .  #  .  .  .
 dnl   Solaris 2.5.1                  #  .  #  #  #  #  .  #  .  .  .  #  .  .  #  #  #  #  #  #
 dnl   AIX 5.2, 7.1                   .  .  #  #  #  .  .  .  .  .  .  #  .  .  .  .  .  .  .  .
 dnl   Solaris 2.5.1                  #  .  #  #  #  #  .  #  .  .  .  #  .  .  #  #  #  #  #  #
 dnl   AIX 5.2, 7.1                   .  .  #  #  #  .  .  .  .  .  .  #  .  .  .  .  .  .  .  .
-dnl   AIX 4.3.2, 5.1                 #  .  #  #  #  #  .  .  .  .  .  #  .  .  .  .  .  .  .  .
+dnl   AIX 4.3.2, 5.1                 #  .  #  #  #  #  .  .  .  .  .  #  .  .  .  .  #  .  .  .
 dnl   HP-UX 11.31                    .  .  .  .  #  .  .  .  .  .  .  #  .  .  .  .  #  #  .  .
 dnl   HP-UX 11.{00,11,23}            #  .  .  .  #  #  .  .  .  .  .  #  .  .  .  .  #  #  .  #
 dnl   HP-UX 10.20                    #  .  #  .  #  #  .  ?  .  .  #  #  .  .  .  .  #  #  ?  #
 dnl   HP-UX 11.31                    .  .  .  .  #  .  .  .  .  .  .  #  .  .  .  .  #  #  .  .
 dnl   HP-UX 11.{00,11,23}            #  .  .  .  #  #  .  .  .  .  .  #  .  .  .  .  #  #  .  #
 dnl   HP-UX 10.20                    #  .  #  .  #  #  .  ?  .  .  #  #  .  .  .  .  #  #  ?  #
@@ -1465,6 +1476,6 @@ dnl   OSF/1 4.0d                     #  .  #  #  #  #  .  .  .  .  .  #  .  .  #
 dnl   NetBSD 5.0                     .  .  .  #  #  .  .  .  .  .  .  #  .  #  .  .  .  .  .  .
 dnl   NetBSD 4.0                     .  ?  ?  ?  ?  ?  .  ?  .  ?  ?  ?  ?  ?  .  .  .  ?  ?  ?
 dnl   NetBSD 3.0                     .  .  .  .  #  #  .  ?  #  #  ?  #  .  #  .  .  .  .  .  .
 dnl   NetBSD 5.0                     .  .  .  #  #  .  .  .  .  .  .  #  .  #  .  .  .  .  .  .
 dnl   NetBSD 4.0                     .  ?  ?  ?  ?  ?  .  ?  .  ?  ?  ?  ?  ?  .  .  .  ?  ?  ?
 dnl   NetBSD 3.0                     .  .  .  .  #  #  .  ?  #  #  ?  #  .  #  .  .  .  .  .  .
-dnl   Haiku                          .  .  .  #  #  #  .  #  .  .  .  .  .  ?  .  .  .  .  .  .
-dnl   BeOS                           #  #  .  #  #  #  .  ?  #  .  ?  .  #  ?  .  .  .  .  .  .
+dnl   Haiku                          .  .  .  #  #  #  .  #  .  .  .  .  .  ?  .  .  ?  .  .  .
+dnl   BeOS                           #  #  .  #  #  #  .  ?  #  .  ?  .  #  ?  .  .  ?  .  .  .
 dnl   mingw                          #  #  #  #  #  #  .  .  #  #  .  #  #  ?  .  #  #  #  .  .
 dnl   mingw                          #  #  #  #  #  #  .  .  #  #  .  #  #  ?  .  #  #  #  .  .
index a7f0b27..de3900b 100644 (file)
@@ -1,5 +1,5 @@
 # putenv.m4 serial 17
 # putenv.m4 serial 17
-dnl Copyright (C) 2002-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2011 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 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.
index 36cd41f..a502ca5 100644 (file)
@@ -1,5 +1,5 @@
 # readlink.m4 serial 9
 # readlink.m4 serial 9
-dnl Copyright (C) 2003, 2007, 2009, 2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2003, 2007, 2009-2011 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 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.
index d087bd3..ea8eedb 100644 (file)
@@ -1,5 +1,5 @@
 # safe-read.m4 serial 5
 # safe-read.m4 serial 5
-dnl Copyright (C) 2002-2003, 2005-2006, 2009-2010 Free Software Foundation,
+dnl Copyright (C) 2002-2003, 2005-2006, 2009-2011 Free Software Foundation,
 dnl Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
index 2ff11d2..7f6b9f8 100644 (file)
@@ -1,5 +1,5 @@
 # safe-write.m4 serial 3
 # safe-write.m4 serial 3
-dnl Copyright (C) 2002, 2005-2006, 2009-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2002, 2005-2006, 2009-2011 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 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.
index 2486511..c5df01c 100644 (file)
@@ -1,5 +1,5 @@
 # servent.m4 serial 2
 # servent.m4 serial 2
-dnl Copyright (C) 2008, 2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2008, 2010-2011 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 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.
index f3b1a9d..e807098 100644 (file)
@@ -1,5 +1,5 @@
 # size_max.m4 serial 10
 # size_max.m4 serial 10
-dnl Copyright (C) 2003, 2005-2006, 2008-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2003, 2005-2006, 2008-2011 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 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.
index 522b107..8aa5dbe 100644 (file)
@@ -1,5 +1,5 @@
 # snprintf.m4 serial 5
 # snprintf.m4 serial 5
-dnl Copyright (C) 2002-2004, 2007-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2004, 2007-2011 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 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,12 @@ AC_DEFUN([gl_FUNC_SNPRINTF],
     gl_SNPRINTF_SIZE1
     case "$gl_cv_func_snprintf_size1" in
       *yes)
     gl_SNPRINTF_SIZE1
     case "$gl_cv_func_snprintf_size1" in
       *yes)
-        gl_cv_func_snprintf_usable=yes
+        gl_SNPRINTF_RETVAL_C99
+        case "$gl_cv_func_snprintf_retval_c99" in
+          *yes)
+            gl_cv_func_snprintf_usable=yes
+            ;;
+        esac
         ;;
     esac
   fi
         ;;
     esac
   fi
index 7bf02b5..2aa972d 100644 (file)
@@ -1,5 +1,5 @@
 # socketlib.m4 serial 1
 # socketlib.m4 serial 1
-dnl Copyright (C) 2008-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2008-2011 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 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.
index ba9a563..cbe754f 100644 (file)
@@ -1,5 +1,5 @@
 # sockets.m4 serial 7
 # sockets.m4 serial 7
-dnl Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2008-2011 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 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.
index d0d6baa..5e4c69e 100644 (file)
@@ -1,5 +1,5 @@
 # socklen.m4 serial 8
 # socklen.m4 serial 8
-dnl Copyright (C) 2005, 2006, 2007, 2009, 2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2005-2007, 2009-2011 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 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.
index 8806705..27899aa 100644 (file)
@@ -1,5 +1,5 @@
 # sockpfaf.m4 serial 7
 # sockpfaf.m4 serial 7
-dnl Copyright (C) 2004, 2006, 2009, 2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2004, 2006, 2009-2011 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 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.
index e4c160b..d712752 100644 (file)
@@ -1,5 +1,5 @@
 # ssize_t.m4 serial 5 (gettext-0.18.2)
 # ssize_t.m4 serial 5 (gettext-0.18.2)
-dnl Copyright (C) 2001-2003, 2006, 2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2001-2003, 2006, 2010-2011 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 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.
index e653c43..75ddbee 100644 (file)
@@ -1,6 +1,6 @@
 # Checks for stat-related time functions.
 
 # Checks for stat-related time functions.
 
-# Copyright (C) 1998-1999, 2001, 2003, 2005-2007, 2009-2010 Free Software
+# Copyright (C) 1998-1999, 2001, 2003, 2005-2007, 2009-2011 Free Software
 # Foundation, Inc.
 
 # This file is free software; the Free Software Foundation
 # Foundation, Inc.
 
 # This file is free software; the Free Software Foundation
index 1ad8ef5..4883fe2 100644 (file)
@@ -1,6 +1,6 @@
 # serial 6
 
 # serial 6
 
-# Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+# Copyright (C) 2009-2011 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
index 8a62f2e..a1ef178 100644 (file)
@@ -1,5 +1,5 @@
-# stdarg.m4 serial 4
-dnl Copyright (C) 2006, 2008-2010 Free Software Foundation, Inc.
+# stdarg.m4 serial 5
+dnl Copyright (C) 2006, 2008-2011 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 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.
@@ -41,7 +41,7 @@ void (*func) (va_list, va_list) = va_copy;
     if test $gl_aixcc = yes; then
       dnl Provide a substitute <stdarg.h> file.
       STDARG_H=stdarg.h
     if test $gl_aixcc = yes; then
       dnl Provide a substitute <stdarg.h> file.
       STDARG_H=stdarg.h
-      gl_CHECK_NEXT_HEADERS([stdarg.h])
+      gl_NEXT_HEADERS([stdarg.h])
       dnl Fallback for the case when <stdarg.h> contains only macro definitions.
       if test "$gl_cv_next_stdarg_h" = '""'; then
         gl_cv_next_stdarg_h='"///usr/include/stdarg.h"'
       dnl Fallback for the case when <stdarg.h> contains only macro definitions.
       if test "$gl_cv_next_stdarg_h" = '""'; then
         gl_cv_next_stdarg_h='"///usr/include/stdarg.h"'
index 1efe59e..838cf0f 100644 (file)
@@ -1,17 +1,17 @@
 # Check for stdbool.h that conforms to C99.
 
 # Check for stdbool.h that conforms to C99.
 
-dnl Copyright (C) 2002-2006, 2009-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2006, 2009-2011 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 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.
 
-#serial 3
+#serial 4
 
 # Prepare for substituting <stdbool.h> if it is not supported.
 
 AC_DEFUN([AM_STDBOOL_H],
 [
 
 # Prepare for substituting <stdbool.h> if it is not supported.
 
 AC_DEFUN([AM_STDBOOL_H],
 [
-  AC_REQUIRE([AC_HEADER_STDBOOL])
+  AC_REQUIRE([AC_CHECK_HEADER_STDBOOL])
 
   # Define two additional variables used in the Makefile substitution.
 
 
   # Define two additional variables used in the Makefile substitution.
 
@@ -33,11 +33,9 @@ AC_DEFUN([AM_STDBOOL_H],
 # AM_STDBOOL_H will be renamed to gl_STDBOOL_H in the future.
 AC_DEFUN([gl_STDBOOL_H], [AM_STDBOOL_H])
 
 # AM_STDBOOL_H will be renamed to gl_STDBOOL_H in the future.
 AC_DEFUN([gl_STDBOOL_H], [AM_STDBOOL_H])
 
-# This version of the macro is needed in autoconf <= 2.67.  Autoconf has
-# it built in since 2.60, but we want the tweaks from the 2.68 version
-# to avoid rejecting xlc and clang due to relying on extensions.
+# This version of the macro is needed in autoconf <= 2.68.
 
 
-AC_DEFUN([AC_HEADER_STDBOOL],
+AC_DEFUN([AC_CHECK_HEADER_STDBOOL],
   [AC_CACHE_CHECK([for stdbool.h that conforms to C99],
      [ac_cv_header_stdbool_h],
      [AC_COMPILE_IFELSE(
   [AC_CACHE_CHECK([for stdbool.h that conforms to C99],
      [ac_cv_header_stdbool_h],
      [AC_COMPILE_IFELSE(
@@ -98,6 +96,4 @@ AC_DEFUN([AC_HEADER_STDBOOL],
         [ac_cv_header_stdbool_h=yes],
         [ac_cv_header_stdbool_h=no])])
    AC_CHECK_TYPES([_Bool])
         [ac_cv_header_stdbool_h=yes],
         [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.])
-   fi])
+])
index c3ae569..1942b6a 100644 (file)
@@ -1,6 +1,6 @@
 dnl A placeholder for POSIX 2008 <stddef.h>, for platforms that have issues.
 dnl A placeholder for POSIX 2008 <stddef.h>, for platforms that have issues.
-# stddef_h.m4 serial 2
-dnl Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+# stddef_h.m4 serial 3
+dnl Copyright (C) 2009-2011 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 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.
@@ -25,7 +25,7 @@ AC_DEFUN([gl_STDDEF_H],
     STDDEF_H=stddef.h
   fi
   if test -n "$STDDEF_H"; then
     STDDEF_H=stddef.h
   fi
   if test -n "$STDDEF_H"; then
-    gl_CHECK_NEXT_HEADERS([stddef.h])
+    gl_NEXT_HEADERS([stddef.h])
   fi
 ])
 
   fi
 ])
 
index 7fe2836..26654c6 100644 (file)
@@ -1,5 +1,5 @@
-# stdint.m4 serial 36
-dnl Copyright (C) 2001-2010 Free Software Foundation, Inc.
+# stdint.m4 serial 37
+dnl Copyright (C) 2001-2011 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 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.
@@ -145,9 +145,11 @@ uintmax_t j = UINTMAX_MAX;
 
 #include <limits.h> /* for CHAR_BIT */
 #define TYPE_MINIMUM(t) \
 
 #include <limits.h> /* for CHAR_BIT */
 #define TYPE_MINIMUM(t) \
-  ((t) ((t) 0 < (t) -1 ? (t) 0 : ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1)))
+  ((t) ((t) 0 < (t) -1 ? (t) 0 : ~ TYPE_MAXIMUM (t)))
 #define TYPE_MAXIMUM(t) \
 #define TYPE_MAXIMUM(t) \
-  ((t) ((t) 0 < (t) -1 ? (t) -1 : ~ (~ (t) 0 << (sizeof (t) * CHAR_BIT - 1))))
+  ((t) ((t) 0 < (t) -1 \
+        ? (t) -1 \
+        : ((((t) 1 << (sizeof (t) * CHAR_BIT - 2)) - 1) * 2 + 1)))
 struct s {
   int check_PTRDIFF:
       PTRDIFF_MIN == TYPE_MINIMUM (ptrdiff_t)
 struct s {
   int check_PTRDIFF:
       PTRDIFF_MIN == TYPE_MINIMUM (ptrdiff_t)
index 670c0cc..356b14e 100644 (file)
@@ -1,5 +1,5 @@
 # stdint_h.m4 serial 9
 # stdint_h.m4 serial 9
-dnl Copyright (C) 1997-2004, 2006, 2008-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 1997-2004, 2006, 2008-2011 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 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.
index 305ca4e..b6163d6 100644 (file)
@@ -1,5 +1,5 @@
 # stdio_h.m4 serial 32
 # stdio_h.m4 serial 32
-dnl Copyright (C) 2007-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2007-2011 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 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_STDIO_H],
   AC_REQUIRE([gl_STDIO_H_DEFAULTS])
   AC_REQUIRE([AC_C_INLINE])
   AC_REQUIRE([gl_ASM_SYMBOL_PREFIX])
   AC_REQUIRE([gl_STDIO_H_DEFAULTS])
   AC_REQUIRE([AC_C_INLINE])
   AC_REQUIRE([gl_ASM_SYMBOL_PREFIX])
-  gl_CHECK_NEXT_HEADERS([stdio.h])
+  gl_NEXT_HEADERS([stdio.h])
   dnl No need to create extra modules for these functions. Everyone who uses
   dnl <stdio.h> likely needs them.
   GNULIB_FPRINTF=1
   dnl No need to create extra modules for these functions. Everyone who uses
   dnl <stdio.h> likely needs them.
   GNULIB_FPRINTF=1
index 9ec3e00..d28b552 100644 (file)
@@ -1,5 +1,5 @@
-# stdlib_h.m4 serial 33
-dnl Copyright (C) 2007-2010 Free Software Foundation, Inc.
+# stdlib_h.m4 serial 36
+dnl Copyright (C) 2007-2011 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 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,21 +7,7 @@ dnl with or without modifications, as long as this notice is preserved.
 AC_DEFUN([gl_STDLIB_H],
 [
   AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
 AC_DEFUN([gl_STDLIB_H],
 [
   AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
-  gl_CHECK_NEXT_HEADERS([stdlib.h])
-  AC_CHECK_HEADERS([random.h], [], [], [AC_INCLUDES_DEFAULT])
-  if test $ac_cv_header_random_h = yes; then
-    HAVE_RANDOM_H=1
-  else
-    HAVE_RANDOM_H=0
-  fi
-  AC_SUBST([HAVE_RANDOM_H])
-  AC_CHECK_TYPES([struct random_data],
-    [], [HAVE_STRUCT_RANDOM_DATA=0],
-    [[#include <stdlib.h>
-      #if HAVE_RANDOM_H
-      # include <random.h>
-      #endif
-    ]])
+  gl_NEXT_HEADERS([stdlib.h])
 
   dnl Check for declarations of anything we want to poison if the
   dnl corresponding gnulib module is not in use, and which is not
 
   dnl Check for declarations of anything we want to poison if the
   dnl corresponding gnulib module is not in use, and which is not
@@ -89,6 +75,7 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS],
   HAVE_MKSTEMP=1;            AC_SUBST([HAVE_MKSTEMP])
   HAVE_MKSTEMPS=1;           AC_SUBST([HAVE_MKSTEMPS])
   HAVE_PTSNAME=1;            AC_SUBST([HAVE_PTSNAME])
   HAVE_MKSTEMP=1;            AC_SUBST([HAVE_MKSTEMP])
   HAVE_MKSTEMPS=1;           AC_SUBST([HAVE_MKSTEMPS])
   HAVE_PTSNAME=1;            AC_SUBST([HAVE_PTSNAME])
+  HAVE_RANDOM_H=1;           AC_SUBST([HAVE_RANDOM_H])
   HAVE_RANDOM_R=1;           AC_SUBST([HAVE_RANDOM_R])
   HAVE_REALPATH=1;           AC_SUBST([HAVE_REALPATH])
   HAVE_RPMATCH=1;            AC_SUBST([HAVE_RPMATCH])
   HAVE_RANDOM_R=1;           AC_SUBST([HAVE_RANDOM_R])
   HAVE_REALPATH=1;           AC_SUBST([HAVE_REALPATH])
   HAVE_RPMATCH=1;            AC_SUBST([HAVE_RPMATCH])
index 33de423..1c553ff 100644 (file)
@@ -1,5 +1,5 @@
 # strcase.m4 serial 10
 # strcase.m4 serial 10
-dnl Copyright (C) 2002, 2005-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2002, 2005-2011 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 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.
index 3562240..d9de341 100644 (file)
@@ -1,6 +1,6 @@
 # serial 32
 
 # serial 32
 
-# Copyright (C) 1996-1997, 1999-2007, 2009-2010 Free Software Foundation, Inc.
+# Copyright (C) 1996-1997, 1999-2007, 2009-2011 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -21,11 +21,9 @@ AC_DEFUN([gl_FUNC_STRFTIME],
  # This defines (or not) HAVE_TZNAME and HAVE_TM_ZONE.
  AC_REQUIRE([AC_STRUCT_TIMEZONE])
 
  # This defines (or not) HAVE_TZNAME and HAVE_TM_ZONE.
  AC_REQUIRE([AC_STRUCT_TIMEZONE])
 
- AC_REQUIRE([AC_TYPE_MBSTATE_T])
  AC_REQUIRE([gl_TM_GMTOFF])
 
  AC_CHECK_FUNCS_ONCE([tzset])
  AC_REQUIRE([gl_TM_GMTOFF])
 
  AC_CHECK_FUNCS_ONCE([tzset])
- AC_CHECK_HEADERS_ONCE([wchar.h])
 
  AC_DEFINE([my_strftime], [nstrftime],
    [Define to the name of the strftime replacement function.])
 
  AC_DEFINE([my_strftime], [nstrftime],
    [Define to the name of the strftime replacement function.])
index 5844b2d..30ddfbc 100644 (file)
@@ -1,11 +1,11 @@
 # Configure a GNU-like replacement for <string.h>.
 
 # Configure a GNU-like replacement for <string.h>.
 
-# Copyright (C) 2007-2010 Free Software Foundation, Inc.
+# Copyright (C) 2007-2011 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.
 
 # 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.
 
-# serial 18
+# serial 19
 
 # Written by Paul Eggert.
 
 
 # Written by Paul Eggert.
 
@@ -20,7 +20,7 @@ AC_DEFUN([gl_HEADER_STRING_H_BODY],
 [
   AC_REQUIRE([AC_C_RESTRICT])
   AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
 [
   AC_REQUIRE([AC_C_RESTRICT])
   AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
-  gl_CHECK_NEXT_HEADERS([string.h])
+  gl_NEXT_HEADERS([string.h])
 
   dnl Check for declarations of anything we want to poison if the
   dnl corresponding gnulib module is not in use, and which is not
 
   dnl Check for declarations of anything we want to poison if the
   dnl corresponding gnulib module is not in use, and which is not
index 4374c7c..71d284b 100644 (file)
@@ -1,7 +1,7 @@
 # Configure a replacement for <string.h>.
 # serial 3
 
 # Configure a replacement for <string.h>.
 # serial 3
 
-# Copyright (C) 2007, 2009-2010 Free Software Foundation, Inc.
+# Copyright (C) 2007, 2009-2011 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.
 # 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.
index d33e15a..8538e1f 100644 (file)
@@ -1,7 +1,7 @@
 # Configure a replacement for <sys/file.h>.
 # Configure a replacement for <sys/file.h>.
-# serial 5
+# serial 6
 
 
-# Copyright (C) 2008-2010 Free Software Foundation, Inc.
+# Copyright (C) 2008-2011 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.
 # 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.
@@ -15,7 +15,6 @@ AC_DEFUN([gl_HEADER_SYS_FILE_H],
   dnl <sys/file.h> is always overridden, because of GNULIB_POSIXCHECK.
   gl_CHECK_NEXT_HEADERS([sys/file.h])
 
   dnl <sys/file.h> is always overridden, because of GNULIB_POSIXCHECK.
   gl_CHECK_NEXT_HEADERS([sys/file.h])
 
-  AC_CHECK_HEADERS_ONCE([sys/file.h])
   if test $ac_cv_header_sys_file_h = yes; then
     HAVE_SYS_FILE_H=1
   else
   if test $ac_cv_header_sys_file_h = yes; then
     HAVE_SYS_FILE_H=1
   else
index b743371..12dc05d 100644 (file)
@@ -1,5 +1,5 @@
 # sys_socket_h.m4 serial 21
 # sys_socket_h.m4 serial 21
-dnl Copyright (C) 2005-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2005-2011 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 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.
index 7181c25..fc41912 100644 (file)
@@ -1,5 +1,5 @@
 # sys_stat_h.m4 serial 24   -*- Autoconf -*-
 # sys_stat_h.m4 serial 24   -*- Autoconf -*-
-dnl Copyright (C) 2006-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2006-2011 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 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.
diff --git a/m4/sys_time_h.m4 b/m4/sys_time_h.m4
new file mode 100644 (file)
index 0000000..3a3adc8
--- /dev/null
@@ -0,0 +1,72 @@
+# Configure a replacement for <sys/time.h>.
+# serial 6
+
+# Copyright (C) 2007, 2009-2011 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.
+
+# Written by Paul Eggert and Martin Lambers.
+
+AC_DEFUN([gl_HEADER_SYS_TIME_H],
+[
+  dnl Use AC_REQUIRE here, so that the REPLACE_GETTIMEOFDAY=0 statement
+  dnl below is expanded once only, before all REPLACE_GETTIMEOFDAY=1
+  dnl statements that occur in other macros.
+  AC_REQUIRE([gl_HEADER_SYS_TIME_H_BODY])
+])
+
+AC_DEFUN([gl_HEADER_SYS_TIME_H_BODY],
+[
+  AC_REQUIRE([AC_C_RESTRICT])
+  AC_REQUIRE([gl_HEADER_SYS_TIME_H_DEFAULTS])
+  AC_CHECK_HEADERS_ONCE([sys/time.h])
+  gl_CHECK_NEXT_HEADERS([sys/time.h])
+
+  if test $ac_cv_header_sys_time_h != yes; then
+    HAVE_SYS_TIME_H=0
+  fi
+
+  AC_CACHE_CHECK([for struct timeval], [gl_cv_sys_struct_timeval],
+    [AC_COMPILE_IFELSE(
+       [AC_LANG_PROGRAM(
+          [[#if HAVE_SYS_TIME_H
+             #include <sys/time.h>
+            #endif
+            #include <time.h>
+          ]],
+          [[static struct timeval x; x.tv_sec = x.tv_usec;]])],
+       [gl_cv_sys_struct_timeval=yes],
+       [gl_cv_sys_struct_timeval=no])])
+  if test $gl_cv_sys_struct_timeval != yes; then
+    HAVE_STRUCT_TIMEVAL=0
+  fi
+
+  dnl Check for declarations of anything we want to poison if the
+  dnl corresponding gnulib module is not in use.
+  gl_WARN_ON_USE_PREPARE([[
+#if HAVE_SYS_TIME_H
+# include <sys/time.h>
+#endif
+#include <time.h>
+    ]], [gettimeofday])
+])
+
+AC_DEFUN([gl_SYS_TIME_MODULE_INDICATOR],
+[
+  dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
+  AC_REQUIRE([gl_HEADER_SYS_TIME_H_DEFAULTS])
+  gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+  dnl Define it also as a C macro, for the benefit of the unit tests.
+  gl_MODULE_INDICATOR_FOR_TESTS([$1])
+])
+
+AC_DEFUN([gl_HEADER_SYS_TIME_H_DEFAULTS],
+[
+  GNULIB_GETTIMEOFDAY=0;     AC_SUBST([GNULIB_GETTIMEOFDAY])
+  dnl Assume POSIX behavior unless another module says otherwise.
+  HAVE_GETTIMEOFDAY=1;       AC_SUBST([HAVE_GETTIMEOFDAY])
+  HAVE_STRUCT_TIMEVAL=1;     AC_SUBST([HAVE_STRUCT_TIMEVAL])
+  HAVE_SYS_TIME_H=1;         AC_SUBST([HAVE_SYS_TIME_H])
+  REPLACE_GETTIMEOFDAY=0;    AC_SUBST([REPLACE_GETTIMEOFDAY])
+])
index a45a10a..615da1c 100644 (file)
@@ -1,8 +1,8 @@
 # Configure a more-standard replacement for <time.h>.
 
 # Configure a more-standard replacement for <time.h>.
 
-# Copyright (C) 2000-2001, 2003-2007, 2009-2010 Free Software Foundation, Inc.
+# Copyright (C) 2000-2001, 2003-2007, 2009-2011 Free Software Foundation, Inc.
 
 
-# serial 2
+# serial 4
 
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -21,7 +21,7 @@ AC_DEFUN([gl_HEADER_TIME_H_BODY],
 [
   AC_REQUIRE([AC_C_RESTRICT])
   AC_REQUIRE([gl_HEADER_TIME_H_DEFAULTS])
 [
   AC_REQUIRE([AC_C_RESTRICT])
   AC_REQUIRE([gl_HEADER_TIME_H_DEFAULTS])
-  gl_CHECK_NEXT_HEADERS([time.h])
+  gl_NEXT_HEADERS([time.h])
   AC_REQUIRE([gl_CHECK_TYPE_STRUCT_TIMESPEC])
 ])
 
   AC_REQUIRE([gl_CHECK_TYPE_STRUCT_TIMESPEC])
 ])
 
@@ -95,7 +95,7 @@ AC_DEFUN([gl_HEADER_TIME_H_DEFAULTS],
   GNULIB_TIMEGM=0;                       AC_SUBST([GNULIB_TIMEGM])
   GNULIB_TIME_R=0;                       AC_SUBST([GNULIB_TIME_R])
   dnl Assume proper GNU behavior unless another module says otherwise.
   GNULIB_TIMEGM=0;                       AC_SUBST([GNULIB_TIMEGM])
   GNULIB_TIME_R=0;                       AC_SUBST([GNULIB_TIME_R])
   dnl Assume proper GNU behavior unless another module says otherwise.
-  HAVE_LOCALTIME_R=1;                    AC_SUBST([HAVE_LOCALTIME_R])
+  HAVE_DECL_LOCALTIME_R=1;               AC_SUBST([HAVE_DECL_LOCALTIME_R])
   HAVE_NANOSLEEP=1;                      AC_SUBST([HAVE_NANOSLEEP])
   HAVE_STRPTIME=1;                       AC_SUBST([HAVE_STRPTIME])
   HAVE_TIMEGM=1;                         AC_SUBST([HAVE_TIMEGM])
   HAVE_NANOSLEEP=1;                      AC_SUBST([HAVE_NANOSLEEP])
   HAVE_STRPTIME=1;                       AC_SUBST([HAVE_STRPTIME])
   HAVE_TIMEGM=1;                         AC_SUBST([HAVE_TIMEGM])
index 9e82d39..9bb2800 100644 (file)
@@ -1,6 +1,6 @@
 dnl Reentrant time functions: localtime_r, gmtime_r.
 
 dnl Reentrant time functions: localtime_r, gmtime_r.
 
-dnl Copyright (C) 2003, 2006-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2003, 2006-2011 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 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,8 +15,16 @@ AC_DEFUN([gl_TIME_R],
   AC_REQUIRE([gl_HEADER_TIME_H_DEFAULTS])
   AC_REQUIRE([AC_C_RESTRICT])
 
   AC_REQUIRE([gl_HEADER_TIME_H_DEFAULTS])
   AC_REQUIRE([AC_C_RESTRICT])
 
+  dnl Some systems don't declare localtime_r() and gmtime_r() if _REENTRANT is
+  dnl not defined.
+  AC_CHECK_DECLS_ONCE([localtime_r])
+  if test $ac_cv_have_decl_localtime_r = no; then
+    HAVE_DECL_LOCALTIME_R=0
+  fi
+
   AC_CHECK_FUNCS_ONCE([localtime_r])
   if test $ac_cv_func_localtime_r = yes; then
   AC_CHECK_FUNCS_ONCE([localtime_r])
   if test $ac_cv_func_localtime_r = yes; then
+    HAVE_LOCALTIME_R=1
     AC_CACHE_CHECK([whether localtime_r is compatible with its POSIX signature],
       [gl_cv_time_r_posix],
       [AC_COMPILE_IFELSE(
     AC_CACHE_CHECK([whether localtime_r is compatible with its POSIX signature],
       [gl_cv_time_r_posix],
       [AC_COMPILE_IFELSE(
index 43bda96..d65ddc0 100644 (file)
@@ -1,5 +1,5 @@
 # tm_gmtoff.m4 serial 3
 # tm_gmtoff.m4 serial 3
-dnl Copyright (C) 2002, 2009-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2002, 2009-2011 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 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.
diff --git a/m4/trunc.m4 b/m4/trunc.m4
new file mode 100644 (file)
index 0000000..e106911
--- /dev/null
@@ -0,0 +1,86 @@
+# trunc.m4 serial 5
+dnl Copyright (C) 2007, 2010-2011 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_TRUNC],
+[
+  m4_divert_text([DEFAULTS], [gl_trunc_required=plain])
+  AC_REQUIRE([gl_MATH_H_DEFAULTS])
+  dnl Persuade glibc <math.h> to declare trunc().
+  AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+  dnl Test whether trunc() is declared.
+  AC_CHECK_DECLS([trunc], , , [#include <math.h>])
+  if test "$ac_cv_have_decl_trunc" = yes; then
+    dnl Test whether trunc() can be used without libm.
+    TRUNC_LIBM=?
+    AC_LINK_IFELSE(
+      [AC_LANG_PROGRAM(
+         [[#ifndef __NO_MATH_INLINES
+           # define __NO_MATH_INLINES 1 /* for glibc */
+           #endif
+           #include <math.h>
+           double x;]],
+         [[x = trunc(x);]])],
+      [TRUNC_LIBM=])
+    if test "$TRUNC_LIBM" = "?"; then
+      save_LIBS="$LIBS"
+      LIBS="$LIBS -lm"
+      AC_LINK_IFELSE(
+        [AC_LANG_PROGRAM(
+           [[#ifndef __NO_MATH_INLINES
+             # define __NO_MATH_INLINES 1 /* for glibc */
+             #endif
+             #include <math.h>
+             double x;]],
+           [[x = trunc(x);]])],
+        [TRUNC_LIBM="-lm"])
+      LIBS="$save_LIBS"
+    fi
+    if test "$TRUNC_LIBM" = "?"; then
+      TRUNC_LIBM=
+    fi
+    m4_ifdef([gl_FUNC_TRUNC_IEEE], [
+      if test $gl_trunc_required = ieee && test $REPLACE_TRUNC = 0; then
+        AC_CACHE_CHECK([whether trunc works according to ISO C 99 with IEC 60559],
+          [gl_cv_func_trunc_ieee],
+          [
+            save_LIBS="$LIBS"
+            LIBS="$LIBS $TRUNC_LIBM"
+            AC_RUN_IFELSE(
+              [AC_LANG_SOURCE([[
+#ifndef __NO_MATH_INLINES
+# define __NO_MATH_INLINES 1 /* for glibc */
+#endif
+#include <math.h>
+]gl_DOUBLE_MINUS_ZERO_CODE[
+]gl_DOUBLE_SIGNBIT_CODE[
+int main()
+{
+  /* Test whether trunc (-0.0) is -0.0.  */
+  if (signbitd (minus_zerod) && !signbitd (trunc (minus_zerod)))
+    return 1;
+  return 0;
+}
+              ]])],
+              [gl_cv_func_trunc_ieee=yes],
+              [gl_cv_func_trunc_ieee=no],
+              [gl_cv_func_trunc_ieee="guessing no"])
+            LIBS="$save_LIBS"
+          ])
+        case "$gl_cv_func_trunc_ieee" in
+          *yes) ;;
+          *) REPLACE_TRUNC=1 ;;
+        esac
+      fi
+    ])
+  else
+    HAVE_DECL_TRUNC=0
+  fi
+  if test $HAVE_DECL_TRUNC = 0 || test $REPLACE_TRUNC = 1; then
+    AC_LIBOBJ([trunc])
+    TRUNC_LIBM=
+  fi
+  AC_SUBST([TRUNC_LIBM])
+])
index 27d96ff..c81a113 100644 (file)
@@ -1,5 +1,5 @@
-# unistd_h.m4 serial 51
-dnl Copyright (C) 2006-2010 Free Software Foundation, Inc.
+# unistd_h.m4 serial 53
+dnl Copyright (C) 2006-2011 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 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,6 @@ AC_DEFUN([gl_UNISTD_H],
   AC_REQUIRE([AC_C_INLINE])
 
   gl_CHECK_NEXT_HEADERS([unistd.h])
   AC_REQUIRE([AC_C_INLINE])
 
   gl_CHECK_NEXT_HEADERS([unistd.h])
-
-  AC_CHECK_HEADERS_ONCE([unistd.h])
   if test $ac_cv_header_unistd_h = yes; then
     HAVE_UNISTD_H=1
   else
   if test $ac_cv_header_unistd_h = yes; then
     HAVE_UNISTD_H=1
   else
@@ -140,6 +138,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
   REPLACE_FCHOWNAT=0;     AC_SUBST([REPLACE_FCHOWNAT])
   REPLACE_GETCWD=0;       AC_SUBST([REPLACE_GETCWD])
   REPLACE_GETDOMAINNAME=0; AC_SUBST([REPLACE_GETDOMAINNAME])
   REPLACE_FCHOWNAT=0;     AC_SUBST([REPLACE_FCHOWNAT])
   REPLACE_GETCWD=0;       AC_SUBST([REPLACE_GETCWD])
   REPLACE_GETDOMAINNAME=0; AC_SUBST([REPLACE_GETDOMAINNAME])
+  REPLACE_GETLOGIN_R=0;   AC_SUBST([REPLACE_GETLOGIN_R])
   REPLACE_GETGROUPS=0;    AC_SUBST([REPLACE_GETGROUPS])
   REPLACE_GETPAGESIZE=0;  AC_SUBST([REPLACE_GETPAGESIZE])
   REPLACE_LCHOWN=0;       AC_SUBST([REPLACE_LCHOWN])
   REPLACE_GETGROUPS=0;    AC_SUBST([REPLACE_GETGROUPS])
   REPLACE_GETPAGESIZE=0;  AC_SUBST([REPLACE_GETPAGESIZE])
   REPLACE_LCHOWN=0;       AC_SUBST([REPLACE_LCHOWN])
index 9c04520..32ea985 100644 (file)
@@ -1,5 +1,5 @@
 # vasnprintf.m4 serial 32
 # vasnprintf.m4 serial 32
-dnl Copyright (C) 2002-2004, 2006-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2004, 2006-2011 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 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.
index 2c572b4..5032bf8 100644 (file)
@@ -1,5 +1,5 @@
 # version-etc.m4 serial 1
 # version-etc.m4 serial 1
-# Copyright (C) 2009-2010 Free Software Foundation, Inc.
+# Copyright (C) 2009-2011 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.
 # 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.
index 19cd8f3..75c34b6 100644 (file)
@@ -1,5 +1,5 @@
 # visibility.m4 serial 4 (gettext-0.18.2)
 # visibility.m4 serial 4 (gettext-0.18.2)
-dnl Copyright (C) 2005, 2008, 2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2005, 2008, 2010-2011 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 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.
index ed189c2..e4725e4 100644 (file)
@@ -1,5 +1,5 @@
 # vsnprintf.m4 serial 5
 # vsnprintf.m4 serial 5
-dnl Copyright (C) 2002-2004, 2007-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2004, 2007-2011 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 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,12 @@ AC_DEFUN([gl_FUNC_VSNPRINTF],
     gl_SNPRINTF_SIZE1
     case "$gl_cv_func_snprintf_size1" in
       *yes)
     gl_SNPRINTF_SIZE1
     case "$gl_cv_func_snprintf_size1" in
       *yes)
-        gl_cv_func_vsnprintf_usable=yes
+        gl_SNPRINTF_RETVAL_C99
+        case "$gl_cv_func_snprintf_retval_c99" in
+          *yes)
+            gl_cv_func_vsnprintf_usable=yes
+            ;;
+        esac
         ;;
     esac
   fi
         ;;
     esac
   fi
index 42daae8..e0d0f27 100644 (file)
@@ -1,5 +1,5 @@
 # warn-on-use.m4 serial 2
 # warn-on-use.m4 serial 2
-dnl Copyright (C) 2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2010-2011 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 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.
index dad5c1f..a8f3466 100644 (file)
@@ -1,5 +1,5 @@
 # warnings.m4 serial 2
 # warnings.m4 serial 2
-dnl Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2008-2011 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 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.
index 8c8fad9..6255ff3 100644 (file)
@@ -1,13 +1,13 @@
 dnl A placeholder for ISO C99 <wchar.h>, for platforms that have issues.
 
 dnl A placeholder for ISO C99 <wchar.h>, for platforms that have issues.
 
-dnl Copyright (C) 2007-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2007-2011 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 Eric Blake.
 
 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 Eric Blake.
 
-# wchar_h.m4 serial 35
+# wchar_h.m4 serial 38
 
 AC_DEFUN([gl_WCHAR_H],
 [
 
 AC_DEFUN([gl_WCHAR_H],
 [
@@ -17,7 +17,6 @@ AC_DEFUN([gl_WCHAR_H],
   dnl Check for <wchar.h> (missing in Linux uClibc when built without wide
   dnl character support).
   dnl <wchar.h> is always overridden, because of GNULIB_POSIXCHECK.
   dnl Check for <wchar.h> (missing in Linux uClibc when built without wide
   dnl character support).
   dnl <wchar.h> is always overridden, because of GNULIB_POSIXCHECK.
-  AC_CHECK_HEADERS_ONCE([wchar.h])
   gl_CHECK_NEXT_HEADERS([wchar.h])
   if test $ac_cv_header_wchar_h = yes; then
     HAVE_WCHAR_H=1
   gl_CHECK_NEXT_HEADERS([wchar.h])
   if test $ac_cv_header_wchar_h = yes; then
     HAVE_WCHAR_H=1
@@ -39,15 +38,23 @@ AC_DEFUN([gl_WCHAR_H],
   dnl Check for declarations of anything we want to poison if the
   dnl corresponding gnulib module is not in use.
   gl_WARN_ON_USE_PREPARE([[
   dnl Check for declarations of anything we want to poison if the
   dnl corresponding gnulib module is not in use.
   gl_WARN_ON_USE_PREPARE([[
-/* Some systems require additional headers.  */
+/* 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
+   included before <wchar.h>.  */
 #if !(defined __GLIBC__ && !defined __UCLIBC__)
 # include <stddef.h>
 # include <stdio.h>
 # include <time.h>
 #endif
 #include <wchar.h>
 #if !(defined __GLIBC__ && !defined __UCLIBC__)
 # include <stddef.h>
 # include <stdio.h>
 # include <time.h>
 #endif
 #include <wchar.h>
-    ]], [btowc wctob mbsinit mbrtowc mbrlen mbsrtowcs mbsnrtowcs wcrtomb
-    wcsrtombs wcsnrtombs wcwidth])
+    ]],
+    [btowc wctob mbsinit mbrtowc mbrlen mbsrtowcs mbsnrtowcs wcrtomb
+     wcsrtombs wcsnrtombs wcwidth wmemchr wmemcmp wmemcpy wmemmove wmemset
+     wcslen wcsnlen wcscpy wcpcpy wcsncpy wcpncpy wcscat wcsncat wcscmp
+     wcsncmp wcscasecmp wcsncasecmp wcscoll wcsxfrm wcsdup wcschr wcsrchr
+     wcscspn wcsspn wcspbrk wcsstr wcstok wcswidth
+    ])
 ])
 
 dnl Check whether <wchar.h> is usable at all.
 ])
 
 dnl Check whether <wchar.h> is usable at all.
@@ -63,6 +70,13 @@ AC_DEFUN([gl_WCHAR_H_INLINE_OK],
     [gl_cv_header_wchar_h_correct_inline=yes
      AC_LANG_CONFTEST([
        AC_LANG_SOURCE([[#define wcstod renamed_wcstod
     [gl_cv_header_wchar_h_correct_inline=yes
      AC_LANG_CONFTEST([
        AC_LANG_SOURCE([[#define wcstod renamed_wcstod
+/* 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
+   included before <wchar.h>.  */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.h>
 #include <wchar.h>
 extern int zero (void);
 int main () { return zero(); }
 #include <wchar.h>
 extern int zero (void);
 int main () { return zero(); }
@@ -71,6 +85,13 @@ int main () { return zero(); }
        mv conftest.$ac_objext conftest1.$ac_objext
        AC_LANG_CONFTEST([
          AC_LANG_SOURCE([[#define wcstod renamed_wcstod
        mv conftest.$ac_objext conftest1.$ac_objext
        AC_LANG_CONFTEST([
          AC_LANG_SOURCE([[#define wcstod renamed_wcstod
+/* 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
+   included before <wchar.h>.  */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.h>
 #include <wchar.h>
 int zero (void) { return 0; }
 ]])])
 #include <wchar.h>
 int zero (void) { return 0; }
 ]])])
@@ -116,17 +137,45 @@ AC_DEFUN([gl_WCHAR_MODULE_INDICATOR],
 
 AC_DEFUN([gl_WCHAR_H_DEFAULTS],
 [
 
 AC_DEFUN([gl_WCHAR_H_DEFAULTS],
 [
-  GNULIB_BTOWC=0;      AC_SUBST([GNULIB_BTOWC])
-  GNULIB_WCTOB=0;      AC_SUBST([GNULIB_WCTOB])
-  GNULIB_MBSINIT=0;    AC_SUBST([GNULIB_MBSINIT])
-  GNULIB_MBRTOWC=0;    AC_SUBST([GNULIB_MBRTOWC])
-  GNULIB_MBRLEN=0;     AC_SUBST([GNULIB_MBRLEN])
-  GNULIB_MBSRTOWCS=0;  AC_SUBST([GNULIB_MBSRTOWCS])
-  GNULIB_MBSNRTOWCS=0; AC_SUBST([GNULIB_MBSNRTOWCS])
-  GNULIB_WCRTOMB=0;    AC_SUBST([GNULIB_WCRTOMB])
-  GNULIB_WCSRTOMBS=0;  AC_SUBST([GNULIB_WCSRTOMBS])
-  GNULIB_WCSNRTOMBS=0; AC_SUBST([GNULIB_WCSNRTOMBS])
-  GNULIB_WCWIDTH=0;    AC_SUBST([GNULIB_WCWIDTH])
+  GNULIB_BTOWC=0;       AC_SUBST([GNULIB_BTOWC])
+  GNULIB_WCTOB=0;       AC_SUBST([GNULIB_WCTOB])
+  GNULIB_MBSINIT=0;     AC_SUBST([GNULIB_MBSINIT])
+  GNULIB_MBRTOWC=0;     AC_SUBST([GNULIB_MBRTOWC])
+  GNULIB_MBRLEN=0;      AC_SUBST([GNULIB_MBRLEN])
+  GNULIB_MBSRTOWCS=0;   AC_SUBST([GNULIB_MBSRTOWCS])
+  GNULIB_MBSNRTOWCS=0;  AC_SUBST([GNULIB_MBSNRTOWCS])
+  GNULIB_WCRTOMB=0;     AC_SUBST([GNULIB_WCRTOMB])
+  GNULIB_WCSRTOMBS=0;   AC_SUBST([GNULIB_WCSRTOMBS])
+  GNULIB_WCSNRTOMBS=0;  AC_SUBST([GNULIB_WCSNRTOMBS])
+  GNULIB_WCWIDTH=0;     AC_SUBST([GNULIB_WCWIDTH])
+  GNULIB_WMEMCHR=0;     AC_SUBST([GNULIB_WMEMCHR])
+  GNULIB_WMEMCMP=0;     AC_SUBST([GNULIB_WMEMCMP])
+  GNULIB_WMEMCPY=0;     AC_SUBST([GNULIB_WMEMCPY])
+  GNULIB_WMEMMOVE=0;    AC_SUBST([GNULIB_WMEMMOVE])
+  GNULIB_WMEMSET=0;     AC_SUBST([GNULIB_WMEMSET])
+  GNULIB_WCSLEN=0;      AC_SUBST([GNULIB_WCSLEN])
+  GNULIB_WCSNLEN=0;     AC_SUBST([GNULIB_WCSNLEN])
+  GNULIB_WCSCPY=0;      AC_SUBST([GNULIB_WCSCPY])
+  GNULIB_WCPCPY=0;      AC_SUBST([GNULIB_WCPCPY])
+  GNULIB_WCSNCPY=0;     AC_SUBST([GNULIB_WCSNCPY])
+  GNULIB_WCPNCPY=0;     AC_SUBST([GNULIB_WCPNCPY])
+  GNULIB_WCSCAT=0;      AC_SUBST([GNULIB_WCSCAT])
+  GNULIB_WCSNCAT=0;     AC_SUBST([GNULIB_WCSNCAT])
+  GNULIB_WCSCMP=0;      AC_SUBST([GNULIB_WCSCMP])
+  GNULIB_WCSNCMP=0;     AC_SUBST([GNULIB_WCSNCMP])
+  GNULIB_WCSCASECMP=0;  AC_SUBST([GNULIB_WCSCASECMP])
+  GNULIB_WCSNCASECMP=0; AC_SUBST([GNULIB_WCSNCASECMP])
+  GNULIB_WCSCOLL=0;     AC_SUBST([GNULIB_WCSCOLL])
+  GNULIB_WCSXFRM=0;     AC_SUBST([GNULIB_WCSXFRM])
+  GNULIB_WCSDUP=0;      AC_SUBST([GNULIB_WCSDUP])
+  GNULIB_WCSCHR=0;      AC_SUBST([GNULIB_WCSCHR])
+  GNULIB_WCSRCHR=0;     AC_SUBST([GNULIB_WCSRCHR])
+  GNULIB_WCSCSPN=0;     AC_SUBST([GNULIB_WCSCSPN])
+  GNULIB_WCSSPN=0;      AC_SUBST([GNULIB_WCSSPN])
+  GNULIB_WCSPBRK=0;     AC_SUBST([GNULIB_WCSPBRK])
+  GNULIB_WCSSTR=0;      AC_SUBST([GNULIB_WCSSTR])
+  GNULIB_WCSTOK=0;      AC_SUBST([GNULIB_WCSTOK])
+  GNULIB_WCSWIDTH=0;    AC_SUBST([GNULIB_WCSWIDTH])
   dnl Assume proper GNU behavior unless another module says otherwise.
   HAVE_BTOWC=1;         AC_SUBST([HAVE_BTOWC])
   HAVE_MBSINIT=1;       AC_SUBST([HAVE_MBSINIT])
   dnl Assume proper GNU behavior unless another module says otherwise.
   HAVE_BTOWC=1;         AC_SUBST([HAVE_BTOWC])
   HAVE_MBSINIT=1;       AC_SUBST([HAVE_MBSINIT])
@@ -137,6 +186,34 @@ AC_DEFUN([gl_WCHAR_H_DEFAULTS],
   HAVE_WCRTOMB=1;       AC_SUBST([HAVE_WCRTOMB])
   HAVE_WCSRTOMBS=1;     AC_SUBST([HAVE_WCSRTOMBS])
   HAVE_WCSNRTOMBS=1;    AC_SUBST([HAVE_WCSNRTOMBS])
   HAVE_WCRTOMB=1;       AC_SUBST([HAVE_WCRTOMB])
   HAVE_WCSRTOMBS=1;     AC_SUBST([HAVE_WCSRTOMBS])
   HAVE_WCSNRTOMBS=1;    AC_SUBST([HAVE_WCSNRTOMBS])
+  HAVE_WMEMCHR=1;       AC_SUBST([HAVE_WMEMCHR])
+  HAVE_WMEMCMP=1;       AC_SUBST([HAVE_WMEMCMP])
+  HAVE_WMEMCPY=1;       AC_SUBST([HAVE_WMEMCPY])
+  HAVE_WMEMMOVE=1;      AC_SUBST([HAVE_WMEMMOVE])
+  HAVE_WMEMSET=1;       AC_SUBST([HAVE_WMEMSET])
+  HAVE_WCSLEN=1;        AC_SUBST([HAVE_WCSLEN])
+  HAVE_WCSNLEN=1;       AC_SUBST([HAVE_WCSNLEN])
+  HAVE_WCSCPY=1;        AC_SUBST([HAVE_WCSCPY])
+  HAVE_WCPCPY=1;        AC_SUBST([HAVE_WCPCPY])
+  HAVE_WCSNCPY=1;       AC_SUBST([HAVE_WCSNCPY])
+  HAVE_WCPNCPY=1;       AC_SUBST([HAVE_WCPNCPY])
+  HAVE_WCSCAT=1;        AC_SUBST([HAVE_WCSCAT])
+  HAVE_WCSNCAT=1;       AC_SUBST([HAVE_WCSNCAT])
+  HAVE_WCSCMP=1;        AC_SUBST([HAVE_WCSCMP])
+  HAVE_WCSNCMP=1;       AC_SUBST([HAVE_WCSNCMP])
+  HAVE_WCSCASECMP=1;    AC_SUBST([HAVE_WCSCASECMP])
+  HAVE_WCSNCASECMP=1;   AC_SUBST([HAVE_WCSNCASECMP])
+  HAVE_WCSCOLL=1;       AC_SUBST([HAVE_WCSCOLL])
+  HAVE_WCSXFRM=1;       AC_SUBST([HAVE_WCSXFRM])
+  HAVE_WCSDUP=1;        AC_SUBST([HAVE_WCSDUP])
+  HAVE_WCSCHR=1;        AC_SUBST([HAVE_WCSCHR])
+  HAVE_WCSRCHR=1;       AC_SUBST([HAVE_WCSRCHR])
+  HAVE_WCSCSPN=1;       AC_SUBST([HAVE_WCSCSPN])
+  HAVE_WCSSPN=1;        AC_SUBST([HAVE_WCSSPN])
+  HAVE_WCSPBRK=1;       AC_SUBST([HAVE_WCSPBRK])
+  HAVE_WCSSTR=1;        AC_SUBST([HAVE_WCSSTR])
+  HAVE_WCSTOK=1;        AC_SUBST([HAVE_WCSTOK])
+  HAVE_WCSWIDTH=1;      AC_SUBST([HAVE_WCSWIDTH])
   HAVE_DECL_WCTOB=1;    AC_SUBST([HAVE_DECL_WCTOB])
   HAVE_DECL_WCWIDTH=1;  AC_SUBST([HAVE_DECL_WCWIDTH])
   REPLACE_MBSTATE_T=0;  AC_SUBST([REPLACE_MBSTATE_T])
   HAVE_DECL_WCTOB=1;    AC_SUBST([HAVE_DECL_WCTOB])
   HAVE_DECL_WCWIDTH=1;  AC_SUBST([HAVE_DECL_WCWIDTH])
   REPLACE_MBSTATE_T=0;  AC_SUBST([REPLACE_MBSTATE_T])
@@ -151,4 +228,5 @@ AC_DEFUN([gl_WCHAR_H_DEFAULTS],
   REPLACE_WCSRTOMBS=0;  AC_SUBST([REPLACE_WCSRTOMBS])
   REPLACE_WCSNRTOMBS=0; AC_SUBST([REPLACE_WCSNRTOMBS])
   REPLACE_WCWIDTH=0;    AC_SUBST([REPLACE_WCWIDTH])
   REPLACE_WCSRTOMBS=0;  AC_SUBST([REPLACE_WCSRTOMBS])
   REPLACE_WCSNRTOMBS=0; AC_SUBST([REPLACE_WCSNRTOMBS])
   REPLACE_WCWIDTH=0;    AC_SUBST([REPLACE_WCWIDTH])
+  REPLACE_WCSWIDTH=0;   AC_SUBST([REPLACE_WCSWIDTH])
 ])
 ])
index a133e6a..d2c03c4 100644 (file)
@@ -1,5 +1,5 @@
 # wchar_t.m4 serial 4 (gettext-0.18.2)
 # wchar_t.m4 serial 4 (gettext-0.18.2)
-dnl Copyright (C) 2002-2003, 2008-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2003, 2008-2011 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 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.
index 58ef865..da1ce3d 100644 (file)
@@ -1,5 +1,5 @@
 # wint_t.m4 serial 5 (gettext-0.18.2)
 # wint_t.m4 serial 5 (gettext-0.18.2)
-dnl Copyright (C) 2003, 2007-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2003, 2007-2011 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 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.
index 56325ab..8695c89 100644 (file)
@@ -1,5 +1,5 @@
 # write.m4 serial 1
 # write.m4 serial 1
-dnl Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2008-2011 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 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.
index b653693..8c693bc 100644 (file)
@@ -1,5 +1,5 @@
 # xsize.m4 serial 4
 # xsize.m4 serial 4
-dnl Copyright (C) 2003-2004, 2008-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2003-2004, 2008-2011 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 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.
index 315b223..606d42e 100644 (file)
--- a/maint.mk
+++ b/maint.mk
@@ -2,7 +2,7 @@
 # This Makefile fragment tries to be general-purpose enough to be
 # used by many projects via the gnulib maintainer-makefile module.
 
 # This Makefile fragment tries to be general-purpose enough to be
 # used by many projects via the gnulib maintainer-makefile module.
 
-## Copyright (C) 2001-2010 Free Software Foundation, Inc.
+## Copyright (C) 2001-2011 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
 ##
 ## 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
@@ -292,10 +292,10 @@ sc_prohibit_atoi_atof:
 
 # Use STREQ rather than comparing strcmp == 0, or != 0.
 sc_prohibit_strcmp:
 
 # Use STREQ rather than comparing strcmp == 0, or != 0.
 sc_prohibit_strcmp:
-       @grep -nE '! *str''cmp *\(|\<str''cmp *\([^)]+\) *=='           \
+       @grep -nE '! *str''cmp *\(|\<str''cmp *\(.+\) *[!=]='   \
            $$($(VC_LIST_EXCEPT))                                       \
            $$($(VC_LIST_EXCEPT))                                       \
-         | grep -vE ':# *define STREQ\(' &&                            \
-         { echo '$(ME): use STREQ in place of the above uses of str''cmp' \
+         | grep -vE ':# *define STRN?EQ\(' &&                          \
+         { echo '$(ME): replace str''cmp calls above with STREQ/STRNEQ' \
                1>&2; exit 1; } || :
 
 # Pass EXIT_*, not number, to usage, exit, and error (when exiting)
                1>&2; exit 1; } || :
 
 # Pass EXIT_*, not number, to usage, exit, and error (when exiting)
@@ -571,6 +571,13 @@ sc_prohibit_intprops_without_use:
        re='\<($(_intprops_syms_re)) *\('                               \
          $(_sc_header_without_use)
 
        re='\<($(_intprops_syms_re)) *\('                               \
          $(_sc_header_without_use)
 
+_stddef_syms_re = NULL|offsetof|ptrdiff_t|size_t|wchar_t
+# Prohibit the inclusion of stddef.h without an actual use.
+sc_prohibit_stddef_without_use:
+       @h='<stddef.h>'                                                 \
+       re='\<($(_stddef_syms_re)) *\('                                 \
+         $(_sc_header_without_use)
+
 sc_obsolete_symbols:
        @prohibit='\<(HAVE''_FCNTL_H|O''_NDELAY)\>'                     \
        halt='do not use HAVE''_FCNTL_H or O'_NDELAY                    \
 sc_obsolete_symbols:
        @prohibit='\<(HAVE''_FCNTL_H|O''_NDELAY)\>'                     \
        halt='do not use HAVE''_FCNTL_H or O'_NDELAY                    \
@@ -1118,9 +1125,34 @@ no-submodule-changes:
          : ;                                                           \
        fi
 
          : ;                                                           \
        fi
 
+submodule-checks ?= no-submodule-changes public-submodule-commit
+
+# Ensure that each sub-module commit we're using is public.
+# Without this, it is too easy to tag and release code that
+# cannot be built from a fresh clone.
+.PHONY: public-submodule-commit
+public-submodule-commit:
+       $(AM_V_GEN)if test -d $(srcdir)/.git; then                      \
+         cd $(srcdir) &&                                               \
+         git submodule --quiet foreach test '$$(git rev-parse $$sha1)' \
+             = '$$(git merge-base origin $$sha1)'                      \
+           || { echo '$(ME): found non-public submodule commit' >&2;   \
+                exit 1; };                                             \
+       else                                                            \
+         : ;                                                           \
+       fi
+# This rule has a high enough utility/cost ratio that it should be a
+# dependent of "check" by default.  However, some of us do occasionally
+# commit a temporary change that deliberately points to a non-public
+# submodule commit, and want to be able to use rules like "make check".
+# In that case, run e.g., "make check gl_public_submodule_commit="
+# to disable this test.
+gl_public_submodule_commit ?= public-submodule-commit
+check: $(gl_public_submodule_commit)
+
 .PHONY: alpha beta stable
 ALL_RECURSIVE_TARGETS += alpha beta stable
 .PHONY: alpha beta stable
 ALL_RECURSIVE_TARGETS += alpha beta stable
-alpha beta stable: $(local-check) writable-files no-submodule-changes
+alpha beta stable: $(local-check) writable-files $(submodule-checks)
        test $@ = stable                                                \
          && { echo $(VERSION) | grep -E '^[0-9]+(\.[0-9]+)+$$'         \
               || { echo "invalid version string: $(VERSION)" 1>&2; exit 1;};}\
        test $@ = stable                                                \
          && { echo $(VERSION) | grep -E '^[0-9]+(\.[0-9]+)+$$'         \
               || { echo "invalid version string: $(VERSION)" 1>&2; exit 1;};}\