summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2014-07-29 22:13:29 +0200
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2014-07-29 22:13:29 +0200
commitedf2c6bc11b7ad1c5025107363f92d0e8b02ff71 (patch)
tree4ea367e77f1f74de6c4c21152c514779b4a1a60f
parent410970f8777f2fe7a421e94999e542d023f35229 (diff)
downloadgnutls-edf2c6bc11b7ad1c5025107363f92d0e8b02ff71.tar.gz
updated gnulib
-rwxr-xr-xbuild-aux/config.rpath16
-rwxr-xr-xbuild-aux/gendocs.sh87
-rw-r--r--gl/m4/dup2.m412
-rw-r--r--gl/m4/gnulib-common.m412
-rw-r--r--gl/m4/intl.m42
-rw-r--r--gl/m4/po.m42
-rw-r--r--gl/m4/printf.m418
-rw-r--r--gl/m4/valgrind-tests.m44
-rw-r--r--gl/select.c36
-rw-r--r--gl/tests/fcntl.in.h16
-rw-r--r--maint.mk17
-rw-r--r--src/gl/Makefile.am142
-rw-r--r--src/gl/alloca.in.h2
-rw-r--r--src/gl/c-ctype.c2
-rw-r--r--src/gl/c-ctype.h2
-rw-r--r--src/gl/errno.in.h2
-rw-r--r--src/gl/error.c21
-rw-r--r--src/gl/error.h2
-rw-r--r--src/gl/exitfail.c2
-rw-r--r--src/gl/exitfail.h2
-rw-r--r--src/gl/gettext.h2
-rw-r--r--src/gl/gettime.c2
-rw-r--r--src/gl/gettimeofday.c2
-rw-r--r--src/gl/intprops.h2
-rw-r--r--src/gl/m4/00gnulib.m422
-rw-r--r--src/gl/m4/absolute-header.m4102
-rw-r--r--src/gl/m4/alloca.m42
-rw-r--r--src/gl/m4/bison.m42
-rw-r--r--src/gl/m4/clock_time.m42
-rw-r--r--src/gl/m4/eealloc.m42
-rw-r--r--src/gl/m4/environ.m42
-rw-r--r--src/gl/m4/errno_h.m42
-rw-r--r--src/gl/m4/error.m42
-rw-r--r--src/gl/m4/extensions.m42
-rw-r--r--src/gl/m4/extern-inline.m42
-rw-r--r--src/gl/m4/gettime.m42
-rw-r--r--src/gl/m4/gettimeofday.m410
-rw-r--r--src/gl/m4/gnulib-cache.m42
-rw-r--r--src/gl/m4/gnulib-common.m474
-rw-r--r--src/gl/m4/gnulib-comp.m48
-rw-r--r--src/gl/m4/gnulib-tool.m42
-rw-r--r--src/gl/m4/include_next.m455
-rw-r--r--src/gl/m4/longlong.m42
-rw-r--r--src/gl/m4/malloca.m42
-rw-r--r--src/gl/m4/mktime.m42
-rw-r--r--src/gl/m4/msvc-inval.m42
-rw-r--r--src/gl/m4/msvc-nothrow.m42
-rw-r--r--src/gl/m4/multiarch.m42
-rw-r--r--src/gl/m4/off_t.m42
-rw-r--r--src/gl/m4/parse-datetime.m42
-rw-r--r--src/gl/m4/setenv.m42
-rw-r--r--src/gl/m4/ssize_t.m42
-rw-r--r--src/gl/m4/stdbool.m42
-rw-r--r--src/gl/m4/stddef_h.m42
-rw-r--r--src/gl/m4/stdint.m42
-rw-r--r--src/gl/m4/stdio_h.m4194
-rw-r--r--src/gl/m4/stdlib_h.m42
-rw-r--r--src/gl/m4/strerror.m42
-rw-r--r--src/gl/m4/string_h.m42
-rw-r--r--src/gl/m4/sys_socket_h.m42
-rw-r--r--src/gl/m4/sys_time_h.m42
-rw-r--r--src/gl/m4/sys_types_h.m42
-rw-r--r--src/gl/m4/time_h.m413
-rw-r--r--src/gl/m4/time_r.m42
-rw-r--r--src/gl/m4/timespec.m42
-rw-r--r--src/gl/m4/tm_gmtoff.m42
-rw-r--r--src/gl/m4/unistd_h.m42
-rw-r--r--src/gl/m4/warn-on-use.m42
-rw-r--r--src/gl/m4/wchar_t.m42
-rw-r--r--src/gl/m4/xalloc.m42
-rw-r--r--src/gl/malloca.c2
-rw-r--r--src/gl/malloca.h2
-rw-r--r--src/gl/mktime.c6
-rw-r--r--src/gl/msvc-inval.c2
-rw-r--r--src/gl/msvc-inval.h2
-rw-r--r--src/gl/msvc-nothrow.c2
-rw-r--r--src/gl/msvc-nothrow.h2
-rw-r--r--src/gl/parse-datetime.h2
-rw-r--r--src/gl/parse-datetime.y9
-rw-r--r--src/gl/progname.c2
-rw-r--r--src/gl/progname.h2
-rw-r--r--src/gl/setenv.c2
-rw-r--r--src/gl/stdbool.in.h2
-rw-r--r--src/gl/stddef.in.h2
-rw-r--r--src/gl/stdint.in.h2
-rw-r--r--src/gl/stdio.in.h1353
-rw-r--r--src/gl/stdlib.in.h2
-rw-r--r--src/gl/strerror-override.c2
-rw-r--r--src/gl/strerror-override.h2
-rw-r--r--src/gl/strerror.c2
-rw-r--r--src/gl/string.in.h2
-rw-r--r--src/gl/sys_time.in.h2
-rw-r--r--src/gl/sys_types.in.h2
-rw-r--r--src/gl/time.in.h46
-rw-r--r--src/gl/time_r.c2
-rw-r--r--src/gl/timespec.h2
-rw-r--r--src/gl/unistd.in.h17
-rw-r--r--src/gl/unsetenv.c2
-rw-r--r--src/gl/verify.h2
-rw-r--r--src/gl/xalloc-die.c2
-rw-r--r--src/gl/xalloc-oversized.h2
-rw-r--r--src/gl/xalloc.h17
-rw-r--r--src/gl/xmalloc.c2
103 files changed, 2214 insertions, 249 deletions
diff --git a/build-aux/config.rpath b/build-aux/config.rpath
index ab6fd995f3..b625621fac 100755
--- a/build-aux/config.rpath
+++ b/build-aux/config.rpath
@@ -367,11 +367,7 @@ else
dgux*)
hardcode_libdir_flag_spec='-L$libdir'
;;
- freebsd2.2*)
- hardcode_libdir_flag_spec='-R$libdir'
- hardcode_direct=yes
- ;;
- freebsd2*)
+ freebsd2.[01]*)
hardcode_direct=yes
hardcode_minus_L=yes
;;
@@ -548,13 +544,11 @@ case "$host_os" in
dgux*)
library_names_spec='$libname$shrext'
;;
+ freebsd[23].*)
+ library_names_spec='$libname$shrext$versuffix'
+ ;;
freebsd* | dragonfly*)
- case "$host_os" in
- freebsd[123]*)
- library_names_spec='$libname$shrext$versuffix' ;;
- *)
- library_names_spec='$libname$shrext' ;;
- esac
+ library_names_spec='$libname$shrext'
;;
gnu*)
library_names_spec='$libname$shrext'
diff --git a/build-aux/gendocs.sh b/build-aux/gendocs.sh
index f9ec9df76b..b2e7b09730 100755
--- a/build-aux/gendocs.sh
+++ b/build-aux/gendocs.sh
@@ -2,7 +2,7 @@
# gendocs.sh -- generate a GNU manual in many formats. This script is
# mentioned in maintain.texi. See the help message below for usage details.
-scriptversion=2013-10-10.09
+scriptversion=2014-05-01.10
# Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013
# Free Software Foundation, Inc.
@@ -78,6 +78,9 @@ Options:
--html ARG pass ARG to makeinfo or texi2html for HTML targets.
--info ARG pass ARG to makeinfo for Info, instead of --no-split.
--no-ascii skip generating the plain text output.
+ --no-html skip generating the html output.
+ --no-info skip generating the info output.
+ --no-tex skip generating the dvi and pdf output.
--source ARG include ARG in tar archive of sources.
--split HOW make split HTML by node, section, chapter; default node.
@@ -139,10 +142,13 @@ PACKAGE=
EMAIL=webmasters@gnu.org # please override with --email
commonarg= # passed to all makeinfo/texi2html invcations.
dirargs= # passed to all tools (-I dir).
-dirs= # -I's directories.
+dirs= # -I directories.
htmlarg=
infoarg=--no-split
generate_ascii=true
+generate_html=true
+generate_info=true
+generate_tex=true
outdir=manual
source_extra=
split=node
@@ -159,6 +165,9 @@ while test $# -gt 0; do
--html) shift; htmlarg=$1;;
--info) shift; infoarg=$1;;
--no-ascii) generate_ascii=false;;
+ --no-html) generate_ascii=false;;
+ --no-info) generate_info=false;;
+ --no-tex) generate_tex=false;;
--source) shift; source_extra=$1;;
--split) shift; split=$1;;
--texi2html) use_texi2html=1;;
@@ -221,8 +230,9 @@ calcsize()
# copy_images OUTDIR HTML-FILE...
# -------------------------------
-# Copy all the images needed by the HTML-FILEs into OUTDIR. Look
-# for them in the -I directories.
+# Copy all the images needed by the HTML-FILEs into OUTDIR.
+# Look for them in . and the -I directories; this is simpler than what
+# makeinfo supports with -I, but hopefully it will suffice.
copy_images()
{
local odir
@@ -232,7 +242,7 @@ copy_images()
BEGIN {
\$me = '$prog';
\$odir = '$odir';
- @dirs = qw($dirs);
+ @dirs = qw(. $dirs);
}
" -e '
/<img src="(.*?)"/g && ++$need{$1};
@@ -270,32 +280,39 @@ echo "Making output for $srcfile"
echo " in `pwd`"
mkdir -p "$outdir/"
-cmd="$SETLANG $MAKEINFO -o $PACKAGE.info $commonarg $infoarg \"$srcfile\""
-echo "Generating info... ($cmd)"
-rm -f $PACKAGE.info* # get rid of any strays
-eval "$cmd"
-tar czf "$outdir/$PACKAGE.info.tar.gz" $PACKAGE.info*
-ls -l "$outdir/$PACKAGE.info.tar.gz"
-info_tgz_size=`calcsize "$outdir/$PACKAGE.info.tar.gz"`
-# do not mv the info files, there's no point in having them available
-# separately on the web.
-
-cmd="$SETLANG $TEXI2DVI $dirargs \"$srcfile\""
-printf "\nGenerating dvi... ($cmd)\n"
-eval "$cmd"
-# compress/finish dvi:
-gzip -f -9 $PACKAGE.dvi
-dvi_gz_size=`calcsize $PACKAGE.dvi.gz`
-mv $PACKAGE.dvi.gz "$outdir/"
-ls -l "$outdir/$PACKAGE.dvi.gz"
-
-cmd="$SETLANG $TEXI2DVI --pdf $dirargs \"$srcfile\""
-printf "\nGenerating pdf... ($cmd)\n"
-eval "$cmd"
-pdf_size=`calcsize $PACKAGE.pdf`
-mv $PACKAGE.pdf "$outdir/"
-ls -l "$outdir/$PACKAGE.pdf"
+#
+if $generate_info; then
+ cmd="$SETLANG $MAKEINFO -o $PACKAGE.info $commonarg $infoarg \"$srcfile\""
+ echo "Generating info... ($cmd)"
+ rm -f $PACKAGE.info* # get rid of any strays
+ eval "$cmd"
+ tar czf "$outdir/$PACKAGE.info.tar.gz" $PACKAGE.info*
+ ls -l "$outdir/$PACKAGE.info.tar.gz"
+ info_tgz_size=`calcsize "$outdir/$PACKAGE.info.tar.gz"`
+ # do not mv the info files, there's no point in having them available
+ # separately on the web.
+fi # end info
+
+#
+if $generate_tex; then
+ cmd="$SETLANG $TEXI2DVI $dirargs \"$srcfile\""
+ printf "\nGenerating dvi... ($cmd)\n"
+ eval "$cmd"
+ # compress/finish dvi:
+ gzip -f -9 $PACKAGE.dvi
+ dvi_gz_size=`calcsize $PACKAGE.dvi.gz`
+ mv $PACKAGE.dvi.gz "$outdir/"
+ ls -l "$outdir/$PACKAGE.dvi.gz"
+
+ cmd="$SETLANG $TEXI2DVI --pdf $dirargs \"$srcfile\""
+ printf "\nGenerating pdf... ($cmd)\n"
+ eval "$cmd"
+ pdf_size=`calcsize $PACKAGE.pdf`
+ mv $PACKAGE.pdf "$outdir/"
+ ls -l "$outdir/$PACKAGE.pdf"
+fi # end tex (dvi + pdf)
+#
if $generate_ascii; then
opt="-o $PACKAGE.txt --no-split --no-headers $commonarg"
cmd="$SETLANG $MAKEINFO $opt \"$srcfile\""
@@ -308,6 +325,9 @@ if $generate_ascii; then
ls -l "$outdir/$PACKAGE.txt" "$outdir/$PACKAGE.txt.gz"
fi
+#
+
+if $generate_html; then
# Split HTML at level $1. Used for texi2html.
html_split()
{
@@ -382,7 +402,9 @@ else # use texi2html:
html_split chapter
html_split section
fi
+fi # end html
+#
printf "\nMaking .tar.gz for sources...\n"
d=`dirname $srcfile`
(
@@ -393,6 +415,8 @@ d=`dirname $srcfile`
)
texi_tgz_size=`calcsize "$outdir/$PACKAGE.texi.tar.gz"`
+#
+# Do everything again through docbook.
if test -n "$docbook"; then
opt="-o - --docbook $commonarg"
cmd="$SETLANG $MAKEINFO $opt \"$srcfile\" >${srcdir}/$PACKAGE-db.xml"
@@ -431,7 +455,8 @@ if test -n "$docbook"; then
mv $PACKAGE-db.pdf "$outdir/"
fi
-printf "\nMaking index file...\n"
+#
+printf "\nMaking index.html for $PACKAGE...\n"
if test -z "$use_texi2html"; then
CONDS="/%%IF *HTML_SECTION%%/,/%%ENDIF *HTML_SECTION%%/d;\
/%%IF *HTML_CHAPTER%%/,/%%ENDIF *HTML_CHAPTER%%/d"
diff --git a/gl/m4/dup2.m4 b/gl/m4/dup2.m4
index 89638a0bfe..6498fc2024 100644
--- a/gl/m4/dup2.m4
+++ b/gl/m4/dup2.m4
@@ -8,6 +8,7 @@ AC_DEFUN([gl_FUNC_DUP2],
[
AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_CHECK_FUNCS_ONCE([getdtablesize])
m4_ifdef([gl_FUNC_DUP2_OBSOLETE], [
AC_CHECK_FUNCS_ONCE([dup2])
if test $ac_cv_func_dup2 = no; then
@@ -23,6 +24,11 @@ AC_DEFUN([gl_FUNC_DUP2],
#include <fcntl.h>
#include <errno.h>]],
[int result = 0;
+#ifdef HAVE_GETDTABLESIZE
+ int bad_fd = getdtablesize ();
+#else
+ int bad_fd = 1000000;
+#endif
#ifdef FD_CLOEXEC
if (fcntl (1, F_SETFD, FD_CLOEXEC) == -1)
result |= 1;
@@ -37,7 +43,7 @@ AC_DEFUN([gl_FUNC_DUP2],
if (dup2 (0, 0) != -1)
result |= 8;
/* Many gnulib modules require POSIX conformance of EBADF. */
- if (dup2 (2, 1000000) == -1 && errno != EBADF)
+ if (dup2 (2, bad_fd) == -1 && errno != EBADF)
result |= 16;
/* Flush out some cygwin core dumps. */
if (dup2 (2, -1) != -1 || errno != EBADF)
@@ -56,7 +62,9 @@ AC_DEFUN([gl_FUNC_DUP2],
linux*) # On linux between 2008-07-27 and 2009-05-11, dup2 of a
# closed fd may yield -EBADF instead of -1 / errno=EBADF.
gl_cv_func_dup2_works="guessing no" ;;
- freebsd*) # on FreeBSD 6.1, dup2(1,1000000) gives EMFILE, not EBADF.
+ aix* | freebsd*)
+ # on AIX 7.1 and FreeBSD 6.1, dup2 (1,toobig) gives EMFILE,
+ # not EBADF.
gl_cv_func_dup2_works="guessing no" ;;
haiku*) # on Haiku alpha 2, dup2(1, 1) resets FD_CLOEXEC.
gl_cv_func_dup2_works="guessing no" ;;
diff --git a/gl/m4/gnulib-common.m4 b/gl/m4/gnulib-common.m4
index 20ce40e744..35f6195204 100644
--- a/gl/m4/gnulib-common.m4
+++ b/gl/m4/gnulib-common.m4
@@ -1,4 +1,4 @@
-# gnulib-common.m4 serial 34
+# gnulib-common.m4 serial 35
dnl Copyright (C) 2007-2014 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -49,6 +49,16 @@ AC_DEFUN([gl_COMMON_BODY], [
is a misnomer outside of parameter lists. */
#define _UNUSED_PARAMETER_ _GL_UNUSED
+/* gcc supports the "unused" attribute on possibly unused labels, and
+ g++ has since version 4.5. Note to support C++ as well as C,
+ _GL_UNUSED_LABEL should be used with a trailing ; */
+#if !defined __cplusplus || __GNUC__ > 4 \
+ || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)
+# define _GL_UNUSED_LABEL _GL_UNUSED
+#else
+# define _GL_UNUSED_LABEL
+#endif
+
/* The __pure__ attribute was added in gcc 2.96. */
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
diff --git a/gl/m4/intl.m4 b/gl/m4/intl.m4
index 1d782d1606..0c394ecad1 100644
--- a/gl/m4/intl.m4
+++ b/gl/m4/intl.m4
@@ -1,4 +1,4 @@
-# intl.m4 serial 24 (gettext-0.18.3)
+# intl.m4 serial 27 (gettext-0.18.3)
dnl Copyright (C) 1995-2014 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
diff --git a/gl/m4/po.m4 b/gl/m4/po.m4
index bd210c5369..c737878461 100644
--- a/gl/m4/po.m4
+++ b/gl/m4/po.m4
@@ -1,4 +1,4 @@
-# po.m4 serial 21 (gettext-0.18.3)
+# po.m4 serial 23 (gettext-0.18.3)
dnl Copyright (C) 1995-2014 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
diff --git a/gl/m4/printf.m4 b/gl/m4/printf.m4
index 9346ab041d..3d7b381efd 100644
--- a/gl/m4/printf.m4
+++ b/gl/m4/printf.m4
@@ -1,4 +1,4 @@
-# printf.m4 serial 50
+# printf.m4 serial 51
dnl Copyright (C) 2003, 2007-2014 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -61,7 +61,7 @@ changequote(,)dnl
# Guess yes on glibc systems.
*-gnu*) gl_cv_func_printf_sizes_c99="guessing yes";;
# Guess yes on FreeBSD >= 5.
- freebsd[1-4]*) gl_cv_func_printf_sizes_c99="guessing no";;
+ freebsd[1-4].*) gl_cv_func_printf_sizes_c99="guessing no";;
freebsd* | kfreebsd*) gl_cv_func_printf_sizes_c99="guessing yes";;
# Guess yes on Mac OS X >= 10.3.
darwin[1-6].*) gl_cv_func_printf_sizes_c99="guessing no";;
@@ -220,7 +220,7 @@ changequote(,)dnl
# Guess yes on glibc systems.
*-gnu*) gl_cv_func_printf_infinite="guessing yes";;
# Guess yes on FreeBSD >= 6.
- freebsd[1-5]*) gl_cv_func_printf_infinite="guessing no";;
+ freebsd[1-5].*) gl_cv_func_printf_infinite="guessing no";;
freebsd* | kfreebsd*) gl_cv_func_printf_infinite="guessing yes";;
# Guess yes on Mac OS X >= 10.3.
darwin[1-6].*) gl_cv_func_printf_infinite="guessing no";;
@@ -442,7 +442,7 @@ changequote(,)dnl
# Guess yes on glibc systems.
*-gnu*) gl_cv_func_printf_infinite_long_double="guessing yes";;
# Guess yes on FreeBSD >= 6.
- freebsd[1-5]*) gl_cv_func_printf_infinite_long_double="guessing no";;
+ freebsd[1-5].*) gl_cv_func_printf_infinite_long_double="guessing no";;
freebsd* | kfreebsd*) gl_cv_func_printf_infinite_long_double="guessing yes";;
# Guess yes on HP-UX >= 11.
hpux[7-9]* | hpux10*) gl_cv_func_printf_infinite_long_double="guessing no";;
@@ -588,7 +588,7 @@ changequote(,)dnl
# Guess yes on glibc systems.
*-gnu*) gl_cv_func_printf_directive_f="guessing yes";;
# Guess yes on FreeBSD >= 6.
- freebsd[1-5]*) gl_cv_func_printf_directive_f="guessing no";;
+ freebsd[1-5].*) gl_cv_func_printf_directive_f="guessing no";;
freebsd* | kfreebsd*) gl_cv_func_printf_directive_f="guessing yes";;
# Guess yes on Mac OS X >= 10.3.
darwin[1-6].*) gl_cv_func_printf_directive_f="guessing no";;
@@ -1136,7 +1136,7 @@ changequote(,)dnl
# Guess yes on glibc systems.
*-gnu*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
# Guess yes on FreeBSD >= 5.
- freebsd[1-4]*) gl_cv_func_snprintf_truncation_c99="guessing no";;
+ freebsd[1-4].*) gl_cv_func_snprintf_truncation_c99="guessing no";;
freebsd* | kfreebsd*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
# Guess yes on Mac OS X >= 10.3.
darwin[1-6].*) gl_cv_func_snprintf_truncation_c99="guessing no";;
@@ -1235,7 +1235,7 @@ changequote(,)dnl
# Guess yes on glibc systems.
*-gnu*) gl_cv_func_snprintf_retval_c99="guessing yes";;
# Guess yes on FreeBSD >= 5.
- freebsd[1-4]*) gl_cv_func_snprintf_retval_c99="guessing no";;
+ freebsd[1-4].*) gl_cv_func_snprintf_retval_c99="guessing no";;
freebsd* | kfreebsd*) gl_cv_func_snprintf_retval_c99="guessing yes";;
# Guess yes on Mac OS X >= 10.3.
darwin[1-6].*) gl_cv_func_snprintf_retval_c99="guessing no";;
@@ -1316,7 +1316,7 @@ changequote(,)dnl
# Guess yes on glibc systems.
*-gnu*) gl_cv_func_snprintf_directive_n="guessing yes";;
# Guess yes on FreeBSD >= 5.
- freebsd[1-4]*) gl_cv_func_snprintf_directive_n="guessing no";;
+ freebsd[1-4].*) gl_cv_func_snprintf_directive_n="guessing no";;
freebsd* | kfreebsd*) gl_cv_func_snprintf_directive_n="guessing yes";;
# Guess yes on Mac OS X >= 10.3.
darwin[1-6].*) gl_cv_func_snprintf_directive_n="guessing no";;
@@ -1458,7 +1458,7 @@ changequote(,)dnl
# Guess yes on glibc systems.
*-gnu*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
# Guess yes on FreeBSD >= 5.
- freebsd[1-4]*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
+ freebsd[1-4].*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
freebsd* | kfreebsd*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
# Guess yes on Mac OS X >= 10.3.
darwin[1-6].*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
diff --git a/gl/m4/valgrind-tests.m4 b/gl/m4/valgrind-tests.m4
index 367816b6eb..502b8df59f 100644
--- a/gl/m4/valgrind-tests.m4
+++ b/gl/m4/valgrind-tests.m4
@@ -12,8 +12,8 @@ dnl From Simon Josefsson
AC_DEFUN([gl_VALGRIND_TESTS],
[
AC_ARG_ENABLE(valgrind-tests,
- AS_HELP_STRING([--enable-valgrind-tests],
- [run self tests under valgrind]),
+ AS_HELP_STRING([--disable-valgrind-tests],
+ [don't try to run self tests under valgrind]),
[opt_valgrind_tests=$enableval], [opt_valgrind_tests=yes])
# Run self-tests under valgrind?
diff --git a/gl/select.c b/gl/select.c
index 1c8fd70c52..1bc359e148 100644
--- a/gl/select.c
+++ b/gl/select.c
@@ -82,9 +82,11 @@ typedef DWORD (WINAPI *PNtQueryInformationFile)
#define PIPE_BUF 512
#endif
-/* Optimized test whether a HANDLE refers to a console.
- See <http://lists.gnu.org/archive/html/bug-gnulib/2009-08/msg00065.html>. */
-#define IsConsoleHandle(h) (((intptr_t) (h) & 3) == 3)
+static BOOL IsConsoleHandle (HANDLE h)
+{
+ DWORD mode;
+ return GetConsoleMode (h, &mode) != 0;
+}
static BOOL
IsSocketHandle (HANDLE h)
@@ -252,6 +254,7 @@ rpl_select (int nfds, fd_set *rfds, fd_set *wfds, fd_set *xfds,
DWORD ret, wait_timeout, nhandles, nsock, nbuffer;
MSG msg;
int i, fd, rc;
+ clock_t tend;
if (nfds > FD_SETSIZE)
nfds = FD_SETSIZE;
@@ -388,6 +391,10 @@ rpl_select (int nfds, fd_set *rfds, fd_set *wfds, fd_set *xfds,
/* Place a sentinel at the end of the array. */
handle_array[nhandles] = NULL;
+ /* When will the waiting period expire? */
+ if (wait_timeout != INFINITE)
+ tend = clock () + wait_timeout;
+
restart:
if (wait_timeout == 0 || nsock == 0)
rc = 0;
@@ -408,6 +415,16 @@ restart:
wait_timeout = 0;
}
+ /* How much is left to wait? */
+ if (wait_timeout != INFINITE)
+ {
+ clock_t tnow = clock ();
+ if (tend >= tnow)
+ wait_timeout = tend - tnow;
+ else
+ wait_timeout = 0;
+ }
+
for (;;)
{
ret = MsgWaitForMultipleObjects (nhandles, handle_array, FALSE,
@@ -453,7 +470,16 @@ restart:
}
}
- if (rc == 0 && wait_timeout == INFINITE)
+ if (rc == 0
+ && (wait_timeout == INFINITE
+ /* If NHANDLES > 1, but no bits are set, it means we've
+ been told incorrectly that some handle was signaled.
+ This happens with anonymous pipes, which always cause
+ MsgWaitForMultipleObjects to exit immediately, but no
+ data is found ready to be read by windows_poll_handle.
+ To avoid a total failure (whereby we return zero and
+ don't wait at all), let's poll in a more busy loop. */
+ || (wait_timeout != 0 && nhandles > 1)))
{
/* Sleep 1 millisecond to avoid busy wait and retry with the
original fd_sets. */
@@ -463,6 +489,8 @@ restart:
SleepEx (1, TRUE);
goto restart;
}
+ if (timeout && wait_timeout == 0 && rc == 0)
+ timeout->tv_sec = timeout->tv_usec = 0;
}
/* Now fill in the results. */
diff --git a/gl/tests/fcntl.in.h b/gl/tests/fcntl.in.h
index 99f75e60fd..e23b4b2bcd 100644
--- a/gl/tests/fcntl.in.h
+++ b/gl/tests/fcntl.in.h
@@ -186,6 +186,22 @@ _GL_WARN_ON_USE (openat, "openat is not portable - "
/* Fix up the O_* macros. */
+/* AIX 7.1 with XL C 12.1 defines O_CLOEXEC, O_NOFOLLOW, and O_TTY_INIT
+ to values outside 'int' range, so omit these misdefinitions.
+ But avoid namespace pollution on non-AIX systems. */
+#ifdef _AIX
+# include <limits.h>
+# if defined O_CLOEXEC && ! (INT_MIN <= O_CLOEXEC && O_CLOEXEC <= INT_MAX)
+# undef O_CLOEXEC
+# endif
+# if defined O_NOFOLLOW && ! (INT_MIN <= O_NOFOLLOW && O_NOFOLLOW <= INT_MAX)
+# undef O_NOFOLLOW
+# endif
+# if defined O_TTY_INIT && ! (INT_MIN <= O_TTY_INIT && O_TTY_INIT <= INT_MAX)
+# undef O_TTY_INIT
+# endif
+#endif
+
#if !defined O_DIRECT && defined O_DIRECTIO
/* Tru64 spells it 'O_DIRECTIO'. */
# define O_DIRECT O_DIRECTIO
diff --git a/maint.mk b/maint.mk
index 30f2e8e694..e5a3782921 100644
--- a/maint.mk
+++ b/maint.mk
@@ -21,13 +21,6 @@
# ME := $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
ME := maint.mk
-# Diagnostic for continued use of deprecated variable.
-# Remove in 2013
-ifneq ($(build_aux),)
- $(error "$(ME): \
-set $$(_build-aux) relative to $$(srcdir) instead of $$(build_aux)")
-endif
-
# Helper variables.
_empty =
_sp = $(_empty) $(_empty)
@@ -155,6 +148,7 @@ export LC_ALL = C
## Sanity checks. ##
## --------------- ##
+ifneq ($(_gl-Makefile),)
_cfg_mk := $(wildcard $(srcdir)/cfg.mk)
# Collect the names of rules starting with 'sc_'.
@@ -196,6 +190,7 @@ local-check := \
$(filter-out $(local-checks-to-skip), $(local-checks-available)))
syntax-check: $(local-check)
+endif
# _sc_search_regexp
#
@@ -445,7 +440,7 @@ sc_require_config_h:
# You must include <config.h> before including any other header file.
# This can possibly be via a package-specific header, if given by cfg.mk.
sc_require_config_h_first:
- @if $(VC_LIST_EXCEPT) | grep -l '\.c$$' > /dev/null; then \
+ @if $(VC_LIST_EXCEPT) | grep '\.c$$' > /dev/null; then \
fail=0; \
for i in $$($(VC_LIST_EXCEPT) | grep '\.c$$'); do \
grep '^# *include\>' $$i | $(SED) 1q \
@@ -469,7 +464,7 @@ sc_prohibit_HAVE_MBRTOWC:
define _sc_header_without_use
dummy=; : so we do not need a semicolon before each use; \
h_esc=`echo '[<"]'"$$h"'[">]'|$(SED) 's/\./\\\\./g'`; \
- if $(VC_LIST_EXCEPT) | grep -l '\.c$$' > /dev/null; then \
+ if $(VC_LIST_EXCEPT) | grep '\.c$$' > /dev/null; then \
files=$$(grep -l '^# *include '"$$h_esc" \
$$($(VC_LIST_EXCEPT) | grep '\.c$$')) && \
grep -LE "$$re" $$files | grep . && \
@@ -716,7 +711,7 @@ sc_changelog:
# Ensure that each .c file containing a "main" function also
# calls set_program_name.
sc_program_name:
- @require='set_program_name *\(m?argv\[0\]\);' \
+ @require='set_program_name *\(.*\);' \
in_vc_files='\.c$$' \
containing='\<main *(' \
halt='the above files do not call set_program_name' \
@@ -1192,7 +1187,7 @@ sc_copyright_check:
in_vc_files=$(sample-test) \
halt='out of date copyright in $(sample-test); update it' \
$(_sc_search_regexp)
- @require='Copyright @copyright\{\} .*'$$(date +%Y)' Free' \
+ @require='Copyright @copyright\{\} .*'$$(date +%Y) \
in_vc_files=$(texi) \
halt='out of date copyright in $(texi); update it' \
$(_sc_search_regexp)
diff --git a/src/gl/Makefile.am b/src/gl/Makefile.am
index c25328d129..8c04ae2991 100644
--- a/src/gl/Makefile.am
+++ b/src/gl/Makefile.am
@@ -1,6 +1,6 @@
## DO NOT EDIT! GENERATED AUTOMATICALLY!
## Process this file with automake to produce Makefile.in.
-# Copyright (C) 2002-2013 Free Software Foundation, Inc.
+# Copyright (C) 2002-2014 Free Software Foundation, Inc.
#
# This file is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -53,6 +53,15 @@ libgnu_gpl_la_LDFLAGS += -no-undefined
libgnu_gpl_la_LDFLAGS += $(LIB_CLOCK_GETTIME)
libgnu_gpl_la_LDFLAGS += $(LTLIBINTL)
+## begin gnulib module absolute-header
+
+# Use this preprocessor expression to decide whether #include_next works.
+# Do not rely on a 'configure'-time test for this, since the expression
+# might appear in an installed header, which is used by some other compiler.
+HAVE_INCLUDE_NEXT = (__GNUC__ || 60000000 <= __DECC_VER)
+
+## end gnulib module absolute-header
+
## begin gnulib module alloca-opt
BUILT_SOURCES += $(ALLOCA_H)
@@ -418,6 +427,134 @@ EXTRA_DIST += stdint.in.h
## end gnulib module stdint
+## begin gnulib module stdio
+
+BUILT_SOURCES += stdio.h
+
+# We need the following in order to create <stdio.h> when the system
+# doesn't have one that works with the given compiler.
+stdio.h: stdio.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
+ sed -e 's|@''GUARD_PREFIX''@|GL_GGL|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_STDIO_H''@|$(NEXT_STDIO_H)|g' \
+ -e 's/@''GNULIB_DPRINTF''@/$(GNULIB_DPRINTF)/g' \
+ -e 's/@''GNULIB_FCLOSE''@/$(GNULIB_FCLOSE)/g' \
+ -e 's/@''GNULIB_FDOPEN''@/$(GNULIB_FDOPEN)/g' \
+ -e 's/@''GNULIB_FFLUSH''@/$(GNULIB_FFLUSH)/g' \
+ -e 's/@''GNULIB_FGETC''@/$(GNULIB_FGETC)/g' \
+ -e 's/@''GNULIB_FGETS''@/$(GNULIB_FGETS)/g' \
+ -e 's/@''GNULIB_FOPEN''@/$(GNULIB_FOPEN)/g' \
+ -e 's/@''GNULIB_FPRINTF''@/$(GNULIB_FPRINTF)/g' \
+ -e 's/@''GNULIB_FPRINTF_POSIX''@/$(GNULIB_FPRINTF_POSIX)/g' \
+ -e 's/@''GNULIB_FPURGE''@/$(GNULIB_FPURGE)/g' \
+ -e 's/@''GNULIB_FPUTC''@/$(GNULIB_FPUTC)/g' \
+ -e 's/@''GNULIB_FPUTS''@/$(GNULIB_FPUTS)/g' \
+ -e 's/@''GNULIB_FREAD''@/$(GNULIB_FREAD)/g' \
+ -e 's/@''GNULIB_FREOPEN''@/$(GNULIB_FREOPEN)/g' \
+ -e 's/@''GNULIB_FSCANF''@/$(GNULIB_FSCANF)/g' \
+ -e 's/@''GNULIB_FSEEK''@/$(GNULIB_FSEEK)/g' \
+ -e 's/@''GNULIB_FSEEKO''@/$(GNULIB_FSEEKO)/g' \
+ -e 's/@''GNULIB_FTELL''@/$(GNULIB_FTELL)/g' \
+ -e 's/@''GNULIB_FTELLO''@/$(GNULIB_FTELLO)/g' \
+ -e 's/@''GNULIB_FWRITE''@/$(GNULIB_FWRITE)/g' \
+ -e 's/@''GNULIB_GETC''@/$(GNULIB_GETC)/g' \
+ -e 's/@''GNULIB_GETCHAR''@/$(GNULIB_GETCHAR)/g' \
+ -e 's/@''GNULIB_GETDELIM''@/$(GNULIB_GETDELIM)/g' \
+ -e 's/@''GNULIB_GETLINE''@/$(GNULIB_GETLINE)/g' \
+ -e 's/@''GNULIB_OBSTACK_PRINTF''@/$(GNULIB_OBSTACK_PRINTF)/g' \
+ -e 's/@''GNULIB_OBSTACK_PRINTF_POSIX''@/$(GNULIB_OBSTACK_PRINTF_POSIX)/g' \
+ -e 's/@''GNULIB_PCLOSE''@/$(GNULIB_PCLOSE)/g' \
+ -e 's/@''GNULIB_PERROR''@/$(GNULIB_PERROR)/g' \
+ -e 's/@''GNULIB_POPEN''@/$(GNULIB_POPEN)/g' \
+ -e 's/@''GNULIB_PRINTF''@/$(GNULIB_PRINTF)/g' \
+ -e 's/@''GNULIB_PRINTF_POSIX''@/$(GNULIB_PRINTF_POSIX)/g' \
+ -e 's/@''GNULIB_PUTC''@/$(GNULIB_PUTC)/g' \
+ -e 's/@''GNULIB_PUTCHAR''@/$(GNULIB_PUTCHAR)/g' \
+ -e 's/@''GNULIB_PUTS''@/$(GNULIB_PUTS)/g' \
+ -e 's/@''GNULIB_REMOVE''@/$(GNULIB_REMOVE)/g' \
+ -e 's/@''GNULIB_RENAME''@/$(GNULIB_RENAME)/g' \
+ -e 's/@''GNULIB_RENAMEAT''@/$(GNULIB_RENAMEAT)/g' \
+ -e 's/@''GNULIB_SCANF''@/$(GNULIB_SCANF)/g' \
+ -e 's/@''GNULIB_SNPRINTF''@/$(GNULIB_SNPRINTF)/g' \
+ -e 's/@''GNULIB_SPRINTF_POSIX''@/$(GNULIB_SPRINTF_POSIX)/g' \
+ -e 's/@''GNULIB_STDIO_H_NONBLOCKING''@/$(GNULIB_STDIO_H_NONBLOCKING)/g' \
+ -e 's/@''GNULIB_STDIO_H_SIGPIPE''@/$(GNULIB_STDIO_H_SIGPIPE)/g' \
+ -e 's/@''GNULIB_TMPFILE''@/$(GNULIB_TMPFILE)/g' \
+ -e 's/@''GNULIB_VASPRINTF''@/$(GNULIB_VASPRINTF)/g' \
+ -e 's/@''GNULIB_VDPRINTF''@/$(GNULIB_VDPRINTF)/g' \
+ -e 's/@''GNULIB_VFPRINTF''@/$(GNULIB_VFPRINTF)/g' \
+ -e 's/@''GNULIB_VFPRINTF_POSIX''@/$(GNULIB_VFPRINTF_POSIX)/g' \
+ -e 's/@''GNULIB_VFSCANF''@/$(GNULIB_VFSCANF)/g' \
+ -e 's/@''GNULIB_VSCANF''@/$(GNULIB_VSCANF)/g' \
+ -e 's/@''GNULIB_VPRINTF''@/$(GNULIB_VPRINTF)/g' \
+ -e 's/@''GNULIB_VPRINTF_POSIX''@/$(GNULIB_VPRINTF_POSIX)/g' \
+ -e 's/@''GNULIB_VSNPRINTF''@/$(GNULIB_VSNPRINTF)/g' \
+ -e 's/@''GNULIB_VSPRINTF_POSIX''@/$(GNULIB_VSPRINTF_POSIX)/g' \
+ < $(srcdir)/stdio.in.h | \
+ sed -e 's|@''HAVE_DECL_FPURGE''@|$(HAVE_DECL_FPURGE)|g' \
+ -e 's|@''HAVE_DECL_FSEEKO''@|$(HAVE_DECL_FSEEKO)|g' \
+ -e 's|@''HAVE_DECL_FTELLO''@|$(HAVE_DECL_FTELLO)|g' \
+ -e 's|@''HAVE_DECL_GETDELIM''@|$(HAVE_DECL_GETDELIM)|g' \
+ -e 's|@''HAVE_DECL_GETLINE''@|$(HAVE_DECL_GETLINE)|g' \
+ -e 's|@''HAVE_DECL_OBSTACK_PRINTF''@|$(HAVE_DECL_OBSTACK_PRINTF)|g' \
+ -e 's|@''HAVE_DECL_SNPRINTF''@|$(HAVE_DECL_SNPRINTF)|g' \
+ -e 's|@''HAVE_DECL_VSNPRINTF''@|$(HAVE_DECL_VSNPRINTF)|g' \
+ -e 's|@''HAVE_DPRINTF''@|$(HAVE_DPRINTF)|g' \
+ -e 's|@''HAVE_FSEEKO''@|$(HAVE_FSEEKO)|g' \
+ -e 's|@''HAVE_FTELLO''@|$(HAVE_FTELLO)|g' \
+ -e 's|@''HAVE_PCLOSE''@|$(HAVE_PCLOSE)|g' \
+ -e 's|@''HAVE_POPEN''@|$(HAVE_POPEN)|g' \
+ -e 's|@''HAVE_RENAMEAT''@|$(HAVE_RENAMEAT)|g' \
+ -e 's|@''HAVE_VASPRINTF''@|$(HAVE_VASPRINTF)|g' \
+ -e 's|@''HAVE_VDPRINTF''@|$(HAVE_VDPRINTF)|g' \
+ -e 's|@''REPLACE_DPRINTF''@|$(REPLACE_DPRINTF)|g' \
+ -e 's|@''REPLACE_FCLOSE''@|$(REPLACE_FCLOSE)|g' \
+ -e 's|@''REPLACE_FDOPEN''@|$(REPLACE_FDOPEN)|g' \
+ -e 's|@''REPLACE_FFLUSH''@|$(REPLACE_FFLUSH)|g' \
+ -e 's|@''REPLACE_FOPEN''@|$(REPLACE_FOPEN)|g' \
+ -e 's|@''REPLACE_FPRINTF''@|$(REPLACE_FPRINTF)|g' \
+ -e 's|@''REPLACE_FPURGE''@|$(REPLACE_FPURGE)|g' \
+ -e 's|@''REPLACE_FREOPEN''@|$(REPLACE_FREOPEN)|g' \
+ -e 's|@''REPLACE_FSEEK''@|$(REPLACE_FSEEK)|g' \
+ -e 's|@''REPLACE_FSEEKO''@|$(REPLACE_FSEEKO)|g' \
+ -e 's|@''REPLACE_FTELL''@|$(REPLACE_FTELL)|g' \
+ -e 's|@''REPLACE_FTELLO''@|$(REPLACE_FTELLO)|g' \
+ -e 's|@''REPLACE_GETDELIM''@|$(REPLACE_GETDELIM)|g' \
+ -e 's|@''REPLACE_GETLINE''@|$(REPLACE_GETLINE)|g' \
+ -e 's|@''REPLACE_OBSTACK_PRINTF''@|$(REPLACE_OBSTACK_PRINTF)|g' \
+ -e 's|@''REPLACE_PERROR''@|$(REPLACE_PERROR)|g' \
+ -e 's|@''REPLACE_POPEN''@|$(REPLACE_POPEN)|g' \
+ -e 's|@''REPLACE_PRINTF''@|$(REPLACE_PRINTF)|g' \
+ -e 's|@''REPLACE_REMOVE''@|$(REPLACE_REMOVE)|g' \
+ -e 's|@''REPLACE_RENAME''@|$(REPLACE_RENAME)|g' \
+ -e 's|@''REPLACE_RENAMEAT''@|$(REPLACE_RENAMEAT)|g' \
+ -e 's|@''REPLACE_SNPRINTF''@|$(REPLACE_SNPRINTF)|g' \
+ -e 's|@''REPLACE_SPRINTF''@|$(REPLACE_SPRINTF)|g' \
+ -e 's|@''REPLACE_STDIO_READ_FUNCS''@|$(REPLACE_STDIO_READ_FUNCS)|g' \
+ -e 's|@''REPLACE_STDIO_WRITE_FUNCS''@|$(REPLACE_STDIO_WRITE_FUNCS)|g' \
+ -e 's|@''REPLACE_TMPFILE''@|$(REPLACE_TMPFILE)|g' \
+ -e 's|@''REPLACE_VASPRINTF''@|$(REPLACE_VASPRINTF)|g' \
+ -e 's|@''REPLACE_VDPRINTF''@|$(REPLACE_VDPRINTF)|g' \
+ -e 's|@''REPLACE_VFPRINTF''@|$(REPLACE_VFPRINTF)|g' \
+ -e 's|@''REPLACE_VPRINTF''@|$(REPLACE_VPRINTF)|g' \
+ -e 's|@''REPLACE_VSNPRINTF''@|$(REPLACE_VSNPRINTF)|g' \
+ -e 's|@''REPLACE_VSPRINTF''@|$(REPLACE_VSPRINTF)|g' \
+ -e 's|@''ASM_SYMBOL_PREFIX''@|$(ASM_SYMBOL_PREFIX)|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)'; \
+ } > $@-t && \
+ mv $@-t $@
+MOSTLYCLEANFILES += stdio.h stdio.h-t
+
+EXTRA_DIST += stdio.in.h
+
+## end gnulib module stdio
+
## begin gnulib module stdlib
BUILT_SOURCES += stdlib.h
@@ -712,6 +849,7 @@ time.h: time.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
-e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
-e 's|@''NEXT_TIME_H''@|$(NEXT_TIME_H)|g' \
+ -e 's/@''GNULIB_GETTIMEOFDAY''@/$(GNULIB_GETTIMEOFDAY)/g' \
-e 's/@''GNULIB_MKTIME''@/$(GNULIB_MKTIME)/g' \
-e 's/@''GNULIB_NANOSLEEP''@/$(GNULIB_NANOSLEEP)/g' \
-e 's/@''GNULIB_STRPTIME''@/$(GNULIB_STRPTIME)/g' \
@@ -721,6 +859,8 @@ time.h: time.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(
-e 's|@''HAVE_NANOSLEEP''@|$(HAVE_NANOSLEEP)|g' \
-e 's|@''HAVE_STRPTIME''@|$(HAVE_STRPTIME)|g' \
-e 's|@''HAVE_TIMEGM''@|$(HAVE_TIMEGM)|g' \
+ -e 's|@''REPLACE_GMTIME''@|$(REPLACE_GMTIME)|g' \
+ -e 's|@''REPLACE_LOCALTIME''@|$(REPLACE_LOCALTIME)|g' \
-e 's|@''REPLACE_LOCALTIME_R''@|$(REPLACE_LOCALTIME_R)|g' \
-e 's|@''REPLACE_MKTIME''@|$(REPLACE_MKTIME)|g' \
-e 's|@''REPLACE_NANOSLEEP''@|$(REPLACE_NANOSLEEP)|g' \
diff --git a/src/gl/alloca.in.h b/src/gl/alloca.in.h
index 72d28ee306..5de9aaabc4 100644
--- a/src/gl/alloca.in.h
+++ b/src/gl/alloca.in.h
@@ -1,6 +1,6 @@
/* Memory allocation on the stack.
- Copyright (C) 1995, 1999, 2001-2004, 2006-2013 Free Software Foundation,
+ Copyright (C) 1995, 1999, 2001-2004, 2006-2014 Free Software Foundation,
Inc.
This program is free software; you can redistribute it and/or modify it
diff --git a/src/gl/c-ctype.c b/src/gl/c-ctype.c
index 752d2e32ae..48c6478378 100644
--- a/src/gl/c-ctype.c
+++ b/src/gl/c-ctype.c
@@ -1,6 +1,6 @@
/* Character handling in C locale.
- Copyright 2000-2003, 2006, 2009-2013 Free Software Foundation, Inc.
+ Copyright 2000-2003, 2006, 2009-2014 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
diff --git a/src/gl/c-ctype.h b/src/gl/c-ctype.h
index ad589b5c20..b465277619 100644
--- a/src/gl/c-ctype.h
+++ b/src/gl/c-ctype.h
@@ -5,7 +5,7 @@
<ctype.h> functions' behaviour depends on the current locale set via
setlocale.
- Copyright (C) 2000-2003, 2006, 2008-2013 Free Software Foundation, Inc.
+ Copyright (C) 2000-2003, 2006, 2008-2014 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
diff --git a/src/gl/errno.in.h b/src/gl/errno.in.h
index 49b35464b9..832afc8f85 100644
--- a/src/gl/errno.in.h
+++ b/src/gl/errno.in.h
@@ -1,6 +1,6 @@
/* A POSIX-like <errno.h>.
- Copyright (C) 2008-2013 Free Software Foundation, Inc.
+ Copyright (C) 2008-2014 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
diff --git a/src/gl/error.c b/src/gl/error.c
index 560865689e..7b99cd7310 100644
--- a/src/gl/error.c
+++ b/src/gl/error.c
@@ -1,5 +1,5 @@
/* Error handler for noninteractive utilities
- Copyright (C) 1990-1998, 2000-2007, 2009-2013 Free Software Foundation, Inc.
+ Copyright (C) 1990-1998, 2000-2007, 2009-2014 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
@@ -39,6 +39,9 @@
# include <stdint.h>
# include <wchar.h>
# define mbsrtowcs __mbsrtowcs
+# define USE_UNLOCKED_IO 0
+# define _GL_ATTRIBUTE_FORMAT_PRINTF(a, b)
+# define _GL_ARG_NONNULL(a)
#endif
#if USE_UNLOCKED_IO
@@ -77,9 +80,9 @@ extern void __error_at_line (int status, int errnum, const char *file_name,
# define error_at_line __error_at_line
# include <libio/iolibio.h>
-# define fflush(s) INTUSE(_IO_fflush) (s)
+# define fflush(s) _IO_fflush (s)
# undef putc
-# define putc(c, fp) INTUSE(_IO_putc) (c, fp)
+# define putc(c, fp) _IO_putc (c, fp)
# include <bits/libc-lock.h>
@@ -171,7 +174,7 @@ print_errno_message (int errnum)
#if defined HAVE_STRERROR_R || _LIBC
char errbuf[1024];
-# if STRERROR_R_CHAR_P || _LIBC
+# if _LIBC || STRERROR_R_CHAR_P
s = __strerror_r (errnum, errbuf, sizeof errbuf);
# else
if (__strerror_r (errnum, errbuf, sizeof errbuf) == 0)
@@ -195,13 +198,12 @@ print_errno_message (int errnum)
#endif
}
-static void
+static void _GL_ATTRIBUTE_FORMAT_PRINTF (3, 0) _GL_ARG_NONNULL ((3))
error_tail (int status, int errnum, const char *message, va_list args)
{
#if _LIBC
if (_IO_fwide (stderr, 0) > 0)
{
-# define ALLOCA_LIMIT 2000
size_t len = strlen (message) + 1;
wchar_t *wmessage = NULL;
mbstate_t st;
@@ -237,7 +239,7 @@ error_tail (int status, int errnum, const char *message, va_list args)
if (res != len)
break;
- if (__builtin_expect (len >= SIZE_MAX / 2, 0))
+ if (__builtin_expect (len >= SIZE_MAX / sizeof (wchar_t) / 2, 0))
{
/* This really should not happen if everything is fine. */
res = (size_t) -1;
@@ -342,7 +344,10 @@ error_at_line (int status, int errnum, const char *file_name,
if (old_line_number == line_number
&& (file_name == old_file_name
- || strcmp (old_file_name, file_name) == 0))
+ || (old_file_name != NULL
+ && file_name != NULL
+ && strcmp (old_file_name, file_name) == 0)))
+
/* Simply return and print nothing. */
return;
diff --git a/src/gl/error.h b/src/gl/error.h
index afcb0e10c8..4aaafb3626 100644
--- a/src/gl/error.h
+++ b/src/gl/error.h
@@ -1,5 +1,5 @@
/* Declaration for error-reporting function
- Copyright (C) 1995-1997, 2003, 2006, 2008-2013 Free Software Foundation,
+ Copyright (C) 1995-1997, 2003, 2006, 2008-2014 Free Software Foundation,
Inc.
This file is part of the GNU C Library.
diff --git a/src/gl/exitfail.c b/src/gl/exitfail.c
index b0b4ebe45a..609afc5af7 100644
--- a/src/gl/exitfail.c
+++ b/src/gl/exitfail.c
@@ -1,6 +1,6 @@
/* Failure exit status
- Copyright (C) 2002-2003, 2005-2007, 2009-2013 Free Software Foundation, Inc.
+ Copyright (C) 2002-2003, 2005-2007, 2009-2014 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
diff --git a/src/gl/exitfail.h b/src/gl/exitfail.h
index e54333bdd2..66807d511f 100644
--- a/src/gl/exitfail.h
+++ b/src/gl/exitfail.h
@@ -1,6 +1,6 @@
/* Failure exit status
- Copyright (C) 2002, 2009-2013 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2009-2014 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
diff --git a/src/gl/gettext.h b/src/gl/gettext.h
index d0215715a9..c7d6fd345c 100644
--- a/src/gl/gettext.h
+++ b/src/gl/gettext.h
@@ -1,5 +1,5 @@
/* Convenience header for conditional use of GNU <libintl.h>.
- Copyright (C) 1995-1998, 2000-2002, 2004-2006, 2009-2013 Free Software
+ Copyright (C) 1995-1998, 2000-2002, 2004-2006, 2009-2014 Free Software
Foundation, Inc.
This program is free software; you can redistribute it and/or modify
diff --git a/src/gl/gettime.c b/src/gl/gettime.c
index 0a642dd201..1b4ca8d2f3 100644
--- a/src/gl/gettime.c
+++ b/src/gl/gettime.c
@@ -1,6 +1,6 @@
/* gettime -- get the system clock
- Copyright (C) 2002, 2004-2007, 2009-2013 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2004-2007, 2009-2014 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
diff --git a/src/gl/gettimeofday.c b/src/gl/gettimeofday.c
index ad65c6da8b..8b2058e8c8 100644
--- a/src/gl/gettimeofday.c
+++ b/src/gl/gettimeofday.c
@@ -1,6 +1,6 @@
/* Provide gettimeofday for systems that don't have it or for which it's broken.
- Copyright (C) 2001-2003, 2005-2007, 2009-2013 Free Software Foundation, Inc.
+ Copyright (C) 2001-2003, 2005-2007, 2009-2014 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
diff --git a/src/gl/intprops.h b/src/gl/intprops.h
index 1d2deb7fc2..d0bb7a6f57 100644
--- a/src/gl/intprops.h
+++ b/src/gl/intprops.h
@@ -1,6 +1,6 @@
/* intprops.h -- properties of integer types
- Copyright (C) 2001-2005, 2009-2013 Free Software Foundation, Inc.
+ Copyright (C) 2001-2005, 2009-2014 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
diff --git a/src/gl/m4/00gnulib.m4 b/src/gl/m4/00gnulib.m4
index d4ad759fd3..8eca5518ad 100644
--- a/src/gl/m4/00gnulib.m4
+++ b/src/gl/m4/00gnulib.m4
@@ -1,12 +1,28 @@
-# 00gnulib.m4 serial 2
-dnl Copyright (C) 2009-2013 Free Software Foundation, Inc.
+# 00gnulib.m4 serial 3
+dnl Copyright (C) 2009-2014 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 must be named something that sorts before all other
dnl gnulib-provided .m4 files. It is needed until such time as we can
-dnl assume Autoconf 2.64, with its improved AC_DEFUN_ONCE semantics.
+dnl assume Autoconf 2.64, with its improved AC_DEFUN_ONCE and
+dnl m4_divert semantics.
+
+# Until autoconf 2.63, handling of the diversion stack required m4_init
+# to be called first; but this does not happen with aclocal. Wrapping
+# the entire execution in another layer of the diversion stack fixes this.
+# Worse, prior to autoconf 2.62, m4_wrap depended on the underlying m4
+# for whether it was FIFO or LIFO; in order to properly balance with
+# m4_init, we need to undo our push just before anything wrapped within
+# the m4_init body. The way to ensure this is to wrap both sides of
+# m4_init with a one-shot macro that does the pop at the right time.
+m4_ifndef([_m4_divert_diversion],
+[m4_divert_push([KILL])
+m4_define([gl_divert_fixup], [m4_divert_pop()m4_define([$0])])
+m4_define([m4_init],
+ [gl_divert_fixup()]m4_defn([m4_init])[gl_divert_fixup()])])
+
# AC_DEFUN_ONCE([NAME], VALUE)
# ----------------------------
diff --git a/src/gl/m4/absolute-header.m4 b/src/gl/m4/absolute-header.m4
new file mode 100644
index 0000000000..ce3e39e9b7
--- /dev/null
+++ b/src/gl/m4/absolute-header.m4
@@ -0,0 +1,102 @@
+# absolute-header.m4 serial 16
+dnl Copyright (C) 2006-2014 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 Derek Price.
+
+# gl_ABSOLUTE_HEADER(HEADER1 HEADER2 ...)
+# ---------------------------------------
+# Find the absolute name of a header file, testing first if the header exists.
+# If the header were sys/inttypes.h, this macro would define
+# ABSOLUTE_SYS_INTTYPES_H to the '""' quoted absolute name of sys/inttypes.h
+# in config.h
+# (e.g. '#define ABSOLUTE_SYS_INTTYPES_H "///usr/include/sys/inttypes.h"').
+# The three "///" are to pacify Sun C 5.8, which otherwise would say
+# "warning: #include of /usr/include/... may be non-portable".
+# Use '""', not '<>', so that the /// cannot be confused with a C99 comment.
+# 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.
+AC_DEFUN([gl_ABSOLUTE_HEADER],
+[AC_REQUIRE([AC_CANONICAL_HOST])
+AC_LANG_PREPROC_REQUIRE()dnl
+dnl FIXME: gl_absolute_header and ac_header_exists must be used unquoted
+dnl until we can assume autoconf 2.64 or newer.
+m4_foreach_w([gl_HEADER_NAME], [$1],
+ [AS_VAR_PUSHDEF([gl_absolute_header],
+ [gl_cv_absolute_]m4_defn([gl_HEADER_NAME]))dnl
+ AC_CACHE_CHECK([absolute name of <]m4_defn([gl_HEADER_NAME])[>],
+ m4_defn([gl_absolute_header]),
+ [AS_VAR_PUSHDEF([ac_header_exists],
+ [ac_cv_header_]m4_defn([gl_HEADER_NAME]))dnl
+ AC_CHECK_HEADERS_ONCE(m4_defn([gl_HEADER_NAME]))dnl
+ if test AS_VAR_GET(ac_header_exists) = yes; then
+ gl_ABSOLUTE_HEADER_ONE(m4_defn([gl_HEADER_NAME]))
+ fi
+ AS_VAR_POPDEF([ac_header_exists])dnl
+ ])dnl
+ AC_DEFINE_UNQUOTED(AS_TR_CPP([ABSOLUTE_]m4_defn([gl_HEADER_NAME])),
+ ["AS_VAR_GET(gl_absolute_header)"],
+ [Define this to an absolute name of <]m4_defn([gl_HEADER_NAME])[>.])
+ AS_VAR_POPDEF([gl_absolute_header])dnl
+])dnl
+])# gl_ABSOLUTE_HEADER
+
+# gl_ABSOLUTE_HEADER_ONE(HEADER)
+# ------------------------------
+# Like gl_ABSOLUTE_HEADER, except that:
+# - it assumes that the header exists,
+# - it uses the current CPPFLAGS,
+# - it does not cache the result,
+# - it is silent.
+AC_DEFUN([gl_ABSOLUTE_HEADER_ONE],
+[
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_LANG_CONFTEST([AC_LANG_SOURCE([[#include <]]m4_dquote([$1])[[>]])])
+ 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
+changequote(,)
+ case "$host_os" in
+ mingw*)
+ dnl For the sake of native Windows compilers (excluding gcc),
+ dnl treat backslash as a directory separator, like /.
+ dnl Actually, these compilers use a double-backslash as
+ dnl directory separator, inside the
+ dnl # line "filename"
+ dnl directives.
+ gl_dirsep_regex='[/\\]'
+ ;;
+ *)
+ gl_dirsep_regex='\/'
+ ;;
+ esac
+ dnl A sed expression that turns a string into a basic regular
+ dnl expression, for use within "/.../".
+ gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+ gl_header_literal_regex=`echo '$1' \
+ | sed -e "$gl_make_literal_regex_sed"`
+ gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
+ s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
+ s|^/[^/]|//&|
+ p
+ q
+ }'
+changequote([,])
+ 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_cv_absolute_]AS_TR_SH([[$1]]),
+[`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD |
+ sed -n "$gl_absolute_header_sed"`])
+])
diff --git a/src/gl/m4/alloca.m4 b/src/gl/m4/alloca.m4
index 270abd0cd9..d7bdea631f 100644
--- a/src/gl/m4/alloca.m4
+++ b/src/gl/m4/alloca.m4
@@ -1,5 +1,5 @@
# alloca.m4 serial 14
-dnl Copyright (C) 2002-2004, 2006-2007, 2009-2013 Free Software Foundation,
+dnl Copyright (C) 2002-2004, 2006-2007, 2009-2014 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,
diff --git a/src/gl/m4/bison.m4 b/src/gl/m4/bison.m4
index 3b1297ab62..c003367bcf 100644
--- a/src/gl/m4/bison.m4
+++ b/src/gl/m4/bison.m4
@@ -1,6 +1,6 @@
# serial 7
-# Copyright (C) 2002, 2005, 2009-2013 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2005, 2009-2014 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.
diff --git a/src/gl/m4/clock_time.m4 b/src/gl/m4/clock_time.m4
index 6597fb63a0..6c4a637dc6 100644
--- a/src/gl/m4/clock_time.m4
+++ b/src/gl/m4/clock_time.m4
@@ -1,5 +1,5 @@
# clock_time.m4 serial 10
-dnl Copyright (C) 2002-2006, 2009-2013 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2006, 2009-2014 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.
diff --git a/src/gl/m4/eealloc.m4 b/src/gl/m4/eealloc.m4
index c640ec1299..8a51fe7c55 100644
--- a/src/gl/m4/eealloc.m4
+++ b/src/gl/m4/eealloc.m4
@@ -1,5 +1,5 @@
# eealloc.m4 serial 3
-dnl Copyright (C) 2003, 2009-2013 Free Software Foundation, Inc.
+dnl Copyright (C) 2003, 2009-2014 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.
diff --git a/src/gl/m4/environ.m4 b/src/gl/m4/environ.m4
index 593a33ed42..cfabe46f56 100644
--- a/src/gl/m4/environ.m4
+++ b/src/gl/m4/environ.m4
@@ -1,5 +1,5 @@
# environ.m4 serial 6
-dnl Copyright (C) 2001-2004, 2006-2013 Free Software Foundation, Inc.
+dnl Copyright (C) 2001-2004, 2006-2014 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.
diff --git a/src/gl/m4/errno_h.m4 b/src/gl/m4/errno_h.m4
index c813ea5835..4ee9e6a145 100644
--- a/src/gl/m4/errno_h.m4
+++ b/src/gl/m4/errno_h.m4
@@ -1,5 +1,5 @@
# errno_h.m4 serial 12
-dnl Copyright (C) 2004, 2006, 2008-2013 Free Software Foundation, Inc.
+dnl Copyright (C) 2004, 2006, 2008-2014 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.
diff --git a/src/gl/m4/error.m4 b/src/gl/m4/error.m4
index 29e6fdc9c2..f08ae50f3b 100644
--- a/src/gl/m4/error.m4
+++ b/src/gl/m4/error.m4
@@ -1,6 +1,6 @@
#serial 14
-# Copyright (C) 1996-1998, 2001-2004, 2009-2013 Free Software Foundation, Inc.
+# Copyright (C) 1996-1998, 2001-2004, 2009-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
diff --git a/src/gl/m4/extensions.m4 b/src/gl/m4/extensions.m4
index e30f12206c..37f55ca3d1 100644
--- a/src/gl/m4/extensions.m4
+++ b/src/gl/m4/extensions.m4
@@ -1,7 +1,7 @@
# serial 13 -*- Autoconf -*-
# Enable extensions on systems that normally disable them.
-# Copyright (C) 2003, 2006-2013 Free Software Foundation, Inc.
+# Copyright (C) 2003, 2006-2014 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.
diff --git a/src/gl/m4/extern-inline.m4 b/src/gl/m4/extern-inline.m4
index 9f93c29e4d..240150efbc 100644
--- a/src/gl/m4/extern-inline.m4
+++ b/src/gl/m4/extern-inline.m4
@@ -1,6 +1,6 @@
dnl 'extern inline' a la ISO C99.
-dnl Copyright 2012-2013 Free Software Foundation, Inc.
+dnl Copyright 2012-2014 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.
diff --git a/src/gl/m4/gettime.m4 b/src/gl/m4/gettime.m4
index dc100de5e4..c5ec264391 100644
--- a/src/gl/m4/gettime.m4
+++ b/src/gl/m4/gettime.m4
@@ -1,5 +1,5 @@
# gettime.m4 serial 8
-dnl Copyright (C) 2002, 2004-2006, 2009-2013 Free Software Foundation, Inc.
+dnl Copyright (C) 2002, 2004-2006, 2009-2014 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.
diff --git a/src/gl/m4/gettimeofday.m4 b/src/gl/m4/gettimeofday.m4
index 3c05e59f06..1c2d66ee26 100644
--- a/src/gl/m4/gettimeofday.m4
+++ b/src/gl/m4/gettimeofday.m4
@@ -1,6 +1,6 @@
-# serial 20
+# serial 21
-# Copyright (C) 2001-2003, 2005, 2007, 2009-2013 Free Software Foundation, Inc.
+# Copyright (C) 2001-2003, 2005, 2007, 2009-2014 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.
@@ -127,10 +127,8 @@ AC_DEFUN([gl_FUNC_GETTIMEOFDAY_CLOBBER],
])
AC_DEFUN([gl_GETTIMEOFDAY_REPLACE_LOCALTIME], [
- AC_DEFINE([gmtime], [rpl_gmtime],
- [Define to rpl_gmtime if the replacement function should be used.])
- AC_DEFINE([localtime], [rpl_localtime],
- [Define to rpl_localtime if the replacement function should be used.])
+ REPLACE_GMTIME=1
+ REPLACE_LOCALTIME=1
])
# Prerequisites of lib/gettimeofday.c.
diff --git a/src/gl/m4/gnulib-cache.m4 b/src/gl/m4/gnulib-cache.m4
index a16c7da91f..afa2249d19 100644
--- a/src/gl/m4/gnulib-cache.m4
+++ b/src/gl/m4/gnulib-cache.m4
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2013 Free Software Foundation, Inc.
+# Copyright (C) 2002-2014 Free Software Foundation, Inc.
#
# This file is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/src/gl/m4/gnulib-common.m4 b/src/gl/m4/gnulib-common.m4
index 0ae5a9ec66..35f6195204 100644
--- a/src/gl/m4/gnulib-common.m4
+++ b/src/gl/m4/gnulib-common.m4
@@ -1,5 +1,5 @@
-# gnulib-common.m4 serial 33
-dnl Copyright (C) 2007-2013 Free Software Foundation, Inc.
+# gnulib-common.m4 serial 35
+dnl Copyright (C) 2007-2014 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.
@@ -49,6 +49,16 @@ AC_DEFUN([gl_COMMON_BODY], [
is a misnomer outside of parameter lists. */
#define _UNUSED_PARAMETER_ _GL_UNUSED
+/* gcc supports the "unused" attribute on possibly unused labels, and
+ g++ has since version 4.5. Note to support C++ as well as C,
+ _GL_UNUSED_LABEL should be used with a trailing ; */
+#if !defined __cplusplus || __GNUC__ > 4 \
+ || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)
+# define _GL_UNUSED_LABEL _GL_UNUSED
+#else
+# define _GL_UNUSED_LABEL
+#endif
+
/* The __pure__ attribute was added in gcc 2.96. */
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
@@ -375,3 +385,63 @@ AC_DEFUN([gl_CACHE_VAL_SILENT],
AC_CACHE_VAL([$1], [$2])
as_echo_n="$saved_as_echo_n"
])
+
+# AS_VAR_COPY was added in autoconf 2.63b
+m4_define_default([AS_VAR_COPY],
+[AS_LITERAL_IF([$1[]$2], [$1=$$2], [eval $1=\$$2])])
+
+# AC_PROG_SED was added in autoconf 2.59b
+m4_ifndef([AC_PROG_SED],
+[AC_DEFUN([AC_PROG_SED],
+[AC_CACHE_CHECK([for a sed that does not truncate output], ac_cv_path_SED,
+ [dnl ac_script should not contain more than 99 commands (for HP-UX sed),
+ dnl but more than about 7000 bytes, to catch a limit in Solaris 8 /usr/ucb/sed.
+ ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
+ for ac_i in 1 2 3 4 5 6 7; do
+ ac_script="$ac_script$as_nl$ac_script"
+ done
+ echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed
+ AS_UNSET([ac_script])
+ if test -z "$SED"; then
+ ac_path_SED_found=false
+ _AS_PATH_WALK([], [
+ for ac_prog in sed gsed; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
+ AS_EXECUTABLE_P(["$ac_path_SED"]) || continue
+ case `"$ac_path_SED" --version 2>&1` in
+ *GNU*) ac_cv_path_SED=$ac_path_SED ac_path_SED_found=:;;
+ *)
+ ac_count=0
+ _AS_ECHO_N([0123456789]) >conftest.in
+ while :
+ do
+ cat conftest.in conftest.in >conftest.tmp
+ mv conftest.tmp conftest.in
+ cp conftest.in conftest.nl
+ echo >> conftest.nl
+ "$ac_path_SED" -f conftest.sed <conftest.nl >conftest.out 2>/dev/null || break
+ diff conftest.out conftest.nl >/dev/null 2>&1 || break
+ ac_count=`expr $ac_count + 1`
+ if test $ac_count -gt ${ac_path_SED_max-0}; then
+ # Best so far, but keep looking for better
+ ac_cv_path_SED=$ac_path_SED
+ ac_path_SED_max=$ac_count
+ fi
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+ esac
+ $ac_path_SED_found && break 3
+ done
+ done])
+ if test -z "$ac_cv_path_SED"; then
+ AC_ERROR([no acceptable sed could be found in \$PATH])
+ fi
+ else
+ ac_cv_path_SED=$SED
+ fi
+ SED="$ac_cv_path_SED"
+ AC_SUBST([SED])dnl
+ rm -f conftest.sed
+])])])
diff --git a/src/gl/m4/gnulib-comp.m4 b/src/gl/m4/gnulib-comp.m4
index 9a35eedc3f..b8d606d4a1 100644
--- a/src/gl/m4/gnulib-comp.m4
+++ b/src/gl/m4/gnulib-comp.m4
@@ -1,5 +1,5 @@
# DO NOT EDIT! GENERATED AUTOMATICALLY!
-# Copyright (C) 2002-2013 Free Software Foundation, Inc.
+# Copyright (C) 2002-2014 Free Software Foundation, Inc.
#
# This file is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -38,6 +38,7 @@ AC_DEFUN([ggl_EARLY],
m4_pattern_allow([^gl_LIBOBJS$])dnl a variable
m4_pattern_allow([^gl_LTLIBOBJS$])dnl a variable
AC_REQUIRE([gl_PROG_AR_RANLIB])
+ # Code from module absolute-header:
# Code from module alloca-opt:
# Code from module c-ctype:
# Code from module clock-time:
@@ -69,6 +70,7 @@ AC_DEFUN([ggl_EARLY],
# Code from module stdbool:
# Code from module stddef:
# Code from module stdint:
+ # Code from module stdio:
# Code from module stdlib:
# Code from module strerror:
# Code from module strerror-override:
@@ -151,6 +153,7 @@ AC_DEFUN([ggl_INIT],
AM_STDBOOL_H
gl_STDDEF_H
gl_STDINT_H
+ gl_STDIO_H
gl_STDLIB_H
gl_FUNC_STRERROR
if test $REPLACE_STRERROR = 1; then
@@ -355,6 +358,7 @@ AC_DEFUN([ggl_FILE_LIST], [
lib/stdbool.in.h
lib/stddef.in.h
lib/stdint.in.h
+ lib/stdio.in.h
lib/stdlib.in.h
lib/strerror-override.c
lib/strerror-override.h
@@ -375,6 +379,7 @@ AC_DEFUN([ggl_FILE_LIST], [
lib/xalloc.h
lib/xmalloc.c
m4/00gnulib.m4
+ m4/absolute-header.m4
m4/alloca.m4
m4/bison.m4
m4/clock_time.m4
@@ -401,6 +406,7 @@ AC_DEFUN([ggl_FILE_LIST], [
m4/stdbool.m4
m4/stddef_h.m4
m4/stdint.m4
+ m4/stdio_h.m4
m4/stdlib_h.m4
m4/strerror.m4
m4/string_h.m4
diff --git a/src/gl/m4/gnulib-tool.m4 b/src/gl/m4/gnulib-tool.m4
index f3dea1a9f5..a588e15191 100644
--- a/src/gl/m4/gnulib-tool.m4
+++ b/src/gl/m4/gnulib-tool.m4
@@ -1,5 +1,5 @@
# gnulib-tool.m4 serial 2
-dnl Copyright (C) 2004-2005, 2009-2013 Free Software Foundation, Inc.
+dnl Copyright (C) 2004-2005, 2009-2014 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.
diff --git a/src/gl/m4/include_next.m4 b/src/gl/m4/include_next.m4
index 108d945677..69ad3dbb0f 100644
--- a/src/gl/m4/include_next.m4
+++ b/src/gl/m4/include_next.m4
@@ -1,5 +1,5 @@
# include_next.m4 serial 23
-dnl Copyright (C) 2006-2013 Free Software Foundation, Inc.
+dnl Copyright (C) 2006-2014 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.
@@ -192,56 +192,9 @@ dnl until we can assume autoconf 2.64 or newer.
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
-changequote(,)
- case "$host_os" in
- mingw*)
- dnl For the sake of native Windows compilers (excluding gcc),
- dnl treat backslash as a directory separator, like /.
- dnl Actually, these compilers use a double-backslash as
- dnl directory separator, inside the
- dnl # line "filename"
- dnl directives.
- gl_dirsep_regex='[/\\]'
- ;;
- *)
- gl_dirsep_regex='\/'
- ;;
- esac
- dnl A sed expression that turns a string into a basic regular
- dnl expression, for use within "/.../".
- gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
-changequote([,])
- gl_header_literal_regex=`echo ']m4_defn([gl_HEADER_NAME])[' \
- | sed -e "$gl_make_literal_regex_sed"`
- gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
- s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
-changequote(,)dnl
- s|^/[^/]|//&|
-changequote([,])dnl
- p
- q
- }'
- 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 "$gl_absolute_header_sed"`'"'])
+ gl_ABSOLUTE_HEADER_ONE(gl_HEADER_NAME)
+ AS_VAR_COPY([gl_header], [gl_cv_absolute_]AS_TR_SH(gl_HEADER_NAME))
+ AS_VAR_SET(gl_next_header, ['"'$gl_header'"'])
m4_if([$2], [check],
[else
AS_VAR_SET(gl_next_header, ['<'gl_HEADER_NAME'>'])
diff --git a/src/gl/m4/longlong.m4 b/src/gl/m4/longlong.m4
index 3af6ab5aa1..eefb37c455 100644
--- a/src/gl/m4/longlong.m4
+++ b/src/gl/m4/longlong.m4
@@ -1,5 +1,5 @@
# longlong.m4 serial 17
-dnl Copyright (C) 1999-2007, 2009-2013 Free Software Foundation, Inc.
+dnl Copyright (C) 1999-2007, 2009-2014 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.
diff --git a/src/gl/m4/malloca.m4 b/src/gl/m4/malloca.m4
index 791ce10d5f..dcc1a0843e 100644
--- a/src/gl/m4/malloca.m4
+++ b/src/gl/m4/malloca.m4
@@ -1,5 +1,5 @@
# malloca.m4 serial 1
-dnl Copyright (C) 2003-2004, 2006-2007, 2009-2013 Free Software Foundation,
+dnl Copyright (C) 2003-2004, 2006-2007, 2009-2014 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,
diff --git a/src/gl/m4/mktime.m4 b/src/gl/m4/mktime.m4
index faefb77009..e8d340ac09 100644
--- a/src/gl/m4/mktime.m4
+++ b/src/gl/m4/mktime.m4
@@ -1,5 +1,5 @@
# serial 25
-dnl Copyright (C) 2002-2003, 2005-2007, 2009-2013 Free Software Foundation,
+dnl Copyright (C) 2002-2003, 2005-2007, 2009-2014 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,
diff --git a/src/gl/m4/msvc-inval.m4 b/src/gl/m4/msvc-inval.m4
index 9a6a47a740..7f26087e74 100644
--- a/src/gl/m4/msvc-inval.m4
+++ b/src/gl/m4/msvc-inval.m4
@@ -1,5 +1,5 @@
# msvc-inval.m4 serial 1
-dnl Copyright (C) 2011-2013 Free Software Foundation, Inc.
+dnl Copyright (C) 2011-2014 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.
diff --git a/src/gl/m4/msvc-nothrow.m4 b/src/gl/m4/msvc-nothrow.m4
index a39618a415..9e32c171e8 100644
--- a/src/gl/m4/msvc-nothrow.m4
+++ b/src/gl/m4/msvc-nothrow.m4
@@ -1,5 +1,5 @@
# msvc-nothrow.m4 serial 1
-dnl Copyright (C) 2011-2013 Free Software Foundation, Inc.
+dnl Copyright (C) 2011-2014 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.
diff --git a/src/gl/m4/multiarch.m4 b/src/gl/m4/multiarch.m4
index 552ec7e716..2cb956dee5 100644
--- a/src/gl/m4/multiarch.m4
+++ b/src/gl/m4/multiarch.m4
@@ -1,5 +1,5 @@
# multiarch.m4 serial 7
-dnl Copyright (C) 2008-2013 Free Software Foundation, Inc.
+dnl Copyright (C) 2008-2014 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.
diff --git a/src/gl/m4/off_t.m4 b/src/gl/m4/off_t.m4
index d355d01313..f5885b34b1 100644
--- a/src/gl/m4/off_t.m4
+++ b/src/gl/m4/off_t.m4
@@ -1,5 +1,5 @@
# off_t.m4 serial 1
-dnl Copyright (C) 2012-2013 Free Software Foundation, Inc.
+dnl Copyright (C) 2012-2014 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.
diff --git a/src/gl/m4/parse-datetime.m4 b/src/gl/m4/parse-datetime.m4
index 62ce16a504..787300969c 100644
--- a/src/gl/m4/parse-datetime.m4
+++ b/src/gl/m4/parse-datetime.m4
@@ -1,5 +1,5 @@
# parse-datetime.m4 serial 21
-dnl Copyright (C) 2002-2006, 2008-2013 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2006, 2008-2014 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.
diff --git a/src/gl/m4/setenv.m4 b/src/gl/m4/setenv.m4
index cb5351a07b..0f46a7bec0 100644
--- a/src/gl/m4/setenv.m4
+++ b/src/gl/m4/setenv.m4
@@ -1,5 +1,5 @@
# setenv.m4 serial 26
-dnl Copyright (C) 2001-2004, 2006-2013 Free Software Foundation, Inc.
+dnl Copyright (C) 2001-2004, 2006-2014 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.
diff --git a/src/gl/m4/ssize_t.m4 b/src/gl/m4/ssize_t.m4
index 6338134344..fbe1d0687e 100644
--- a/src/gl/m4/ssize_t.m4
+++ b/src/gl/m4/ssize_t.m4
@@ -1,5 +1,5 @@
# ssize_t.m4 serial 5 (gettext-0.18.2)
-dnl Copyright (C) 2001-2003, 2006, 2010-2013 Free Software Foundation, Inc.
+dnl Copyright (C) 2001-2003, 2006, 2010-2014 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.
diff --git a/src/gl/m4/stdbool.m4 b/src/gl/m4/stdbool.m4
index 80d5559ab4..006ed52de5 100644
--- a/src/gl/m4/stdbool.m4
+++ b/src/gl/m4/stdbool.m4
@@ -1,6 +1,6 @@
# Check for stdbool.h that conforms to C99.
-dnl Copyright (C) 2002-2006, 2009-2013 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2006, 2009-2014 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.
diff --git a/src/gl/m4/stddef_h.m4 b/src/gl/m4/stddef_h.m4
index 5da8ab1ec4..c555e29524 100644
--- a/src/gl/m4/stddef_h.m4
+++ b/src/gl/m4/stddef_h.m4
@@ -1,6 +1,6 @@
dnl A placeholder for POSIX 2008 <stddef.h>, for platforms that have issues.
# stddef_h.m4 serial 4
-dnl Copyright (C) 2009-2013 Free Software Foundation, Inc.
+dnl Copyright (C) 2009-2014 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.
diff --git a/src/gl/m4/stdint.m4 b/src/gl/m4/stdint.m4
index 27cdcdb9a5..1981d9dbc2 100644
--- a/src/gl/m4/stdint.m4
+++ b/src/gl/m4/stdint.m4
@@ -1,5 +1,5 @@
# stdint.m4 serial 43
-dnl Copyright (C) 2001-2013 Free Software Foundation, Inc.
+dnl Copyright (C) 2001-2014 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.
diff --git a/src/gl/m4/stdio_h.m4 b/src/gl/m4/stdio_h.m4
new file mode 100644
index 0000000000..d15913a3ca
--- /dev/null
+++ b/src/gl/m4/stdio_h.m4
@@ -0,0 +1,194 @@
+# stdio_h.m4 serial 43
+dnl Copyright (C) 2007-2014 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_STDIO_H],
+[
+ AC_REQUIRE([gl_STDIO_H_DEFAULTS])
+ 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_FSCANF=1
+ gl_MODULE_INDICATOR([fscanf])
+ GNULIB_SCANF=1
+ gl_MODULE_INDICATOR([scanf])
+ GNULIB_FGETC=1
+ GNULIB_GETC=1
+ GNULIB_GETCHAR=1
+ GNULIB_FGETS=1
+ GNULIB_FREAD=1
+ dnl This ifdef is necessary to avoid an error "missing file lib/stdio-read.c"
+ dnl "expected source file, required through AC_LIBSOURCES, not found". It is
+ dnl also an optimization, to avoid performing a configure check whose result
+ dnl is not used. But it does not make the test of GNULIB_STDIO_H_NONBLOCKING
+ dnl or GNULIB_NONBLOCKING redundant.
+ m4_ifdef([gl_NONBLOCKING_IO], [
+ gl_NONBLOCKING_IO
+ if test $gl_cv_have_nonblocking != yes; then
+ REPLACE_STDIO_READ_FUNCS=1
+ AC_LIBOBJ([stdio-read])
+ fi
+ ])
+
+ dnl No need to create extra modules for these functions. Everyone who uses
+ dnl <stdio.h> likely needs them.
+ GNULIB_FPRINTF=1
+ GNULIB_PRINTF=1
+ GNULIB_VFPRINTF=1
+ GNULIB_VPRINTF=1
+ GNULIB_FPUTC=1
+ GNULIB_PUTC=1
+ GNULIB_PUTCHAR=1
+ GNULIB_FPUTS=1
+ GNULIB_PUTS=1
+ GNULIB_FWRITE=1
+ dnl This ifdef is necessary to avoid an error "missing file lib/stdio-write.c"
+ dnl "expected source file, required through AC_LIBSOURCES, not found". It is
+ dnl also an optimization, to avoid performing a configure check whose result
+ dnl is not used. But it does not make the test of GNULIB_STDIO_H_SIGPIPE or
+ dnl GNULIB_SIGPIPE redundant.
+ m4_ifdef([gl_SIGNAL_SIGPIPE], [
+ gl_SIGNAL_SIGPIPE
+ if test $gl_cv_header_signal_h_SIGPIPE != yes; then
+ REPLACE_STDIO_WRITE_FUNCS=1
+ AC_LIBOBJ([stdio-write])
+ fi
+ ])
+ dnl This ifdef is necessary to avoid an error "missing file lib/stdio-write.c"
+ dnl "expected source file, required through AC_LIBSOURCES, not found". It is
+ dnl also an optimization, to avoid performing a configure check whose result
+ dnl is not used. But it does not make the test of GNULIB_STDIO_H_NONBLOCKING
+ dnl or GNULIB_NONBLOCKING redundant.
+ m4_ifdef([gl_NONBLOCKING_IO], [
+ gl_NONBLOCKING_IO
+ if test $gl_cv_have_nonblocking != yes; then
+ REPLACE_STDIO_WRITE_FUNCS=1
+ AC_LIBOBJ([stdio-write])
+ fi
+ ])
+
+ 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 guaranteed by both C89 and C11.
+ gl_WARN_ON_USE_PREPARE([[#include <stdio.h>
+ ]], [dprintf fpurge fseeko ftello getdelim getline gets pclose popen
+ renameat snprintf tmpfile vdprintf vsnprintf])
+])
+
+AC_DEFUN([gl_STDIO_MODULE_INDICATOR],
+[
+ dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
+ AC_REQUIRE([gl_STDIO_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_STDIO_H_DEFAULTS],
+[
+ GNULIB_DPRINTF=0; AC_SUBST([GNULIB_DPRINTF])
+ GNULIB_FCLOSE=0; AC_SUBST([GNULIB_FCLOSE])
+ GNULIB_FDOPEN=0; AC_SUBST([GNULIB_FDOPEN])
+ GNULIB_FFLUSH=0; AC_SUBST([GNULIB_FFLUSH])
+ GNULIB_FGETC=0; AC_SUBST([GNULIB_FGETC])
+ GNULIB_FGETS=0; AC_SUBST([GNULIB_FGETS])
+ GNULIB_FOPEN=0; AC_SUBST([GNULIB_FOPEN])
+ GNULIB_FPRINTF=0; AC_SUBST([GNULIB_FPRINTF])
+ GNULIB_FPRINTF_POSIX=0; AC_SUBST([GNULIB_FPRINTF_POSIX])
+ GNULIB_FPURGE=0; AC_SUBST([GNULIB_FPURGE])
+ GNULIB_FPUTC=0; AC_SUBST([GNULIB_FPUTC])
+ GNULIB_FPUTS=0; AC_SUBST([GNULIB_FPUTS])
+ GNULIB_FREAD=0; AC_SUBST([GNULIB_FREAD])
+ GNULIB_FREOPEN=0; AC_SUBST([GNULIB_FREOPEN])
+ GNULIB_FSCANF=0; AC_SUBST([GNULIB_FSCANF])
+ GNULIB_FSEEK=0; AC_SUBST([GNULIB_FSEEK])
+ GNULIB_FSEEKO=0; AC_SUBST([GNULIB_FSEEKO])
+ GNULIB_FTELL=0; AC_SUBST([GNULIB_FTELL])
+ GNULIB_FTELLO=0; AC_SUBST([GNULIB_FTELLO])
+ GNULIB_FWRITE=0; AC_SUBST([GNULIB_FWRITE])
+ GNULIB_GETC=0; AC_SUBST([GNULIB_GETC])
+ GNULIB_GETCHAR=0; AC_SUBST([GNULIB_GETCHAR])
+ GNULIB_GETDELIM=0; AC_SUBST([GNULIB_GETDELIM])
+ GNULIB_GETLINE=0; AC_SUBST([GNULIB_GETLINE])
+ GNULIB_OBSTACK_PRINTF=0; AC_SUBST([GNULIB_OBSTACK_PRINTF])
+ GNULIB_OBSTACK_PRINTF_POSIX=0; AC_SUBST([GNULIB_OBSTACK_PRINTF_POSIX])
+ GNULIB_PCLOSE=0; AC_SUBST([GNULIB_PCLOSE])
+ GNULIB_PERROR=0; AC_SUBST([GNULIB_PERROR])
+ GNULIB_POPEN=0; AC_SUBST([GNULIB_POPEN])
+ GNULIB_PRINTF=0; AC_SUBST([GNULIB_PRINTF])
+ GNULIB_PRINTF_POSIX=0; AC_SUBST([GNULIB_PRINTF_POSIX])
+ GNULIB_PUTC=0; AC_SUBST([GNULIB_PUTC])
+ GNULIB_PUTCHAR=0; AC_SUBST([GNULIB_PUTCHAR])
+ GNULIB_PUTS=0; AC_SUBST([GNULIB_PUTS])
+ GNULIB_REMOVE=0; AC_SUBST([GNULIB_REMOVE])
+ GNULIB_RENAME=0; AC_SUBST([GNULIB_RENAME])
+ GNULIB_RENAMEAT=0; AC_SUBST([GNULIB_RENAMEAT])
+ GNULIB_SCANF=0; AC_SUBST([GNULIB_SCANF])
+ GNULIB_SNPRINTF=0; AC_SUBST([GNULIB_SNPRINTF])
+ GNULIB_SPRINTF_POSIX=0; AC_SUBST([GNULIB_SPRINTF_POSIX])
+ GNULIB_STDIO_H_NONBLOCKING=0; AC_SUBST([GNULIB_STDIO_H_NONBLOCKING])
+ GNULIB_STDIO_H_SIGPIPE=0; AC_SUBST([GNULIB_STDIO_H_SIGPIPE])
+ GNULIB_TMPFILE=0; AC_SUBST([GNULIB_TMPFILE])
+ GNULIB_VASPRINTF=0; AC_SUBST([GNULIB_VASPRINTF])
+ GNULIB_VFSCANF=0; AC_SUBST([GNULIB_VFSCANF])
+ GNULIB_VSCANF=0; AC_SUBST([GNULIB_VSCANF])
+ GNULIB_VDPRINTF=0; AC_SUBST([GNULIB_VDPRINTF])
+ GNULIB_VFPRINTF=0; AC_SUBST([GNULIB_VFPRINTF])
+ GNULIB_VFPRINTF_POSIX=0; AC_SUBST([GNULIB_VFPRINTF_POSIX])
+ GNULIB_VPRINTF=0; AC_SUBST([GNULIB_VPRINTF])
+ GNULIB_VPRINTF_POSIX=0; AC_SUBST([GNULIB_VPRINTF_POSIX])
+ GNULIB_VSNPRINTF=0; AC_SUBST([GNULIB_VSNPRINTF])
+ GNULIB_VSPRINTF_POSIX=0; AC_SUBST([GNULIB_VSPRINTF_POSIX])
+ dnl Assume proper GNU behavior unless another module says otherwise.
+ HAVE_DECL_FPURGE=1; AC_SUBST([HAVE_DECL_FPURGE])
+ HAVE_DECL_FSEEKO=1; AC_SUBST([HAVE_DECL_FSEEKO])
+ HAVE_DECL_FTELLO=1; AC_SUBST([HAVE_DECL_FTELLO])
+ HAVE_DECL_GETDELIM=1; AC_SUBST([HAVE_DECL_GETDELIM])
+ HAVE_DECL_GETLINE=1; AC_SUBST([HAVE_DECL_GETLINE])
+ HAVE_DECL_OBSTACK_PRINTF=1; AC_SUBST([HAVE_DECL_OBSTACK_PRINTF])
+ HAVE_DECL_SNPRINTF=1; AC_SUBST([HAVE_DECL_SNPRINTF])
+ HAVE_DECL_VSNPRINTF=1; AC_SUBST([HAVE_DECL_VSNPRINTF])
+ HAVE_DPRINTF=1; AC_SUBST([HAVE_DPRINTF])
+ HAVE_FSEEKO=1; AC_SUBST([HAVE_FSEEKO])
+ HAVE_FTELLO=1; AC_SUBST([HAVE_FTELLO])
+ HAVE_PCLOSE=1; AC_SUBST([HAVE_PCLOSE])
+ HAVE_POPEN=1; AC_SUBST([HAVE_POPEN])
+ HAVE_RENAMEAT=1; AC_SUBST([HAVE_RENAMEAT])
+ HAVE_VASPRINTF=1; AC_SUBST([HAVE_VASPRINTF])
+ HAVE_VDPRINTF=1; AC_SUBST([HAVE_VDPRINTF])
+ REPLACE_DPRINTF=0; AC_SUBST([REPLACE_DPRINTF])
+ REPLACE_FCLOSE=0; AC_SUBST([REPLACE_FCLOSE])
+ REPLACE_FDOPEN=0; AC_SUBST([REPLACE_FDOPEN])
+ REPLACE_FFLUSH=0; AC_SUBST([REPLACE_FFLUSH])
+ REPLACE_FOPEN=0; AC_SUBST([REPLACE_FOPEN])
+ REPLACE_FPRINTF=0; AC_SUBST([REPLACE_FPRINTF])
+ REPLACE_FPURGE=0; AC_SUBST([REPLACE_FPURGE])
+ REPLACE_FREOPEN=0; AC_SUBST([REPLACE_FREOPEN])
+ REPLACE_FSEEK=0; AC_SUBST([REPLACE_FSEEK])
+ REPLACE_FSEEKO=0; AC_SUBST([REPLACE_FSEEKO])
+ REPLACE_FTELL=0; AC_SUBST([REPLACE_FTELL])
+ REPLACE_FTELLO=0; AC_SUBST([REPLACE_FTELLO])
+ REPLACE_GETDELIM=0; AC_SUBST([REPLACE_GETDELIM])
+ REPLACE_GETLINE=0; AC_SUBST([REPLACE_GETLINE])
+ REPLACE_OBSTACK_PRINTF=0; AC_SUBST([REPLACE_OBSTACK_PRINTF])
+ REPLACE_PERROR=0; AC_SUBST([REPLACE_PERROR])
+ REPLACE_POPEN=0; AC_SUBST([REPLACE_POPEN])
+ REPLACE_PRINTF=0; AC_SUBST([REPLACE_PRINTF])
+ REPLACE_REMOVE=0; AC_SUBST([REPLACE_REMOVE])
+ REPLACE_RENAME=0; AC_SUBST([REPLACE_RENAME])
+ REPLACE_RENAMEAT=0; AC_SUBST([REPLACE_RENAMEAT])
+ REPLACE_SNPRINTF=0; AC_SUBST([REPLACE_SNPRINTF])
+ REPLACE_SPRINTF=0; AC_SUBST([REPLACE_SPRINTF])
+ REPLACE_STDIO_READ_FUNCS=0; AC_SUBST([REPLACE_STDIO_READ_FUNCS])
+ REPLACE_STDIO_WRITE_FUNCS=0; AC_SUBST([REPLACE_STDIO_WRITE_FUNCS])
+ REPLACE_TMPFILE=0; AC_SUBST([REPLACE_TMPFILE])
+ REPLACE_VASPRINTF=0; AC_SUBST([REPLACE_VASPRINTF])
+ REPLACE_VDPRINTF=0; AC_SUBST([REPLACE_VDPRINTF])
+ REPLACE_VFPRINTF=0; AC_SUBST([REPLACE_VFPRINTF])
+ REPLACE_VPRINTF=0; AC_SUBST([REPLACE_VPRINTF])
+ REPLACE_VSNPRINTF=0; AC_SUBST([REPLACE_VSNPRINTF])
+ REPLACE_VSPRINTF=0; AC_SUBST([REPLACE_VSPRINTF])
+])
diff --git a/src/gl/m4/stdlib_h.m4 b/src/gl/m4/stdlib_h.m4
index 2027ab3c1d..03b448b94f 100644
--- a/src/gl/m4/stdlib_h.m4
+++ b/src/gl/m4/stdlib_h.m4
@@ -1,5 +1,5 @@
# stdlib_h.m4 serial 42
-dnl Copyright (C) 2007-2013 Free Software Foundation, Inc.
+dnl Copyright (C) 2007-2014 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.
diff --git a/src/gl/m4/strerror.m4 b/src/gl/m4/strerror.m4
index 3989844b22..0763fe3b4d 100644
--- a/src/gl/m4/strerror.m4
+++ b/src/gl/m4/strerror.m4
@@ -1,5 +1,5 @@
# strerror.m4 serial 17
-dnl Copyright (C) 2002, 2007-2013 Free Software Foundation, Inc.
+dnl Copyright (C) 2002, 2007-2014 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.
diff --git a/src/gl/m4/string_h.m4 b/src/gl/m4/string_h.m4
index cc5fbbb32f..64e683f9dc 100644
--- a/src/gl/m4/string_h.m4
+++ b/src/gl/m4/string_h.m4
@@ -1,6 +1,6 @@
# Configure a GNU-like replacement for <string.h>.
-# Copyright (C) 2007-2013 Free Software Foundation, Inc.
+# Copyright (C) 2007-2014 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.
diff --git a/src/gl/m4/sys_socket_h.m4 b/src/gl/m4/sys_socket_h.m4
index 94863776df..114d828172 100644
--- a/src/gl/m4/sys_socket_h.m4
+++ b/src/gl/m4/sys_socket_h.m4
@@ -1,5 +1,5 @@
# sys_socket_h.m4 serial 23
-dnl Copyright (C) 2005-2013 Free Software Foundation, Inc.
+dnl Copyright (C) 2005-2014 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.
diff --git a/src/gl/m4/sys_time_h.m4 b/src/gl/m4/sys_time_h.m4
index 0ac71ac5e9..5c79300f8e 100644
--- a/src/gl/m4/sys_time_h.m4
+++ b/src/gl/m4/sys_time_h.m4
@@ -1,7 +1,7 @@
# Configure a replacement for <sys/time.h>.
# serial 8
-# Copyright (C) 2007, 2009-2013 Free Software Foundation, Inc.
+# Copyright (C) 2007, 2009-2014 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.
diff --git a/src/gl/m4/sys_types_h.m4 b/src/gl/m4/sys_types_h.m4
index d15c1b3709..9748905b59 100644
--- a/src/gl/m4/sys_types_h.m4
+++ b/src/gl/m4/sys_types_h.m4
@@ -1,5 +1,5 @@
# sys_types_h.m4 serial 5
-dnl Copyright (C) 2011-2013 Free Software Foundation, Inc.
+dnl Copyright (C) 2011-2014 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.
diff --git a/src/gl/m4/time_h.m4 b/src/gl/m4/time_h.m4
index 3b83900534..9852778f9a 100644
--- a/src/gl/m4/time_h.m4
+++ b/src/gl/m4/time_h.m4
@@ -1,8 +1,8 @@
# Configure a more-standard replacement for <time.h>.
-# Copyright (C) 2000-2001, 2003-2007, 2009-2013 Free Software Foundation, Inc.
+# Copyright (C) 2000-2001, 2003-2007, 2009-2014 Free Software Foundation, Inc.
-# serial 7
+# serial 8
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -106,4 +106,13 @@ AC_DEFUN([gl_HEADER_TIME_H_DEFAULTS],
REPLACE_MKTIME=GNULIB_PORTCHECK; AC_SUBST([REPLACE_MKTIME])
REPLACE_NANOSLEEP=GNULIB_PORTCHECK; AC_SUBST([REPLACE_NANOSLEEP])
REPLACE_TIMEGM=GNULIB_PORTCHECK; AC_SUBST([REPLACE_TIMEGM])
+
+ dnl Hack so that the time module doesn't depend on the sys_time module.
+ dnl First, default GNULIB_GETTIMEOFDAY to 0 if sys_time is absent.
+ : ${GNULIB_GETTIMEOFDAY=0}; AC_SUBST([GNULIB_GETTIMEOFDAY])
+ dnl Second, it's OK to not use GNULIB_PORTCHECK for REPLACE_GMTIME
+ dnl and REPLACE_LOCALTIME, as portability to Solaris 2.6 and earlier
+ dnl is no longer a big deal.
+ REPLACE_GMTIME=0; AC_SUBST([REPLACE_GMTIME])
+ REPLACE_LOCALTIME=0; AC_SUBST([REPLACE_LOCALTIME])
])
diff --git a/src/gl/m4/time_r.m4 b/src/gl/m4/time_r.m4
index c388a8312f..7e15600f7b 100644
--- a/src/gl/m4/time_r.m4
+++ b/src/gl/m4/time_r.m4
@@ -1,6 +1,6 @@
dnl Reentrant time functions: localtime_r, gmtime_r.
-dnl Copyright (C) 2003, 2006-2013 Free Software Foundation, Inc.
+dnl Copyright (C) 2003, 2006-2014 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.
diff --git a/src/gl/m4/timespec.m4 b/src/gl/m4/timespec.m4
index 399404b59b..2ce654fe80 100644
--- a/src/gl/m4/timespec.m4
+++ b/src/gl/m4/timespec.m4
@@ -1,6 +1,6 @@
#serial 15
-# Copyright (C) 2000-2001, 2003-2007, 2009-2013 Free Software Foundation, Inc.
+# Copyright (C) 2000-2001, 2003-2007, 2009-2014 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
diff --git a/src/gl/m4/tm_gmtoff.m4 b/src/gl/m4/tm_gmtoff.m4
index 55e7ea325a..486351b477 100644
--- a/src/gl/m4/tm_gmtoff.m4
+++ b/src/gl/m4/tm_gmtoff.m4
@@ -1,5 +1,5 @@
# tm_gmtoff.m4 serial 3
-dnl Copyright (C) 2002, 2009-2013 Free Software Foundation, Inc.
+dnl Copyright (C) 2002, 2009-2014 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.
diff --git a/src/gl/m4/unistd_h.m4 b/src/gl/m4/unistd_h.m4
index 4231578cf2..1fa197e694 100644
--- a/src/gl/m4/unistd_h.m4
+++ b/src/gl/m4/unistd_h.m4
@@ -1,5 +1,5 @@
# unistd_h.m4 serial 67
-dnl Copyright (C) 2006-2013 Free Software Foundation, Inc.
+dnl Copyright (C) 2006-2014 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.
diff --git a/src/gl/m4/warn-on-use.m4 b/src/gl/m4/warn-on-use.m4
index e43beebd9a..cc690f8e2c 100644
--- a/src/gl/m4/warn-on-use.m4
+++ b/src/gl/m4/warn-on-use.m4
@@ -1,5 +1,5 @@
# warn-on-use.m4 serial 5
-dnl Copyright (C) 2010-2013 Free Software Foundation, Inc.
+dnl Copyright (C) 2010-2014 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.
diff --git a/src/gl/m4/wchar_t.m4 b/src/gl/m4/wchar_t.m4
index e1e1e699d6..839a04c17c 100644
--- a/src/gl/m4/wchar_t.m4
+++ b/src/gl/m4/wchar_t.m4
@@ -1,5 +1,5 @@
# wchar_t.m4 serial 4 (gettext-0.18.2)
-dnl Copyright (C) 2002-2003, 2008-2013 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2003, 2008-2014 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.
diff --git a/src/gl/m4/xalloc.m4 b/src/gl/m4/xalloc.m4
index 64ca701418..b6a2257bef 100644
--- a/src/gl/m4/xalloc.m4
+++ b/src/gl/m4/xalloc.m4
@@ -1,5 +1,5 @@
# xalloc.m4 serial 18
-dnl Copyright (C) 2002-2006, 2009-2013 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2006, 2009-2014 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.
diff --git a/src/gl/malloca.c b/src/gl/malloca.c
index 311be569bc..370551c534 100644
--- a/src/gl/malloca.c
+++ b/src/gl/malloca.c
@@ -1,5 +1,5 @@
/* Safe automatic memory allocation.
- Copyright (C) 2003, 2006-2007, 2009-2013 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2006-2007, 2009-2014 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2003.
This program is free software; you can redistribute it and/or modify
diff --git a/src/gl/malloca.h b/src/gl/malloca.h
index 6fbe45eab6..5071e46f9e 100644
--- a/src/gl/malloca.h
+++ b/src/gl/malloca.h
@@ -1,5 +1,5 @@
/* Safe automatic memory allocation.
- Copyright (C) 2003-2007, 2009-2013 Free Software Foundation, Inc.
+ Copyright (C) 2003-2007, 2009-2014 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2003.
This program is free software; you can redistribute it and/or modify
diff --git a/src/gl/mktime.c b/src/gl/mktime.c
index e660a23c3b..48b3a40f9c 100644
--- a/src/gl/mktime.c
+++ b/src/gl/mktime.c
@@ -1,5 +1,5 @@
/* Convert a 'struct tm' to a time_t value.
- Copyright (C) 1993-2013 Free Software Foundation, Inc.
+ Copyright (C) 1993-2014 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Paul Eggert <eggert@twinsun.com>.
@@ -38,7 +38,7 @@
#include <string.h> /* For the real memcpy prototype. */
-#if DEBUG
+#if defined DEBUG && DEBUG
# include <stdio.h>
# include <stdlib.h>
/* Make it work even if the system's libc has its own mktime routine. */
@@ -600,7 +600,7 @@ libc_hidden_def (mktime)
libc_hidden_weak (timelocal)
#endif
-#if DEBUG
+#if defined DEBUG && DEBUG
static int
not_equal_tm (const struct tm *a, const struct tm *b)
diff --git a/src/gl/msvc-inval.c b/src/gl/msvc-inval.c
index 396031e4c2..f83827fb4d 100644
--- a/src/gl/msvc-inval.c
+++ b/src/gl/msvc-inval.c
@@ -1,5 +1,5 @@
/* Invalid parameter handler for MSVC runtime libraries.
- Copyright (C) 2011-2013 Free Software Foundation, Inc.
+ Copyright (C) 2011-2014 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
diff --git a/src/gl/msvc-inval.h b/src/gl/msvc-inval.h
index dcb0353dcd..a0ef540fc5 100644
--- a/src/gl/msvc-inval.h
+++ b/src/gl/msvc-inval.h
@@ -1,5 +1,5 @@
/* Invalid parameter handler for MSVC runtime libraries.
- Copyright (C) 2011-2013 Free Software Foundation, Inc.
+ Copyright (C) 2011-2014 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
diff --git a/src/gl/msvc-nothrow.c b/src/gl/msvc-nothrow.c
index 8d65472a82..b1e5f0c97f 100644
--- a/src/gl/msvc-nothrow.c
+++ b/src/gl/msvc-nothrow.c
@@ -1,6 +1,6 @@
/* Wrappers that don't throw invalid parameter notifications
with MSVC runtime libraries.
- Copyright (C) 2011-2013 Free Software Foundation, Inc.
+ Copyright (C) 2011-2014 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
diff --git a/src/gl/msvc-nothrow.h b/src/gl/msvc-nothrow.h
index 5f521813df..0d4dea584b 100644
--- a/src/gl/msvc-nothrow.h
+++ b/src/gl/msvc-nothrow.h
@@ -1,6 +1,6 @@
/* Wrappers that don't throw invalid parameter notifications
with MSVC runtime libraries.
- Copyright (C) 2011-2013 Free Software Foundation, Inc.
+ Copyright (C) 2011-2014 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
diff --git a/src/gl/parse-datetime.h b/src/gl/parse-datetime.h
index 80e35919ff..9c9bb93f70 100644
--- a/src/gl/parse-datetime.h
+++ b/src/gl/parse-datetime.h
@@ -1,6 +1,6 @@
/* Parse a string into an internal time stamp.
- Copyright (C) 1995, 1997-1998, 2003-2004, 2007, 2009-2013 Free Software
+ Copyright (C) 1995, 1997-1998, 2003-2004, 2007, 2009-2014 Free Software
Foundation, Inc.
This program is free software: you can redistribute it and/or modify
diff --git a/src/gl/parse-datetime.y b/src/gl/parse-datetime.y
index 4dce7fa644..0ba0a5253f 100644
--- a/src/gl/parse-datetime.y
+++ b/src/gl/parse-datetime.y
@@ -1,7 +1,7 @@
%{
/* Parse a string into an internal time stamp.
- Copyright (C) 1999-2000, 2002-2013 Free Software Foundation, Inc.
+ Copyright (C) 1999-2000, 2002-2014 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
@@ -1303,8 +1303,6 @@ parse_datetime (struct timespec *result, char const *p,
char tz1buf[TZBUFSIZE];
bool large_tz = TZBUFSIZE < tzsize;
bool setenv_ok;
- /* Free tz0, in case this is the 2nd or subsequent time through. */
- free (tz0);
tz0 = get_tz (tz0buf);
z = tz1 = large_tz ? xmalloc (tzsize) : tz1buf;
for (s = tzbase; *s != '"'; s++)
@@ -1316,7 +1314,12 @@ parse_datetime (struct timespec *result, char const *p,
if (!setenv_ok)
goto fail;
tz_was_altered = true;
+
p = s + 1;
+ while (c = *p, c_isspace (c))
+ p++;
+
+ break;
}
}
diff --git a/src/gl/progname.c b/src/gl/progname.c
index 0c195e521a..2919be999a 100644
--- a/src/gl/progname.c
+++ b/src/gl/progname.c
@@ -1,5 +1,5 @@
/* Program name management.
- Copyright (C) 2001-2003, 2005-2013 Free Software Foundation, Inc.
+ Copyright (C) 2001-2003, 2005-2014 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2001.
This program is free software: you can redistribute it and/or modify
diff --git a/src/gl/progname.h b/src/gl/progname.h
index b4f3c2778a..fa15871df5 100644
--- a/src/gl/progname.h
+++ b/src/gl/progname.h
@@ -1,5 +1,5 @@
/* Program name management.
- Copyright (C) 2001-2004, 2006, 2009-2013 Free Software Foundation, Inc.
+ Copyright (C) 2001-2004, 2006, 2009-2014 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2001.
This program is free software: you can redistribute it and/or modify
diff --git a/src/gl/setenv.c b/src/gl/setenv.c
index 995a0f26a1..06791a9059 100644
--- a/src/gl/setenv.c
+++ b/src/gl/setenv.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 1995-2003, 2005-2013 Free Software Foundation, Inc.
+/* Copyright (C) 1992, 1995-2003, 2005-2014 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
diff --git a/src/gl/stdbool.in.h b/src/gl/stdbool.in.h
index 7c1577277f..651e8dffdb 100644
--- a/src/gl/stdbool.in.h
+++ b/src/gl/stdbool.in.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2003, 2006-2013 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2003, 2006-2014 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
diff --git a/src/gl/stddef.in.h b/src/gl/stddef.in.h
index 40f0536aae..f5c0e05655 100644
--- a/src/gl/stddef.in.h
+++ b/src/gl/stddef.in.h
@@ -1,6 +1,6 @@
/* A substitute for POSIX 2008 <stddef.h>, for platforms that have issues.
- Copyright (C) 2009-2013 Free Software Foundation, Inc.
+ Copyright (C) 2009-2014 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
diff --git a/src/gl/stdint.in.h b/src/gl/stdint.in.h
index f0b5bbd717..247f0d8961 100644
--- a/src/gl/stdint.in.h
+++ b/src/gl/stdint.in.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2002, 2004-2013 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2002, 2004-2014 Free Software Foundation, Inc.
Written by Paul Eggert, Bruno Haible, Sam Steingold, Peter Burwood.
This file is part of gnulib.
diff --git a/src/gl/stdio.in.h b/src/gl/stdio.in.h
new file mode 100644
index 0000000000..1e1fe84c77
--- /dev/null
+++ b/src/gl/stdio.in.h
@@ -0,0 +1,1353 @@
+/* A GNU-like <stdio.h>.
+
+ Copyright (C) 2004, 2007-2014 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
+ the Free Software Foundation; either version 3, 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 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/>. */
+
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+@PRAGMA_COLUMNS@
+
+#if defined __need_FILE || defined __need___FILE || defined _GL_ALREADY_INCLUDING_STDIO_H
+/* Special invocation convention:
+ - Inside glibc header files.
+ - On OSF/1 5.1 we have a sequence of nested includes
+ <stdio.h> -> <getopt.h> -> <ctype.h> -> <sys/localedef.h> ->
+ <sys/lc_core.h> -> <nl_types.h> -> <mesg.h> -> <stdio.h>.
+ In this situation, the functions are not yet declared, therefore we cannot
+ provide the C++ aliases. */
+
+#@INCLUDE_NEXT@ @NEXT_STDIO_H@
+
+#else
+/* Normal invocation convention. */
+
+#ifndef _@GUARD_PREFIX@_STDIO_H
+
+#define _GL_ALREADY_INCLUDING_STDIO_H
+
+/* The include_next requires a split double-inclusion guard. */
+#@INCLUDE_NEXT@ @NEXT_STDIO_H@
+
+#undef _GL_ALREADY_INCLUDING_STDIO_H
+
+#ifndef _@GUARD_PREFIX@_STDIO_H
+#define _@GUARD_PREFIX@_STDIO_H
+
+/* Get va_list. Needed on many systems, including glibc 2.8. */
+#include <stdarg.h>
+
+#include <stddef.h>
+
+/* Get off_t and ssize_t. Needed on many systems, including glibc 2.8
+ and eglibc 2.11.2.
+ May also define off_t to a 64-bit type on native Windows. */
+#include <sys/types.h>
+
+/* 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 _GL_ATTRIBUTE_FORMAT only if these are supported too, because
+ gnulib and libintl do '#define printf __printf__' when they override
+ the 'printf' function. */
+#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
+# define _GL_ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec))
+#else
+# define _GL_ATTRIBUTE_FORMAT(spec) /* empty */
+#endif
+
+/* _GL_ATTRIBUTE_FORMAT_PRINTF
+ indicates to GCC that the function takes a format string and arguments,
+ where the format string directives are the ones standardized by ISO C99
+ and POSIX. */
+#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)
+# define _GL_ATTRIBUTE_FORMAT_PRINTF(formatstring_parameter, first_argument) \
+ _GL_ATTRIBUTE_FORMAT ((__gnu_printf__, formatstring_parameter, first_argument))
+#else
+# define _GL_ATTRIBUTE_FORMAT_PRINTF(formatstring_parameter, first_argument) \
+ _GL_ATTRIBUTE_FORMAT ((__printf__, formatstring_parameter, first_argument))
+#endif
+
+/* _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM is like _GL_ATTRIBUTE_FORMAT_PRINTF,
+ except that it indicates to GCC that the supported format string directives
+ are the ones of the system printf(), rather than the ones standardized by
+ ISO C99 and POSIX. */
+#define _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM(formatstring_parameter, first_argument) \
+ _GL_ATTRIBUTE_FORMAT ((__printf__, formatstring_parameter, first_argument))
+
+/* _GL_ATTRIBUTE_FORMAT_SCANF
+ indicates to GCC that the function takes a format string and arguments,
+ where the format string directives are the ones standardized by ISO C99
+ and POSIX. */
+#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)
+# define _GL_ATTRIBUTE_FORMAT_SCANF(formatstring_parameter, first_argument) \
+ _GL_ATTRIBUTE_FORMAT ((__gnu_scanf__, formatstring_parameter, first_argument))
+#else
+# define _GL_ATTRIBUTE_FORMAT_SCANF(formatstring_parameter, first_argument) \
+ _GL_ATTRIBUTE_FORMAT ((__scanf__, formatstring_parameter, first_argument))
+#endif
+
+/* _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM is like _GL_ATTRIBUTE_FORMAT_SCANF,
+ except that it indicates to GCC that the supported format string directives
+ are the ones of the system scanf(), rather than the ones standardized by
+ ISO C99 and POSIX. */
+#define _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM(formatstring_parameter, first_argument) \
+ _GL_ATTRIBUTE_FORMAT ((__scanf__, 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. */
+#if (@GNULIB_RENAMEAT@ || defined GNULIB_POSIXCHECK) && defined __sun \
+ && ! defined __GLIBC__
+# include <unistd.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. */
+
+/* Macros for stringification. */
+#define _GL_STDIO_STRINGIZE(token) #token
+#define _GL_STDIO_MACROEXPAND_AND_STRINGIZE(token) _GL_STDIO_STRINGIZE(token)
+
+/* When also using extern inline, suppress the use of static inline in
+ standard headers of problematic Apple configurations, as Libc at
+ least through Libc-825.26 (2013-04-09) mishandles it; see, e.g.,
+ <http://lists.gnu.org/archive/html/bug-gnulib/2012-12/msg00023.html>.
+ Perhaps Apple will fix this some day. */
+#if (defined _GL_EXTERN_INLINE_IN_USE && defined __APPLE__ \
+ && defined __GNUC__ && defined __STDC__)
+# undef putc_unlocked
+#endif
+
+#if @GNULIB_DPRINTF@
+# if @REPLACE_DPRINTF@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define dprintf rpl_dprintf
+# endif
+_GL_FUNCDECL_RPL (dprintf, int, (int fd, const char *format, ...)
+ _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_ATTRIBUTE_FORMAT_PRINTF (2, 3)
+ _GL_ARG_NONNULL ((2)));
+# endif
+_GL_CXXALIAS_SYS (dprintf, int, (int fd, const char *format, ...));
+# endif
+_GL_CXXALIASWARN (dprintf);
+#elif defined GNULIB_POSIXCHECK
+# undef dprintf
+# if HAVE_RAW_DECL_DPRINTF
+_GL_WARN_ON_USE (dprintf, "dprintf is unportable - "
+ "use gnulib module dprintf for portability");
+# endif
+#endif
+
+#if @GNULIB_FCLOSE@
+/* Close STREAM and its underlying file descriptor. */
+# if @REPLACE_FCLOSE@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define fclose rpl_fclose
+# endif
+_GL_FUNCDECL_RPL (fclose, int, (FILE *stream) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (fclose, int, (FILE *stream));
+# else
+_GL_CXXALIAS_SYS (fclose, int, (FILE *stream));
+# endif
+_GL_CXXALIASWARN (fclose);
+#elif defined GNULIB_POSIXCHECK
+# undef fclose
+/* Assume fclose is always declared. */
+_GL_WARN_ON_USE (fclose, "fclose is not always POSIX compliant - "
+ "use gnulib module fclose for portable POSIX compliance");
+#endif
+
+#if @GNULIB_FDOPEN@
+# if @REPLACE_FDOPEN@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef fdopen
+# define fdopen rpl_fdopen
+# endif
+_GL_FUNCDECL_RPL (fdopen, FILE *, (int fd, const char *mode)
+ _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (fdopen, FILE *, (int fd, const char *mode));
+# else
+_GL_CXXALIAS_SYS (fdopen, FILE *, (int fd, const char *mode));
+# endif
+_GL_CXXALIASWARN (fdopen);
+#elif defined GNULIB_POSIXCHECK
+# undef fdopen
+/* Assume fdopen is always declared. */
+_GL_WARN_ON_USE (fdopen, "fdopen on native Windows platforms is not POSIX compliant - "
+ "use gnulib module fdopen for portability");
+#endif
+
+#if @GNULIB_FFLUSH@
+/* Flush all pending data on STREAM according to POSIX rules. Both
+ output and seekable input streams are supported.
+ Note! LOSS OF DATA can occur if fflush is applied on an input stream
+ that is _not_seekable_ or on an update stream that is _not_seekable_
+ and in which the most recent operation was input. Seekability can
+ be tested with lseek(fileno(fp),0,SEEK_CUR). */
+# if @REPLACE_FFLUSH@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define fflush rpl_fflush
+# endif
+_GL_FUNCDECL_RPL (fflush, int, (FILE *gl_stream));
+_GL_CXXALIAS_RPL (fflush, int, (FILE *gl_stream));
+# else
+_GL_CXXALIAS_SYS (fflush, int, (FILE *gl_stream));
+# endif
+_GL_CXXALIASWARN (fflush);
+#elif defined GNULIB_POSIXCHECK
+# undef fflush
+/* Assume fflush is always declared. */
+_GL_WARN_ON_USE (fflush, "fflush is not always POSIX compliant - "
+ "use gnulib module fflush for portable POSIX compliance");
+#endif
+
+#if @GNULIB_FGETC@
+# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef fgetc
+# define fgetc rpl_fgetc
+# endif
+_GL_FUNCDECL_RPL (fgetc, int, (FILE *stream) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (fgetc, int, (FILE *stream));
+# else
+_GL_CXXALIAS_SYS (fgetc, int, (FILE *stream));
+# endif
+_GL_CXXALIASWARN (fgetc);
+#endif
+
+#if @GNULIB_FGETS@
+# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef fgets
+# define fgets rpl_fgets
+# endif
+_GL_FUNCDECL_RPL (fgets, char *, (char *s, int n, FILE *stream)
+ _GL_ARG_NONNULL ((1, 3)));
+_GL_CXXALIAS_RPL (fgets, char *, (char *s, int n, FILE *stream));
+# else
+_GL_CXXALIAS_SYS (fgets, char *, (char *s, int n, FILE *stream));
+# endif
+_GL_CXXALIASWARN (fgets);
+#endif
+
+#if @GNULIB_FOPEN@
+# if @REPLACE_FOPEN@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef fopen
+# define fopen rpl_fopen
+# endif
+_GL_FUNCDECL_RPL (fopen, FILE *, (const char *filename, const char *mode)
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (fopen, FILE *, (const char *filename, const char *mode));
+# else
+_GL_CXXALIAS_SYS (fopen, FILE *, (const char *filename, const char *mode));
+# endif
+_GL_CXXALIASWARN (fopen);
+#elif defined GNULIB_POSIXCHECK
+# undef fopen
+/* Assume fopen is always declared. */
+_GL_WARN_ON_USE (fopen, "fopen on native Windows platforms is not POSIX compliant - "
+ "use gnulib module fopen for portability");
+#endif
+
+#if @GNULIB_FPRINTF_POSIX@ || @GNULIB_FPRINTF@
+# if (@GNULIB_FPRINTF_POSIX@ && @REPLACE_FPRINTF@) \
+ || (@GNULIB_FPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@))
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define fprintf rpl_fprintf
+# endif
+# define GNULIB_overrides_fprintf 1
+# if @GNULIB_FPRINTF_POSIX@ || @GNULIB_VFPRINTF_POSIX@
+_GL_FUNCDECL_RPL (fprintf, int, (FILE *fp, const char *format, ...)
+ _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
+ _GL_ARG_NONNULL ((1, 2)));
+# else
+_GL_FUNCDECL_RPL (fprintf, int, (FILE *fp, const char *format, ...)
+ _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM (2, 3)
+ _GL_ARG_NONNULL ((1, 2)));
+# endif
+_GL_CXXALIAS_RPL (fprintf, int, (FILE *fp, const char *format, ...));
+# else
+_GL_CXXALIAS_SYS (fprintf, int, (FILE *fp, const char *format, ...));
+# endif
+_GL_CXXALIASWARN (fprintf);
+#endif
+#if !@GNULIB_FPRINTF_POSIX@ && defined GNULIB_POSIXCHECK
+# if !GNULIB_overrides_fprintf
+# undef fprintf
+# endif
+/* Assume fprintf is always declared. */
+_GL_WARN_ON_USE (fprintf, "fprintf is not always POSIX compliant - "
+ "use gnulib module fprintf-posix for portable "
+ "POSIX compliance");
+#endif
+
+#if @GNULIB_FPURGE@
+/* Discard all pending buffered I/O data on STREAM.
+ STREAM must not be wide-character oriented.
+ When discarding pending output, the file position is set back to where it
+ was before the write calls. When discarding pending input, the file
+ position is advanced to match the end of the previously read input.
+ Return 0 if successful. Upon error, return -1 and set errno. */
+# if @REPLACE_FPURGE@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define fpurge rpl_fpurge
+# endif
+_GL_FUNCDECL_RPL (fpurge, int, (FILE *gl_stream) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (fpurge, int, (FILE *gl_stream));
+# else
+# if !@HAVE_DECL_FPURGE@
+_GL_FUNCDECL_SYS (fpurge, int, (FILE *gl_stream) _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (fpurge, int, (FILE *gl_stream));
+# endif
+_GL_CXXALIASWARN (fpurge);
+#elif defined GNULIB_POSIXCHECK
+# undef fpurge
+# if HAVE_RAW_DECL_FPURGE
+_GL_WARN_ON_USE (fpurge, "fpurge is not always present - "
+ "use gnulib module fpurge for portability");
+# endif
+#endif
+
+#if @GNULIB_FPUTC@
+# if @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@)
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef fputc
+# define fputc rpl_fputc
+# endif
+_GL_FUNCDECL_RPL (fputc, int, (int c, FILE *stream) _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (fputc, int, (int c, FILE *stream));
+# else
+_GL_CXXALIAS_SYS (fputc, int, (int c, FILE *stream));
+# endif
+_GL_CXXALIASWARN (fputc);
+#endif
+
+#if @GNULIB_FPUTS@
+# if @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@)
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef fputs
+# define fputs rpl_fputs
+# endif
+_GL_FUNCDECL_RPL (fputs, int, (const char *string, FILE *stream)
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (fputs, int, (const char *string, FILE *stream));
+# else
+_GL_CXXALIAS_SYS (fputs, int, (const char *string, FILE *stream));
+# endif
+_GL_CXXALIASWARN (fputs);
+#endif
+
+#if @GNULIB_FREAD@
+# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef fread
+# define fread rpl_fread
+# endif
+_GL_FUNCDECL_RPL (fread, size_t, (void *ptr, size_t s, size_t n, FILE *stream)
+ _GL_ARG_NONNULL ((4)));
+_GL_CXXALIAS_RPL (fread, size_t, (void *ptr, size_t s, size_t n, FILE *stream));
+# else
+_GL_CXXALIAS_SYS (fread, size_t, (void *ptr, size_t s, size_t n, FILE *stream));
+# endif
+_GL_CXXALIASWARN (fread);
+#endif
+
+#if @GNULIB_FREOPEN@
+# if @REPLACE_FREOPEN@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef freopen
+# define freopen rpl_freopen
+# endif
+_GL_FUNCDECL_RPL (freopen, FILE *,
+ (const char *filename, const char *mode, FILE *stream)
+ _GL_ARG_NONNULL ((2, 3)));
+_GL_CXXALIAS_RPL (freopen, FILE *,
+ (const char *filename, const char *mode, FILE *stream));
+# else
+_GL_CXXALIAS_SYS (freopen, FILE *,
+ (const char *filename, const char *mode, FILE *stream));
+# endif
+_GL_CXXALIASWARN (freopen);
+#elif defined GNULIB_POSIXCHECK
+# undef freopen
+/* Assume freopen is always declared. */
+_GL_WARN_ON_USE (freopen,
+ "freopen on native Windows platforms is not POSIX compliant - "
+ "use gnulib module freopen for portability");
+#endif
+
+#if @GNULIB_FSCANF@
+# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef fscanf
+# define fscanf rpl_fscanf
+# endif
+_GL_FUNCDECL_RPL (fscanf, int, (FILE *stream, const char *format, ...)
+ _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (2, 3)
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (fscanf, int, (FILE *stream, const char *format, ...));
+# else
+_GL_CXXALIAS_SYS (fscanf, int, (FILE *stream, const char *format, ...));
+# endif
+_GL_CXXALIASWARN (fscanf);
+#endif
+
+
+/* Set up the following warnings, based on which modules are in use.
+ GNU Coding Standards discourage the use of fseek, since it imposes
+ an arbitrary limitation on some 32-bit hosts. Remember that the
+ fseek module depends on the fseeko module, so we only have three
+ cases to consider:
+
+ 1. The developer is not using either module. Issue a warning under
+ GNULIB_POSIXCHECK for both functions, to remind them that both
+ functions have bugs on some systems. _GL_NO_LARGE_FILES has no
+ impact on this warning.
+
+ 2. The developer is using both modules. They may be unaware of the
+ arbitrary limitations of fseek, so issue a warning under
+ GNULIB_POSIXCHECK. On the other hand, they may be using both
+ modules intentionally, so the developer can define
+ _GL_NO_LARGE_FILES in the compilation units where the use of fseek
+ is safe, to silence the warning.
+
+ 3. The developer is using the fseeko module, but not fseek. Gnulib
+ guarantees that fseek will still work around platform bugs in that
+ case, but we presume that the developer is aware of the pitfalls of
+ fseek and was trying to avoid it, so issue a warning even when
+ GNULIB_POSIXCHECK is undefined. Again, _GL_NO_LARGE_FILES can be
+ defined to silence the warning in particular compilation units.
+ In C++ compilations with GNULIB_NAMESPACE, in order to avoid that
+ fseek gets defined as a macro, it is recommended that the developer
+ uses the fseek module, even if he is not calling the fseek function.
+
+ Most gnulib clients that perform stream operations should fall into
+ category 3. */
+
+#if @GNULIB_FSEEK@
+# if defined GNULIB_POSIXCHECK && !defined _GL_NO_LARGE_FILES
+# define _GL_FSEEK_WARN /* Category 2, above. */
+# undef fseek
+# endif
+# if @REPLACE_FSEEK@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef fseek
+# define fseek rpl_fseek
+# endif
+_GL_FUNCDECL_RPL (fseek, int, (FILE *fp, long offset, int whence)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (fseek, int, (FILE *fp, long offset, int whence));
+# else
+_GL_CXXALIAS_SYS (fseek, int, (FILE *fp, long offset, int whence));
+# endif
+_GL_CXXALIASWARN (fseek);
+#endif
+
+#if @GNULIB_FSEEKO@
+# if !@GNULIB_FSEEK@ && !defined _GL_NO_LARGE_FILES
+# define _GL_FSEEK_WARN /* Category 3, above. */
+# undef fseek
+# endif
+# if @REPLACE_FSEEKO@
+/* Provide an fseeko function that is aware of a preceding fflush(), and which
+ detects pipes. */
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef fseeko
+# define fseeko rpl_fseeko
+# endif
+_GL_FUNCDECL_RPL (fseeko, int, (FILE *fp, off_t offset, int whence)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (fseeko, int, (FILE *fp, off_t offset, int whence));
+# else
+# if ! @HAVE_DECL_FSEEKO@
+_GL_FUNCDECL_SYS (fseeko, int, (FILE *fp, off_t offset, int whence)
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (fseeko, int, (FILE *fp, off_t offset, int whence));
+# endif
+_GL_CXXALIASWARN (fseeko);
+#elif defined GNULIB_POSIXCHECK
+# define _GL_FSEEK_WARN /* Category 1, above. */
+# undef fseek
+# undef fseeko
+# if HAVE_RAW_DECL_FSEEKO
+_GL_WARN_ON_USE (fseeko, "fseeko is unportable - "
+ "use gnulib module fseeko for portability");
+# endif
+#endif
+
+#ifdef _GL_FSEEK_WARN
+# undef _GL_FSEEK_WARN
+/* Here, either fseek is undefined (but C89 guarantees that it is
+ declared), or it is defined as rpl_fseek (declared above). */
+_GL_WARN_ON_USE (fseek, "fseek cannot handle files larger than 4 GB "
+ "on 32-bit platforms - "
+ "use fseeko function for handling of large files");
+#endif
+
+
+/* ftell, ftello. See the comments on fseek/fseeko. */
+
+#if @GNULIB_FTELL@
+# if defined GNULIB_POSIXCHECK && !defined _GL_NO_LARGE_FILES
+# define _GL_FTELL_WARN /* Category 2, above. */
+# undef ftell
+# endif
+# if @REPLACE_FTELL@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef ftell
+# define ftell rpl_ftell
+# endif
+_GL_FUNCDECL_RPL (ftell, long, (FILE *fp) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (ftell, long, (FILE *fp));
+# else
+_GL_CXXALIAS_SYS (ftell, long, (FILE *fp));
+# endif
+_GL_CXXALIASWARN (ftell);
+#endif
+
+#if @GNULIB_FTELLO@
+# if !@GNULIB_FTELL@ && !defined _GL_NO_LARGE_FILES
+# define _GL_FTELL_WARN /* Category 3, above. */
+# undef ftell
+# endif
+# if @REPLACE_FTELLO@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef ftello
+# define ftello rpl_ftello
+# endif
+_GL_FUNCDECL_RPL (ftello, off_t, (FILE *fp) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (ftello, off_t, (FILE *fp));
+# else
+# if ! @HAVE_DECL_FTELLO@
+_GL_FUNCDECL_SYS (ftello, off_t, (FILE *fp) _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (ftello, off_t, (FILE *fp));
+# endif
+_GL_CXXALIASWARN (ftello);
+#elif defined GNULIB_POSIXCHECK
+# define _GL_FTELL_WARN /* Category 1, above. */
+# undef ftell
+# undef ftello
+# if HAVE_RAW_DECL_FTELLO
+_GL_WARN_ON_USE (ftello, "ftello is unportable - "
+ "use gnulib module ftello for portability");
+# endif
+#endif
+
+#ifdef _GL_FTELL_WARN
+# undef _GL_FTELL_WARN
+/* Here, either ftell is undefined (but C89 guarantees that it is
+ declared), or it is defined as rpl_ftell (declared above). */
+_GL_WARN_ON_USE (ftell, "ftell cannot handle files larger than 4 GB "
+ "on 32-bit platforms - "
+ "use ftello function for handling of large files");
+#endif
+
+
+#if @GNULIB_FWRITE@
+# if @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@)
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef fwrite
+# define fwrite rpl_fwrite
+# endif
+_GL_FUNCDECL_RPL (fwrite, size_t,
+ (const void *ptr, size_t s, size_t n, FILE *stream)
+ _GL_ARG_NONNULL ((1, 4)));
+_GL_CXXALIAS_RPL (fwrite, size_t,
+ (const void *ptr, size_t s, size_t n, FILE *stream));
+# else
+_GL_CXXALIAS_SYS (fwrite, size_t,
+ (const void *ptr, size_t s, size_t n, FILE *stream));
+
+/* Work around bug 11959 when fortifying glibc 2.4 through 2.15
+ <http://sources.redhat.com/bugzilla/show_bug.cgi?id=11959>,
+ which sometimes causes an unwanted diagnostic for fwrite calls.
+ This affects only function declaration attributes under certain
+ versions of gcc and clang, and is not needed for C++. */
+# if (0 < __USE_FORTIFY_LEVEL \
+ && __GLIBC__ == 2 && 4 <= __GLIBC_MINOR__ && __GLIBC_MINOR__ <= 15 \
+ && 3 < __GNUC__ + (4 <= __GNUC_MINOR__) \
+ && !defined __cplusplus)
+# undef fwrite
+# undef fwrite_unlocked
+extern size_t __REDIRECT (rpl_fwrite,
+ (const void *__restrict, size_t, size_t,
+ FILE *__restrict),
+ fwrite);
+extern size_t __REDIRECT (rpl_fwrite_unlocked,
+ (const void *__restrict, size_t, size_t,
+ FILE *__restrict),
+ fwrite_unlocked);
+# define fwrite rpl_fwrite
+# define fwrite_unlocked rpl_fwrite_unlocked
+# endif
+# endif
+_GL_CXXALIASWARN (fwrite);
+#endif
+
+#if @GNULIB_GETC@
+# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef getc
+# define getc rpl_fgetc
+# endif
+_GL_FUNCDECL_RPL (fgetc, int, (FILE *stream) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL_1 (getc, rpl_fgetc, int, (FILE *stream));
+# else
+_GL_CXXALIAS_SYS (getc, int, (FILE *stream));
+# endif
+_GL_CXXALIASWARN (getc);
+#endif
+
+#if @GNULIB_GETCHAR@
+# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef getchar
+# define getchar rpl_getchar
+# endif
+_GL_FUNCDECL_RPL (getchar, int, (void));
+_GL_CXXALIAS_RPL (getchar, int, (void));
+# else
+_GL_CXXALIAS_SYS (getchar, int, (void));
+# endif
+_GL_CXXALIASWARN (getchar);
+#endif
+
+#if @GNULIB_GETDELIM@
+/* Read input, up to (and including) the next occurrence of DELIMITER, from
+ STREAM, store it in *LINEPTR (and NUL-terminate it).
+ *LINEPTR is a pointer returned from malloc (or NULL), pointing to *LINESIZE
+ bytes of space. It is realloc'd as necessary.
+ Return the number of bytes read and stored at *LINEPTR (not including the
+ NUL terminator), or -1 on error or EOF. */
+# if @REPLACE_GETDELIM@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef getdelim
+# define getdelim rpl_getdelim
+# endif
+_GL_FUNCDECL_RPL (getdelim, ssize_t,
+ (char **lineptr, size_t *linesize, int delimiter,
+ FILE *stream)
+ _GL_ARG_NONNULL ((1, 2, 4)));
+_GL_CXXALIAS_RPL (getdelim, ssize_t,
+ (char **lineptr, size_t *linesize, int delimiter,
+ FILE *stream));
+# else
+# if !@HAVE_DECL_GETDELIM@
+_GL_FUNCDECL_SYS (getdelim, ssize_t,
+ (char **lineptr, size_t *linesize, int delimiter,
+ FILE *stream)
+ _GL_ARG_NONNULL ((1, 2, 4)));
+# endif
+_GL_CXXALIAS_SYS (getdelim, ssize_t,
+ (char **lineptr, size_t *linesize, int delimiter,
+ FILE *stream));
+# endif
+_GL_CXXALIASWARN (getdelim);
+#elif defined GNULIB_POSIXCHECK
+# undef getdelim
+# if HAVE_RAW_DECL_GETDELIM
+_GL_WARN_ON_USE (getdelim, "getdelim is unportable - "
+ "use gnulib module getdelim for portability");
+# endif
+#endif
+
+#if @GNULIB_GETLINE@
+/* Read a line, up to (and including) the next newline, from STREAM, store it
+ in *LINEPTR (and NUL-terminate it).
+ *LINEPTR is a pointer returned from malloc (or NULL), pointing to *LINESIZE
+ bytes of space. It is realloc'd as necessary.
+ Return the number of bytes read and stored at *LINEPTR (not including the
+ NUL terminator), or -1 on error or EOF. */
+# if @REPLACE_GETLINE@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef getline
+# define getline rpl_getline
+# endif
+_GL_FUNCDECL_RPL (getline, ssize_t,
+ (char **lineptr, size_t *linesize, FILE *stream)
+ _GL_ARG_NONNULL ((1, 2, 3)));
+_GL_CXXALIAS_RPL (getline, ssize_t,
+ (char **lineptr, size_t *linesize, FILE *stream));
+# else
+# if !@HAVE_DECL_GETLINE@
+_GL_FUNCDECL_SYS (getline, ssize_t,
+ (char **lineptr, size_t *linesize, FILE *stream)
+ _GL_ARG_NONNULL ((1, 2, 3)));
+# endif
+_GL_CXXALIAS_SYS (getline, ssize_t,
+ (char **lineptr, size_t *linesize, FILE *stream));
+# endif
+# if @HAVE_DECL_GETLINE@
+_GL_CXXALIASWARN (getline);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef getline
+# if HAVE_RAW_DECL_GETLINE
+_GL_WARN_ON_USE (getline, "getline is unportable - "
+ "use gnulib module getline for portability");
+# endif
+#endif
+
+/* It is very rare that the developer ever has full control of stdin,
+ so any use of gets warrants an unconditional warning; besides, C11
+ removed it. */
+#undef gets
+#if HAVE_RAW_DECL_GETS
+_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
+#endif
+
+
+#if @GNULIB_OBSTACK_PRINTF@ || @GNULIB_OBSTACK_PRINTF_POSIX@
+struct obstack;
+/* Grow an obstack with formatted output. Return the number of
+ bytes added to OBS. No trailing nul byte is added, and the
+ object should be closed with obstack_finish before use. Upon
+ memory allocation error, call obstack_alloc_failed_handler. Upon
+ other error, return -1. */
+# if @REPLACE_OBSTACK_PRINTF@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define obstack_printf rpl_obstack_printf
+# endif
+_GL_FUNCDECL_RPL (obstack_printf, int,
+ (struct obstack *obs, const char *format, ...)
+ _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (obstack_printf, int,
+ (struct obstack *obs, const char *format, ...));
+# else
+# if !@HAVE_DECL_OBSTACK_PRINTF@
+_GL_FUNCDECL_SYS (obstack_printf, int,
+ (struct obstack *obs, const char *format, ...)
+ _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
+ _GL_ARG_NONNULL ((1, 2)));
+# endif
+_GL_CXXALIAS_SYS (obstack_printf, int,
+ (struct obstack *obs, const char *format, ...));
+# endif
+_GL_CXXALIASWARN (obstack_printf);
+# if @REPLACE_OBSTACK_PRINTF@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define obstack_vprintf rpl_obstack_vprintf
+# endif
+_GL_FUNCDECL_RPL (obstack_vprintf, int,
+ (struct obstack *obs, const char *format, va_list args)
+ _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));
+# else
+# if !@HAVE_DECL_OBSTACK_PRINTF@
+_GL_FUNCDECL_SYS (obstack_vprintf, int,
+ (struct obstack *obs, const char *format, va_list args)
+ _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
+ _GL_ARG_NONNULL ((1, 2)));
+# endif
+_GL_CXXALIAS_SYS (obstack_vprintf, int,
+ (struct obstack *obs, const char *format, va_list args));
+# endif
+_GL_CXXALIASWARN (obstack_vprintf);
+#endif
+
+#if @GNULIB_PCLOSE@
+# if !@HAVE_PCLOSE@
+_GL_FUNCDECL_SYS (pclose, int, (FILE *stream) _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (pclose, int, (FILE *stream));
+_GL_CXXALIASWARN (pclose);
+#elif defined GNULIB_POSIXCHECK
+# undef pclose
+# if HAVE_RAW_DECL_PCLOSE
+_GL_WARN_ON_USE (pclose, "pclose is unportable - "
+ "use gnulib module pclose for more portability");
+# endif
+#endif
+
+#if @GNULIB_PERROR@
+/* Print a message to standard error, describing the value of ERRNO,
+ (if STRING is not NULL and not empty) prefixed with STRING and ": ",
+ and terminated with a newline. */
+# if @REPLACE_PERROR@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define perror rpl_perror
+# endif
+_GL_FUNCDECL_RPL (perror, void, (const char *string));
+_GL_CXXALIAS_RPL (perror, void, (const char *string));
+# else
+_GL_CXXALIAS_SYS (perror, void, (const char *string));
+# endif
+_GL_CXXALIASWARN (perror);
+#elif defined GNULIB_POSIXCHECK
+# undef perror
+/* Assume perror is always declared. */
+_GL_WARN_ON_USE (perror, "perror is not always POSIX compliant - "
+ "use gnulib module perror for portability");
+#endif
+
+#if @GNULIB_POPEN@
+# if @REPLACE_POPEN@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef popen
+# define popen rpl_popen
+# endif
+_GL_FUNCDECL_RPL (popen, FILE *, (const char *cmd, const char *mode)
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (popen, FILE *, (const char *cmd, const char *mode));
+# else
+# if !@HAVE_POPEN@
+_GL_FUNCDECL_SYS (popen, FILE *, (const char *cmd, const char *mode)
+ _GL_ARG_NONNULL ((1, 2)));
+# endif
+_GL_CXXALIAS_SYS (popen, FILE *, (const char *cmd, const char *mode));
+# endif
+_GL_CXXALIASWARN (popen);
+#elif defined GNULIB_POSIXCHECK
+# undef popen
+# if HAVE_RAW_DECL_POPEN
+_GL_WARN_ON_USE (popen, "popen is buggy on some platforms - "
+ "use gnulib module popen or pipe for more portability");
+# endif
+#endif
+
+#if @GNULIB_PRINTF_POSIX@ || @GNULIB_PRINTF@
+# if (@GNULIB_PRINTF_POSIX@ && @REPLACE_PRINTF@) \
+ || (@GNULIB_PRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@))
+# if defined __GNUC__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+/* Don't break __attribute__((format(printf,M,N))). */
+# define printf __printf__
+# endif
+# if @GNULIB_PRINTF_POSIX@ || @GNULIB_VFPRINTF_POSIX@
+_GL_FUNCDECL_RPL_1 (__printf__, int,
+ (const char *format, ...)
+ __asm__ (@ASM_SYMBOL_PREFIX@
+ _GL_STDIO_MACROEXPAND_AND_STRINGIZE(rpl_printf))
+ _GL_ATTRIBUTE_FORMAT_PRINTF (1, 2)
+ _GL_ARG_NONNULL ((1)));
+# else
+_GL_FUNCDECL_RPL_1 (__printf__, int,
+ (const char *format, ...)
+ __asm__ (@ASM_SYMBOL_PREFIX@
+ _GL_STDIO_MACROEXPAND_AND_STRINGIZE(rpl_printf))
+ _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM (1, 2)
+ _GL_ARG_NONNULL ((1)));
+# endif
+_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_ATTRIBUTE_FORMAT_PRINTF (1, 2)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (printf, int, (const char *format, ...));
+# endif
+# define GNULIB_overrides_printf 1
+# else
+_GL_CXXALIAS_SYS (printf, int, (const char *format, ...));
+# endif
+_GL_CXXALIASWARN (printf);
+#endif
+#if !@GNULIB_PRINTF_POSIX@ && defined GNULIB_POSIXCHECK
+# if !GNULIB_overrides_printf
+# undef printf
+# endif
+/* Assume printf is always declared. */
+_GL_WARN_ON_USE (printf, "printf is not always POSIX compliant - "
+ "use gnulib module printf-posix for portable "
+ "POSIX compliance");
+#endif
+
+#if @GNULIB_PUTC@
+# if @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@)
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef putc
+# define putc rpl_fputc
+# endif
+_GL_FUNCDECL_RPL (fputc, int, (int c, FILE *stream) _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL_1 (putc, rpl_fputc, int, (int c, FILE *stream));
+# else
+_GL_CXXALIAS_SYS (putc, int, (int c, FILE *stream));
+# endif
+_GL_CXXALIASWARN (putc);
+#endif
+
+#if @GNULIB_PUTCHAR@
+# if @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@)
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef putchar
+# define putchar rpl_putchar
+# endif
+_GL_FUNCDECL_RPL (putchar, int, (int c));
+_GL_CXXALIAS_RPL (putchar, int, (int c));
+# else
+_GL_CXXALIAS_SYS (putchar, int, (int c));
+# endif
+_GL_CXXALIASWARN (putchar);
+#endif
+
+#if @GNULIB_PUTS@
+# if @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@)
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef puts
+# define puts rpl_puts
+# endif
+_GL_FUNCDECL_RPL (puts, int, (const char *string) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (puts, int, (const char *string));
+# else
+_GL_CXXALIAS_SYS (puts, int, (const char *string));
+# endif
+_GL_CXXALIASWARN (puts);
+#endif
+
+#if @GNULIB_REMOVE@
+# if @REPLACE_REMOVE@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef remove
+# define remove rpl_remove
+# endif
+_GL_FUNCDECL_RPL (remove, int, (const char *name) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (remove, int, (const char *name));
+# else
+_GL_CXXALIAS_SYS (remove, int, (const char *name));
+# endif
+_GL_CXXALIASWARN (remove);
+#elif defined GNULIB_POSIXCHECK
+# undef remove
+/* Assume remove is always declared. */
+_GL_WARN_ON_USE (remove, "remove cannot handle directories on some platforms - "
+ "use gnulib module remove for more portability");
+#endif
+
+#if @GNULIB_RENAME@
+# if @REPLACE_RENAME@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef rename
+# define rename rpl_rename
+# endif
+_GL_FUNCDECL_RPL (rename, int,
+ (const char *old_filename, const char *new_filename)
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (rename, int,
+ (const char *old_filename, const char *new_filename));
+# else
+_GL_CXXALIAS_SYS (rename, int,
+ (const char *old_filename, const char *new_filename));
+# endif
+_GL_CXXALIASWARN (rename);
+#elif defined GNULIB_POSIXCHECK
+# undef rename
+/* Assume rename is always declared. */
+_GL_WARN_ON_USE (rename, "rename is buggy on some platforms - "
+ "use gnulib module rename for more portability");
+#endif
+
+#if @GNULIB_RENAMEAT@
+# if @REPLACE_RENAMEAT@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef renameat
+# define renameat rpl_renameat
+# endif
+_GL_FUNCDECL_RPL (renameat, int,
+ (int fd1, char const *file1, int fd2, char const *file2)
+ _GL_ARG_NONNULL ((2, 4)));
+_GL_CXXALIAS_RPL (renameat, int,
+ (int fd1, char const *file1, int fd2, char const *file2));
+# else
+# if !@HAVE_RENAMEAT@
+_GL_FUNCDECL_SYS (renameat, int,
+ (int fd1, char const *file1, int fd2, char const *file2)
+ _GL_ARG_NONNULL ((2, 4)));
+# endif
+_GL_CXXALIAS_SYS (renameat, int,
+ (int fd1, char const *file1, int fd2, char const *file2));
+# endif
+_GL_CXXALIASWARN (renameat);
+#elif defined GNULIB_POSIXCHECK
+# undef renameat
+# if HAVE_RAW_DECL_RENAMEAT
+_GL_WARN_ON_USE (renameat, "renameat is not portable - "
+ "use gnulib module renameat for portability");
+# endif
+#endif
+
+#if @GNULIB_SCANF@
+# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
+# if defined __GNUC__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef scanf
+/* Don't break __attribute__((format(scanf,M,N))). */
+# define scanf __scanf__
+# endif
+_GL_FUNCDECL_RPL_1 (__scanf__, int,
+ (const char *format, ...)
+ __asm__ (@ASM_SYMBOL_PREFIX@
+ _GL_STDIO_MACROEXPAND_AND_STRINGIZE(rpl_scanf))
+ _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (1, 2)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL_1 (scanf, __scanf__, int, (const char *format, ...));
+# else
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef scanf
+# define scanf rpl_scanf
+# endif
+_GL_FUNCDECL_RPL (scanf, int, (const char *format, ...)
+ _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (1, 2)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (scanf, int, (const char *format, ...));
+# endif
+# else
+_GL_CXXALIAS_SYS (scanf, int, (const char *format, ...));
+# endif
+_GL_CXXALIASWARN (scanf);
+#endif
+
+#if @GNULIB_SNPRINTF@
+# if @REPLACE_SNPRINTF@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define snprintf rpl_snprintf
+# endif
+_GL_FUNCDECL_RPL (snprintf, int,
+ (char *str, size_t size, const char *format, ...)
+ _GL_ATTRIBUTE_FORMAT_PRINTF (3, 4)
+ _GL_ARG_NONNULL ((3)));
+_GL_CXXALIAS_RPL (snprintf, int,
+ (char *str, size_t size, const char *format, ...));
+# else
+# if !@HAVE_DECL_SNPRINTF@
+_GL_FUNCDECL_SYS (snprintf, int,
+ (char *str, size_t size, const char *format, ...)
+ _GL_ATTRIBUTE_FORMAT_PRINTF (3, 4)
+ _GL_ARG_NONNULL ((3)));
+# endif
+_GL_CXXALIAS_SYS (snprintf, int,
+ (char *str, size_t size, const char *format, ...));
+# endif
+_GL_CXXALIASWARN (snprintf);
+#elif defined GNULIB_POSIXCHECK
+# undef snprintf
+# if HAVE_RAW_DECL_SNPRINTF
+_GL_WARN_ON_USE (snprintf, "snprintf is unportable - "
+ "use gnulib module snprintf for portability");
+# endif
+#endif
+
+/* Some people would argue that all sprintf uses should be warned about
+ (for example, OpenBSD issues a link warning for it),
+ since it can cause security holes due to buffer overruns.
+ However, we believe that sprintf can be used safely, and is more
+ efficient than snprintf in those safe cases; and as proof of our
+ belief, we use sprintf in several gnulib modules. So this header
+ intentionally avoids adding a warning to sprintf except when
+ GNULIB_POSIXCHECK is defined. */
+
+#if @GNULIB_SPRINTF_POSIX@
+# if @REPLACE_SPRINTF@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define sprintf rpl_sprintf
+# endif
+_GL_FUNCDECL_RPL (sprintf, int, (char *str, const char *format, ...)
+ _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (sprintf, int, (char *str, const char *format, ...));
+# else
+_GL_CXXALIAS_SYS (sprintf, int, (char *str, const char *format, ...));
+# endif
+_GL_CXXALIASWARN (sprintf);
+#elif defined GNULIB_POSIXCHECK
+# undef sprintf
+/* Assume sprintf is always declared. */
+_GL_WARN_ON_USE (sprintf, "sprintf is not always POSIX compliant - "
+ "use gnulib module sprintf-posix for portable "
+ "POSIX compliance");
+#endif
+
+#if @GNULIB_TMPFILE@
+# if @REPLACE_TMPFILE@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define tmpfile rpl_tmpfile
+# endif
+_GL_FUNCDECL_RPL (tmpfile, FILE *, (void));
+_GL_CXXALIAS_RPL (tmpfile, FILE *, (void));
+# else
+_GL_CXXALIAS_SYS (tmpfile, FILE *, (void));
+# endif
+_GL_CXXALIASWARN (tmpfile);
+#elif defined GNULIB_POSIXCHECK
+# undef tmpfile
+# if HAVE_RAW_DECL_TMPFILE
+_GL_WARN_ON_USE (tmpfile, "tmpfile is not usable on mingw - "
+ "use gnulib module tmpfile for portability");
+# endif
+#endif
+
+#if @GNULIB_VASPRINTF@
+/* Write formatted output to a string dynamically allocated with malloc().
+ If the memory allocation succeeds, store the address of the string in
+ *RESULT and return the number of resulting bytes, excluding the trailing
+ NUL. Upon memory allocation error, or some other error, return -1. */
+# if @REPLACE_VASPRINTF@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define asprintf rpl_asprintf
+# endif
+_GL_FUNCDECL_RPL (asprintf, int,
+ (char **result, const char *format, ...)
+ _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (asprintf, int,
+ (char **result, const char *format, ...));
+# else
+# if !@HAVE_VASPRINTF@
+_GL_FUNCDECL_SYS (asprintf, int,
+ (char **result, const char *format, ...)
+ _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
+ _GL_ARG_NONNULL ((1, 2)));
+# endif
+_GL_CXXALIAS_SYS (asprintf, int,
+ (char **result, const char *format, ...));
+# endif
+_GL_CXXALIASWARN (asprintf);
+# if @REPLACE_VASPRINTF@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define vasprintf rpl_vasprintf
+# endif
+_GL_FUNCDECL_RPL (vasprintf, int,
+ (char **result, const char *format, va_list args)
+ _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (vasprintf, int,
+ (char **result, const char *format, va_list args));
+# else
+# if !@HAVE_VASPRINTF@
+_GL_FUNCDECL_SYS (vasprintf, int,
+ (char **result, const char *format, va_list args)
+ _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
+ _GL_ARG_NONNULL ((1, 2)));
+# endif
+_GL_CXXALIAS_SYS (vasprintf, int,
+ (char **result, const char *format, va_list args));
+# endif
+_GL_CXXALIASWARN (vasprintf);
+#endif
+
+#if @GNULIB_VDPRINTF@
+# if @REPLACE_VDPRINTF@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define vdprintf rpl_vdprintf
+# endif
+_GL_FUNCDECL_RPL (vdprintf, int, (int fd, const char *format, va_list args)
+ _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_ATTRIBUTE_FORMAT_PRINTF (2, 0)
+ _GL_ARG_NONNULL ((2)));
+# endif
+/* Need to cast, because on Solaris, the third parameter will likely be
+ __va_list args. */
+_GL_CXXALIAS_SYS_CAST (vdprintf, int,
+ (int fd, const char *format, va_list args));
+# endif
+_GL_CXXALIASWARN (vdprintf);
+#elif defined GNULIB_POSIXCHECK
+# undef vdprintf
+# if HAVE_RAW_DECL_VDPRINTF
+_GL_WARN_ON_USE (vdprintf, "vdprintf is unportable - "
+ "use gnulib module vdprintf for portability");
+# endif
+#endif
+
+#if @GNULIB_VFPRINTF_POSIX@ || @GNULIB_VFPRINTF@
+# if (@GNULIB_VFPRINTF_POSIX@ && @REPLACE_VFPRINTF@) \
+ || (@GNULIB_VFPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@))
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define vfprintf rpl_vfprintf
+# endif
+# define GNULIB_overrides_vfprintf 1
+# if @GNULIB_VFPRINTF_POSIX@
+_GL_FUNCDECL_RPL (vfprintf, int, (FILE *fp, const char *format, va_list args)
+ _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
+ _GL_ARG_NONNULL ((1, 2)));
+# else
+_GL_FUNCDECL_RPL (vfprintf, int, (FILE *fp, const char *format, va_list args)
+ _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM (2, 0)
+ _GL_ARG_NONNULL ((1, 2)));
+# endif
+_GL_CXXALIAS_RPL (vfprintf, int, (FILE *fp, const char *format, va_list args));
+# else
+/* Need to cast, because on Solaris, the third parameter is
+ __va_list args
+ and GCC's fixincludes did not change this to __gnuc_va_list. */
+_GL_CXXALIAS_SYS_CAST (vfprintf, int,
+ (FILE *fp, const char *format, va_list args));
+# endif
+_GL_CXXALIASWARN (vfprintf);
+#endif
+#if !@GNULIB_VFPRINTF_POSIX@ && defined GNULIB_POSIXCHECK
+# if !GNULIB_overrides_vfprintf
+# undef vfprintf
+# endif
+/* Assume vfprintf is always declared. */
+_GL_WARN_ON_USE (vfprintf, "vfprintf is not always POSIX compliant - "
+ "use gnulib module vfprintf-posix for portable "
+ "POSIX compliance");
+#endif
+
+#if @GNULIB_VFSCANF@
+# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef vfscanf
+# define vfscanf rpl_vfscanf
+# endif
+_GL_FUNCDECL_RPL (vfscanf, int,
+ (FILE *stream, const char *format, va_list args)
+ _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (2, 0)
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (vfscanf, int,
+ (FILE *stream, const char *format, va_list args));
+# else
+_GL_CXXALIAS_SYS (vfscanf, int,
+ (FILE *stream, const char *format, va_list args));
+# endif
+_GL_CXXALIASWARN (vfscanf);
+#endif
+
+#if @GNULIB_VPRINTF_POSIX@ || @GNULIB_VPRINTF@
+# if (@GNULIB_VPRINTF_POSIX@ && @REPLACE_VPRINTF@) \
+ || (@GNULIB_VPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@))
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define vprintf rpl_vprintf
+# endif
+# define GNULIB_overrides_vprintf 1
+# if @GNULIB_VPRINTF_POSIX@ || @GNULIB_VFPRINTF_POSIX@
+_GL_FUNCDECL_RPL (vprintf, int, (const char *format, va_list args)
+ _GL_ATTRIBUTE_FORMAT_PRINTF (1, 0)
+ _GL_ARG_NONNULL ((1)));
+# else
+_GL_FUNCDECL_RPL (vprintf, int, (const char *format, va_list args)
+ _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM (1, 0)
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_RPL (vprintf, int, (const char *format, va_list args));
+# else
+/* Need to cast, because on Solaris, the second parameter is
+ __va_list args
+ and GCC's fixincludes did not change this to __gnuc_va_list. */
+_GL_CXXALIAS_SYS_CAST (vprintf, int, (const char *format, va_list args));
+# endif
+_GL_CXXALIASWARN (vprintf);
+#endif
+#if !@GNULIB_VPRINTF_POSIX@ && defined GNULIB_POSIXCHECK
+# if !GNULIB_overrides_vprintf
+# undef vprintf
+# endif
+/* Assume vprintf is always declared. */
+_GL_WARN_ON_USE (vprintf, "vprintf is not always POSIX compliant - "
+ "use gnulib module vprintf-posix for portable "
+ "POSIX compliance");
+#endif
+
+#if @GNULIB_VSCANF@
+# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef vscanf
+# define vscanf rpl_vscanf
+# endif
+_GL_FUNCDECL_RPL (vscanf, int, (const char *format, va_list args)
+ _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (1, 0)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (vscanf, int, (const char *format, va_list args));
+# else
+_GL_CXXALIAS_SYS (vscanf, int, (const char *format, va_list args));
+# endif
+_GL_CXXALIASWARN (vscanf);
+#endif
+
+#if @GNULIB_VSNPRINTF@
+# if @REPLACE_VSNPRINTF@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define vsnprintf rpl_vsnprintf
+# endif
+_GL_FUNCDECL_RPL (vsnprintf, int,
+ (char *str, size_t size, const char *format, va_list args)
+ _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));
+# else
+# if !@HAVE_DECL_VSNPRINTF@
+_GL_FUNCDECL_SYS (vsnprintf, int,
+ (char *str, size_t size, const char *format, va_list args)
+ _GL_ATTRIBUTE_FORMAT_PRINTF (3, 0)
+ _GL_ARG_NONNULL ((3)));
+# endif
+_GL_CXXALIAS_SYS (vsnprintf, int,
+ (char *str, size_t size, const char *format, va_list args));
+# endif
+_GL_CXXALIASWARN (vsnprintf);
+#elif defined GNULIB_POSIXCHECK
+# undef vsnprintf
+# if HAVE_RAW_DECL_VSNPRINTF
+_GL_WARN_ON_USE (vsnprintf, "vsnprintf is unportable - "
+ "use gnulib module vsnprintf for portability");
+# endif
+#endif
+
+#if @GNULIB_VSPRINTF_POSIX@
+# if @REPLACE_VSPRINTF@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define vsprintf rpl_vsprintf
+# endif
+_GL_FUNCDECL_RPL (vsprintf, int,
+ (char *str, const char *format, va_list args)
+ _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (vsprintf, int,
+ (char *str, const char *format, va_list args));
+# else
+/* Need to cast, because on Solaris, the third parameter is
+ __va_list args
+ and GCC's fixincludes did not change this to __gnuc_va_list. */
+_GL_CXXALIAS_SYS_CAST (vsprintf, int,
+ (char *str, const char *format, va_list args));
+# endif
+_GL_CXXALIASWARN (vsprintf);
+#elif defined GNULIB_POSIXCHECK
+# undef vsprintf
+/* Assume vsprintf is always declared. */
+_GL_WARN_ON_USE (vsprintf, "vsprintf is not always POSIX compliant - "
+ "use gnulib module vsprintf-posix for portable "
+ "POSIX compliance");
+#endif
+
+#endif /* _@GUARD_PREFIX@_STDIO_H */
+#endif /* _@GUARD_PREFIX@_STDIO_H */
+#endif
diff --git a/src/gl/stdlib.in.h b/src/gl/stdlib.in.h
index c9552480e5..46e10dba97 100644
--- a/src/gl/stdlib.in.h
+++ b/src/gl/stdlib.in.h
@@ -1,6 +1,6 @@
/* A GNU-like <stdlib.h>.
- Copyright (C) 1995, 2001-2004, 2006-2013 Free Software Foundation, Inc.
+ Copyright (C) 1995, 2001-2004, 2006-2014 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
diff --git a/src/gl/strerror-override.c b/src/gl/strerror-override.c
index d0ed2fb86a..255d933346 100644
--- a/src/gl/strerror-override.c
+++ b/src/gl/strerror-override.c
@@ -1,6 +1,6 @@
/* strerror-override.c --- POSIX compatible system error routine
- Copyright (C) 2010-2013 Free Software Foundation, Inc.
+ Copyright (C) 2010-2014 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
diff --git a/src/gl/strerror-override.h b/src/gl/strerror-override.h
index 0d086b873b..e98c1c16bc 100644
--- a/src/gl/strerror-override.h
+++ b/src/gl/strerror-override.h
@@ -1,6 +1,6 @@
/* strerror-override.h --- POSIX compatible system error routine
- Copyright (C) 2010-2013 Free Software Foundation, Inc.
+ Copyright (C) 2010-2014 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
diff --git a/src/gl/strerror.c b/src/gl/strerror.c
index 80a2f2eea4..e54f0cc906 100644
--- a/src/gl/strerror.c
+++ b/src/gl/strerror.c
@@ -1,6 +1,6 @@
/* strerror.c --- POSIX compatible system error routine
- Copyright (C) 2007-2013 Free Software Foundation, Inc.
+ Copyright (C) 2007-2014 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
diff --git a/src/gl/string.in.h b/src/gl/string.in.h
index d7a6c9c923..9062142059 100644
--- a/src/gl/string.in.h
+++ b/src/gl/string.in.h
@@ -1,6 +1,6 @@
/* A GNU-like <string.h>.
- Copyright (C) 1995-1996, 2001-2013 Free Software Foundation, Inc.
+ Copyright (C) 1995-1996, 2001-2014 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
diff --git a/src/gl/sys_time.in.h b/src/gl/sys_time.in.h
index f721580a76..30057ad49f 100644
--- a/src/gl/sys_time.in.h
+++ b/src/gl/sys_time.in.h
@@ -1,6 +1,6 @@
/* Provide a more complete sys/time.h.
- Copyright (C) 2007-2013 Free Software Foundation, Inc.
+ Copyright (C) 2007-2014 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
diff --git a/src/gl/sys_types.in.h b/src/gl/sys_types.in.h
index 9520c09030..deb5d67d1d 100644
--- a/src/gl/sys_types.in.h
+++ b/src/gl/sys_types.in.h
@@ -1,6 +1,6 @@
/* Provide a more complete sys/types.h.
- Copyright (C) 2011-2013 Free Software Foundation, Inc.
+ Copyright (C) 2011-2014 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
diff --git a/src/gl/time.in.h b/src/gl/time.in.h
index 8ced794744..81abdf46e0 100644
--- a/src/gl/time.in.h
+++ b/src/gl/time.in.h
@@ -1,6 +1,6 @@
/* A more-standard <time.h>.
- Copyright (C) 2007-2013 Free Software Foundation, Inc.
+ Copyright (C) 2007-2014 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
@@ -48,20 +48,13 @@
/* Some systems don't define struct timespec (e.g., AIX 4.1, Ultrix 4.3).
Or they define it with the wrong member names or define it in <sys/time.h>
- (e.g., FreeBSD circa 1997). Stock Mingw does not define it, but the
- pthreads-win32 library defines it in <pthread.h>. */
+ (e.g., FreeBSD circa 1997). Stock Mingw prior to 3.0 does not define it,
+ but the pthreads-win32 library defines it in <pthread.h>. */
# if ! @TIME_H_DEFINES_STRUCT_TIMESPEC@
# if @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@
# include <sys/time.h>
# elif @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@
# include <pthread.h>
-/* The pthreads-win32 <pthread.h> also defines a couple of broken macros. */
-# undef asctime_r
-# undef ctime_r
-# undef gmtime_r
-# undef localtime_r
-# undef rand_r
-# undef strtok_r
# else
# ifdef __cplusplus
@@ -187,6 +180,39 @@ _GL_CXXALIASWARN (gmtime_r);
# endif
# endif
+/* Convert TIMER to RESULT, assuming local time and UTC respectively. See
+ <http://www.opengroup.org/susv3xsh/localtime.html> and
+ <http://www.opengroup.org/susv3xsh/gmtime.html>. */
+# if @GNULIB_GETTIMEOFDAY@
+# if @REPLACE_LOCALTIME@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef localtime
+# define localtime rpl_localtime
+# endif
+_GL_FUNCDECL_RPL (localtime, struct tm *, (time_t const *__timer)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (localtime, struct tm *, (time_t const *__timer));
+# else
+_GL_CXXALIAS_SYS (localtime, struct tm *, (time_t const *__timer));
+# endif
+_GL_CXXALIASWARN (localtime);
+# endif
+
+# if @GNULIB_GETTIMEOFDAY@
+# if @REPLACE_GMTIME@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef gmtime
+# define gmtime rpl_gmtime
+# endif
+_GL_FUNCDECL_RPL (gmtime, struct tm *, (time_t const *__timer)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (gmtime, struct tm *, (time_t const *__timer));
+# else
+_GL_CXXALIAS_SYS (gmtime, struct tm *, (time_t const *__timer));
+# endif
+_GL_CXXALIASWARN (gmtime);
+# endif
+
/* Parse BUF as a time stamp, assuming FORMAT specifies its layout, and store
the resulting broken-down time into TM. See
<http://www.opengroup.org/susv3xsh/strptime.html>. */
diff --git a/src/gl/time_r.c b/src/gl/time_r.c
index 9866299856..a848d544fe 100644
--- a/src/gl/time_r.c
+++ b/src/gl/time_r.c
@@ -1,6 +1,6 @@
/* Reentrant time functions like localtime_r.
- Copyright (C) 2003, 2006-2007, 2010-2013 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2006-2007, 2010-2014 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
diff --git a/src/gl/timespec.h b/src/gl/timespec.h
index d0c029b570..872cbb76e3 100644
--- a/src/gl/timespec.h
+++ b/src/gl/timespec.h
@@ -1,6 +1,6 @@
/* timespec -- System time interface
- Copyright (C) 2000, 2002, 2004-2005, 2007, 2009-2013 Free Software
+ Copyright (C) 2000, 2002, 2004-2005, 2007, 2009-2014 Free Software
Foundation, Inc.
This program is free software: you can redistribute it and/or modify
diff --git a/src/gl/unistd.in.h b/src/gl/unistd.in.h
index 0e510d679c..622b228757 100644
--- a/src/gl/unistd.in.h
+++ b/src/gl/unistd.in.h
@@ -1,5 +1,5 @@
/* Substitute for and wrapper around <unistd.h>.
- Copyright (C) 2003-2013 Free Software Foundation, Inc.
+ Copyright (C) 2003-2014 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
@@ -21,9 +21,23 @@
#endif
@PRAGMA_COLUMNS@
+#ifdef _GL_INCLUDING_UNISTD_H
+/* Special invocation convention:
+ - On Mac OS X 10.3.9 we have a sequence of nested includes
+ <unistd.h> -> <signal.h> -> <pthread.h> -> <unistd.h>
+ In this situation, the functions are not yet declared, therefore we cannot
+ provide the C++ aliases. */
+
+#@INCLUDE_NEXT@ @NEXT_UNISTD_H@
+
+#else
+/* Normal invocation convention. */
+
/* The include_next requires a split double-inclusion guard. */
#if @HAVE_UNISTD_H@
+# define _GL_INCLUDING_UNISTD_H
# @INCLUDE_NEXT@ @NEXT_UNISTD_H@
+# undef _GL_INCLUDING_UNISTD_H
#endif
/* Get all possible declarations of gethostname(). */
@@ -1539,4 +1553,5 @@ _GL_CXXALIASWARN (write);
_GL_INLINE_HEADER_END
#endif /* _@GUARD_PREFIX@_UNISTD_H */
+#endif /* _GL_INCLUDING_UNISTD_H */
#endif /* _@GUARD_PREFIX@_UNISTD_H */
diff --git a/src/gl/unsetenv.c b/src/gl/unsetenv.c
index c58c82f4f4..53721fc440 100644
--- a/src/gl/unsetenv.c
+++ b/src/gl/unsetenv.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 1995-2002, 2005-2013 Free Software Foundation, Inc.
+/* Copyright (C) 1992, 1995-2002, 2005-2014 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
diff --git a/src/gl/verify.h b/src/gl/verify.h
index bf40b028c9..a25e514668 100644
--- a/src/gl/verify.h
+++ b/src/gl/verify.h
@@ -1,6 +1,6 @@
/* Compile-time assert-like macros.
- Copyright (C) 2005-2006, 2009-2013 Free Software Foundation, Inc.
+ Copyright (C) 2005-2006, 2009-2014 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
diff --git a/src/gl/xalloc-die.c b/src/gl/xalloc-die.c
index daa403b9c8..7bdd2a3113 100644
--- a/src/gl/xalloc-die.c
+++ b/src/gl/xalloc-die.c
@@ -1,6 +1,6 @@
/* Report a memory allocation failure and exit.
- Copyright (C) 1997-2000, 2002-2004, 2006, 2009-2013 Free Software
+ Copyright (C) 1997-2000, 2002-2004, 2006, 2009-2014 Free Software
Foundation, Inc.
This program is free software: you can redistribute it and/or modify
diff --git a/src/gl/xalloc-oversized.h b/src/gl/xalloc-oversized.h
index a971c78ad3..f3329228ec 100644
--- a/src/gl/xalloc-oversized.h
+++ b/src/gl/xalloc-oversized.h
@@ -1,6 +1,6 @@
/* xalloc-oversized.h -- memory allocation size checking
- Copyright (C) 1990-2000, 2003-2004, 2006-2013 Free Software Foundation, Inc.
+ Copyright (C) 1990-2000, 2003-2004, 2006-2014 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
diff --git a/src/gl/xalloc.h b/src/gl/xalloc.h
index 6c9b53bf6f..3f6b5b80f8 100644
--- a/src/gl/xalloc.h
+++ b/src/gl/xalloc.h
@@ -1,6 +1,6 @@
/* xalloc.h -- malloc with out-of-memory checking
- Copyright (C) 1990-2000, 2003-2004, 2006-2013 Free Software Foundation, Inc.
+ Copyright (C) 1990-2000, 2003-2004, 2006-2014 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
@@ -64,7 +64,7 @@ void *xrealloc (void *p, size_t s)
_GL_ATTRIBUTE_ALLOC_SIZE ((2));
void *x2realloc (void *p, size_t *pn);
void *xmemdup (void const *p, size_t s)
- _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_ALLOC_SIZE ((2));
+ _GL_ATTRIBUTE_ALLOC_SIZE ((2));
char *xstrdup (char const *str)
_GL_ATTRIBUTE_MALLOC;
@@ -122,10 +122,9 @@ xnrealloc (void *p, size_t n, size_t s)
/* If P is null, allocate a block of at least *PN such objects;
otherwise, reallocate P so that it contains more than *PN objects
- each of S bytes. *PN must be nonzero unless P is null, and S must
- be nonzero. Set *PN to the new number of objects, and return the
- pointer to the new block. *PN is never set to zero, and the
- returned pointer is never null.
+ each of S bytes. S must be nonzero. Set *PN to the new number of
+ objects, and return the pointer to the new block. *PN is never set
+ to zero, and the returned pointer is never null.
Repeated reallocations are guaranteed to make progress, either by
allocating an initial block with a nonzero size, or by allocating a
@@ -196,13 +195,13 @@ x2nrealloc (void *p, size_t *pn, size_t s)
}
else
{
- /* Set N = ceil (1.5 * N) so that progress is made if N == 1.
+ /* Set N = floor (1.5 * N) + 1 so that progress is made even if N == 0.
Check for overflow, so that N * S stays in size_t range.
- The check is slightly conservative, but an exact check isn't
+ The check may be slightly conservative, but an exact check isn't
worth the trouble. */
if ((size_t) -1 / 3 * 2 / s <= n)
xalloc_die ();
- n += (n + 1) / 2;
+ n += n / 2 + 1;
}
*pn = n;
diff --git a/src/gl/xmalloc.c b/src/gl/xmalloc.c
index 57e34b7cdb..264d44afd4 100644
--- a/src/gl/xmalloc.c
+++ b/src/gl/xmalloc.c
@@ -1,6 +1,6 @@
/* xmalloc.c -- malloc with out of memory checking
- Copyright (C) 1990-2000, 2002-2006, 2008-2013 Free Software Foundation, Inc.
+ Copyright (C) 1990-2000, 2002-2006, 2008-2014 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