texinfo-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[7726] gnulib update


From: gavinsmith0123
Subject: [7726] gnulib update
Date: Fri, 14 Apr 2017 13:20:50 -0400 (EDT)

Revision: 7726
          http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=7726
Author:   gavin
Date:     2017-04-14 13:20:48 -0400 (Fri, 14 Apr 2017)
Log Message:
-----------
gnulib update

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/build-aux/config.rpath
    trunk/gnulib/lib/Makefile.am
    trunk/gnulib/lib/alloca.in.h
    trunk/gnulib/lib/argz.c
    trunk/gnulib/lib/argz.in.h
    trunk/gnulib/lib/asnprintf.c
    trunk/gnulib/lib/asprintf.c
    trunk/gnulib/lib/btowc.c
    trunk/gnulib/lib/config.charset
    trunk/gnulib/lib/errno.in.h
    trunk/gnulib/lib/error.c
    trunk/gnulib/lib/error.h
    trunk/gnulib/lib/exitfail.c
    trunk/gnulib/lib/exitfail.h
    trunk/gnulib/lib/float+.h
    trunk/gnulib/lib/float.c
    trunk/gnulib/lib/float.in.h
    trunk/gnulib/lib/getopt.c
    trunk/gnulib/lib/getopt.in.h
    trunk/gnulib/lib/getopt1.c
    trunk/gnulib/lib/getopt_int.h
    trunk/gnulib/lib/gettext.h
    trunk/gnulib/lib/glthread/lock.c
    trunk/gnulib/lib/glthread/lock.h
    trunk/gnulib/lib/glthread/threadlib.c
    trunk/gnulib/lib/hard-locale.c
    trunk/gnulib/lib/hard-locale.h
    trunk/gnulib/lib/intprops.h
    trunk/gnulib/lib/iswblank.c
    trunk/gnulib/lib/itold.c
    trunk/gnulib/lib/langinfo.in.h
    trunk/gnulib/lib/localcharset.c
    trunk/gnulib/lib/localcharset.h
    trunk/gnulib/lib/locale.in.h
    trunk/gnulib/lib/localeconv.c
    trunk/gnulib/lib/malloc.c
    trunk/gnulib/lib/malloca.c
    trunk/gnulib/lib/malloca.h
    trunk/gnulib/lib/mbchar.c
    trunk/gnulib/lib/mbchar.h
    trunk/gnulib/lib/mbiter.h
    trunk/gnulib/lib/mbrtowc.c
    trunk/gnulib/lib/mbscasecmp.c
    trunk/gnulib/lib/mbschr.c
    trunk/gnulib/lib/mbsinit.c
    trunk/gnulib/lib/mbslen.c
    trunk/gnulib/lib/mbsncasecmp.c
    trunk/gnulib/lib/mbsstr.c
    trunk/gnulib/lib/mbswidth.c
    trunk/gnulib/lib/mbswidth.h
    trunk/gnulib/lib/mbtowc-impl.h
    trunk/gnulib/lib/mbtowc.c
    trunk/gnulib/lib/mbuiter.h
    trunk/gnulib/lib/memchr.c
    trunk/gnulib/lib/mempcpy.c
    trunk/gnulib/lib/memrchr.c
    trunk/gnulib/lib/msvc-inval.c
    trunk/gnulib/lib/msvc-inval.h
    trunk/gnulib/lib/msvc-nothrow.c
    trunk/gnulib/lib/msvc-nothrow.h
    trunk/gnulib/lib/nl_langinfo.c
    trunk/gnulib/lib/printf-args.c
    trunk/gnulib/lib/printf-args.h
    trunk/gnulib/lib/printf-parse.c
    trunk/gnulib/lib/printf-parse.h
    trunk/gnulib/lib/ref-add.sin
    trunk/gnulib/lib/ref-del.sin
    trunk/gnulib/lib/regcomp.c
    trunk/gnulib/lib/regex.c
    trunk/gnulib/lib/regex.h
    trunk/gnulib/lib/regex_internal.c
    trunk/gnulib/lib/regex_internal.h
    trunk/gnulib/lib/regexec.c
    trunk/gnulib/lib/size_max.h
    trunk/gnulib/lib/stdarg.in.h
    trunk/gnulib/lib/stdbool.in.h
    trunk/gnulib/lib/stddef.in.h
    trunk/gnulib/lib/stdint.in.h
    trunk/gnulib/lib/stdio.in.h
    trunk/gnulib/lib/stdlib.in.h
    trunk/gnulib/lib/stpcpy.c
    trunk/gnulib/lib/str-kmp.h
    trunk/gnulib/lib/str-two-way.h
    trunk/gnulib/lib/strcasecmp.c
    trunk/gnulib/lib/strcasestr.c
    trunk/gnulib/lib/strdup.c
    trunk/gnulib/lib/streq.h
    trunk/gnulib/lib/strerror-override.c
    trunk/gnulib/lib/strerror-override.h
    trunk/gnulib/lib/strerror.c
    trunk/gnulib/lib/string.in.h
    trunk/gnulib/lib/strings.in.h
    trunk/gnulib/lib/strncasecmp.c
    trunk/gnulib/lib/strndup.c
    trunk/gnulib/lib/strnlen.c
    trunk/gnulib/lib/strnlen1.c
    trunk/gnulib/lib/strnlen1.h
    trunk/gnulib/lib/strstr.c
    trunk/gnulib/lib/sys_types.in.h
    trunk/gnulib/lib/unistd.in.h
    trunk/gnulib/lib/unitypes.in.h
    trunk/gnulib/lib/uniwidth/cjk.h
    trunk/gnulib/lib/uniwidth/width.c
    trunk/gnulib/lib/uniwidth.in.h
    trunk/gnulib/lib/vasnprintf.c
    trunk/gnulib/lib/vasnprintf.h
    trunk/gnulib/lib/vasprintf.c
    trunk/gnulib/lib/verify.h
    trunk/gnulib/lib/wchar.in.h
    trunk/gnulib/lib/wcrtomb.c
    trunk/gnulib/lib/wctype.in.h
    trunk/gnulib/lib/wcwidth.c
    trunk/gnulib/lib/xalloc-die.c
    trunk/gnulib/lib/xalloc-oversized.h
    trunk/gnulib/lib/xalloc.h
    trunk/gnulib/lib/xmalloc.c
    trunk/gnulib/lib/xsize.h
    trunk/gnulib/m4/00gnulib.m4
    trunk/gnulib/m4/absolute-header.m4
    trunk/gnulib/m4/alloca.m4
    trunk/gnulib/m4/argz.m4
    trunk/gnulib/m4/btowc.m4
    trunk/gnulib/m4/configmake.m4
    trunk/gnulib/m4/eealloc.m4
    trunk/gnulib/m4/errno_h.m4
    trunk/gnulib/m4/error.m4
    trunk/gnulib/m4/exponentd.m4
    trunk/gnulib/m4/extensions.m4
    trunk/gnulib/m4/extern-inline.m4
    trunk/gnulib/m4/fcntl-o.m4
    trunk/gnulib/m4/float_h.m4
    trunk/gnulib/m4/getopt.m4
    trunk/gnulib/m4/glibc2.m4
    trunk/gnulib/m4/glibc21.m4
    trunk/gnulib/m4/gnulib-cache.m4
    trunk/gnulib/m4/gnulib-common.m4
    trunk/gnulib/m4/gnulib-comp.m4
    trunk/gnulib/m4/gnulib-tool.m4
    trunk/gnulib/m4/hard-locale.m4
    trunk/gnulib/m4/iconv.m4
    trunk/gnulib/m4/include_next.m4
    trunk/gnulib/m4/intdiv0.m4
    trunk/gnulib/m4/intmax.m4
    trunk/gnulib/m4/intmax_t.m4
    trunk/gnulib/m4/inttypes-pri.m4
    trunk/gnulib/m4/inttypes_h.m4
    trunk/gnulib/m4/iswblank.m4
    trunk/gnulib/m4/langinfo_h.m4
    trunk/gnulib/m4/lib-ld.m4
    trunk/gnulib/m4/lib-link.m4
    trunk/gnulib/m4/lib-prefix.m4
    trunk/gnulib/m4/libunistring-base.m4
    trunk/gnulib/m4/localcharset.m4
    trunk/gnulib/m4/locale-fr.m4
    trunk/gnulib/m4/locale-ja.m4
    trunk/gnulib/m4/locale-zh.m4
    trunk/gnulib/m4/locale_h.m4
    trunk/gnulib/m4/localeconv.m4
    trunk/gnulib/m4/lock.m4
    trunk/gnulib/m4/longlong.m4
    trunk/gnulib/m4/malloc.m4
    trunk/gnulib/m4/malloca.m4
    trunk/gnulib/m4/math_h.m4
    trunk/gnulib/m4/mbchar.m4
    trunk/gnulib/m4/mbiter.m4
    trunk/gnulib/m4/mbrtowc.m4
    trunk/gnulib/m4/mbsinit.m4
    trunk/gnulib/m4/mbslen.m4
    trunk/gnulib/m4/mbstate_t.m4
    trunk/gnulib/m4/mbswidth.m4
    trunk/gnulib/m4/mbtowc.m4
    trunk/gnulib/m4/memchr.m4
    trunk/gnulib/m4/mempcpy.m4
    trunk/gnulib/m4/memrchr.m4
    trunk/gnulib/m4/mmap-anon.m4
    trunk/gnulib/m4/msvc-inval.m4
    trunk/gnulib/m4/msvc-nothrow.m4
    trunk/gnulib/m4/multiarch.m4
    trunk/gnulib/m4/nl_langinfo.m4
    trunk/gnulib/m4/nocrash.m4
    trunk/gnulib/m4/off_t.m4
    trunk/gnulib/m4/onceonly.m4
    trunk/gnulib/m4/printf-posix.m4
    trunk/gnulib/m4/printf.m4
    trunk/gnulib/m4/progtest.m4
    trunk/gnulib/m4/regex.m4
    trunk/gnulib/m4/size_max.m4
    trunk/gnulib/m4/ssize_t.m4
    trunk/gnulib/m4/stdarg.m4
    trunk/gnulib/m4/stdbool.m4
    trunk/gnulib/m4/stddef_h.m4
    trunk/gnulib/m4/stdint.m4
    trunk/gnulib/m4/stdint_h.m4
    trunk/gnulib/m4/stdio_h.m4
    trunk/gnulib/m4/stdlib_h.m4
    trunk/gnulib/m4/stpcpy.m4
    trunk/gnulib/m4/strcase.m4
    trunk/gnulib/m4/strcasestr.m4
    trunk/gnulib/m4/strdup.m4
    trunk/gnulib/m4/strerror.m4
    trunk/gnulib/m4/string_h.m4
    trunk/gnulib/m4/strings_h.m4
    trunk/gnulib/m4/strndup.m4
    trunk/gnulib/m4/strnlen.m4
    trunk/gnulib/m4/strstr.m4
    trunk/gnulib/m4/sys_socket_h.m4
    trunk/gnulib/m4/sys_types_h.m4
    trunk/gnulib/m4/threadlib.m4
    trunk/gnulib/m4/uintmax_t.m4
    trunk/gnulib/m4/unistd_h.m4
    trunk/gnulib/m4/vasnprintf.m4
    trunk/gnulib/m4/vasprintf.m4
    trunk/gnulib/m4/visibility.m4
    trunk/gnulib/m4/warn-on-use.m4
    trunk/gnulib/m4/wchar_h.m4
    trunk/gnulib/m4/wchar_t.m4
    trunk/gnulib/m4/wcrtomb.m4
    trunk/gnulib/m4/wctype_h.m4
    trunk/gnulib/m4/wcwidth.m4
    trunk/gnulib/m4/wint_t.m4
    trunk/gnulib/m4/xalloc.m4
    trunk/gnulib/m4/xsize.m4
    trunk/tp/Texinfo/Convert/XSParagraph/lib/Makefile.am
    trunk/tp/Texinfo/Convert/XSParagraph/lib/alloca.in.h
    trunk/tp/Texinfo/Convert/XSParagraph/lib/asnprintf.c
    trunk/tp/Texinfo/Convert/XSParagraph/lib/asprintf.c
    trunk/tp/Texinfo/Convert/XSParagraph/lib/errno.in.h
    trunk/tp/Texinfo/Convert/XSParagraph/lib/float+.h
    trunk/tp/Texinfo/Convert/XSParagraph/lib/float.c
    trunk/tp/Texinfo/Convert/XSParagraph/lib/float.in.h
    trunk/tp/Texinfo/Convert/XSParagraph/lib/getdelim.c
    trunk/tp/Texinfo/Convert/XSParagraph/lib/getline.c
    trunk/tp/Texinfo/Convert/XSParagraph/lib/itold.c
    trunk/tp/Texinfo/Convert/XSParagraph/lib/memchr.c
    trunk/tp/Texinfo/Convert/XSParagraph/lib/printf-args.c
    trunk/tp/Texinfo/Convert/XSParagraph/lib/printf-args.h
    trunk/tp/Texinfo/Convert/XSParagraph/lib/printf-parse.c
    trunk/tp/Texinfo/Convert/XSParagraph/lib/printf-parse.h
    trunk/tp/Texinfo/Convert/XSParagraph/lib/size_max.h
    trunk/tp/Texinfo/Convert/XSParagraph/lib/stddef.in.h
    trunk/tp/Texinfo/Convert/XSParagraph/lib/stdint.in.h
    trunk/tp/Texinfo/Convert/XSParagraph/lib/stdio.in.h
    trunk/tp/Texinfo/Convert/XSParagraph/lib/string.in.h
    trunk/tp/Texinfo/Convert/XSParagraph/lib/sys_types.in.h
    trunk/tp/Texinfo/Convert/XSParagraph/lib/vasnprintf.c
    trunk/tp/Texinfo/Convert/XSParagraph/lib/vasnprintf.h
    trunk/tp/Texinfo/Convert/XSParagraph/lib/vasprintf.c
    trunk/tp/Texinfo/Convert/XSParagraph/lib/verify.h
    trunk/tp/Texinfo/Convert/XSParagraph/lib/wchar.in.h
    trunk/tp/Texinfo/Convert/XSParagraph/lib/xsize.h
    trunk/tp/Texinfo/Convert/XSParagraph/m4/00gnulib.m4
    trunk/tp/Texinfo/Convert/XSParagraph/m4/absolute-header.m4
    trunk/tp/Texinfo/Convert/XSParagraph/m4/alloca.m4
    trunk/tp/Texinfo/Convert/XSParagraph/m4/errno_h.m4
    trunk/tp/Texinfo/Convert/XSParagraph/m4/exponentd.m4
    trunk/tp/Texinfo/Convert/XSParagraph/m4/extensions.m4
    trunk/tp/Texinfo/Convert/XSParagraph/m4/extern-inline.m4
    trunk/tp/Texinfo/Convert/XSParagraph/m4/float_h.m4
    trunk/tp/Texinfo/Convert/XSParagraph/m4/getdelim.m4
    trunk/tp/Texinfo/Convert/XSParagraph/m4/getline.m4
    trunk/tp/Texinfo/Convert/XSParagraph/m4/gnulib-cache.m4
    trunk/tp/Texinfo/Convert/XSParagraph/m4/gnulib-common.m4
    trunk/tp/Texinfo/Convert/XSParagraph/m4/gnulib-comp.m4
    trunk/tp/Texinfo/Convert/XSParagraph/m4/gnulib-tool.m4
    trunk/tp/Texinfo/Convert/XSParagraph/m4/include_next.m4
    trunk/tp/Texinfo/Convert/XSParagraph/m4/intmax_t.m4
    trunk/tp/Texinfo/Convert/XSParagraph/m4/inttypes_h.m4
    trunk/tp/Texinfo/Convert/XSParagraph/m4/longlong.m4
    trunk/tp/Texinfo/Convert/XSParagraph/m4/math_h.m4
    trunk/tp/Texinfo/Convert/XSParagraph/m4/memchr.m4
    trunk/tp/Texinfo/Convert/XSParagraph/m4/mmap-anon.m4
    trunk/tp/Texinfo/Convert/XSParagraph/m4/multiarch.m4
    trunk/tp/Texinfo/Convert/XSParagraph/m4/off_t.m4
    trunk/tp/Texinfo/Convert/XSParagraph/m4/onceonly.m4
    trunk/tp/Texinfo/Convert/XSParagraph/m4/printf.m4
    trunk/tp/Texinfo/Convert/XSParagraph/m4/size_max.m4
    trunk/tp/Texinfo/Convert/XSParagraph/m4/ssize_t.m4
    trunk/tp/Texinfo/Convert/XSParagraph/m4/stddef_h.m4
    trunk/tp/Texinfo/Convert/XSParagraph/m4/stdint.m4
    trunk/tp/Texinfo/Convert/XSParagraph/m4/stdint_h.m4
    trunk/tp/Texinfo/Convert/XSParagraph/m4/stdio_h.m4
    trunk/tp/Texinfo/Convert/XSParagraph/m4/string_h.m4
    trunk/tp/Texinfo/Convert/XSParagraph/m4/sys_types_h.m4
    trunk/tp/Texinfo/Convert/XSParagraph/m4/vasnprintf.m4
    trunk/tp/Texinfo/Convert/XSParagraph/m4/vasprintf.m4
    trunk/tp/Texinfo/Convert/XSParagraph/m4/warn-on-use.m4
    trunk/tp/Texinfo/Convert/XSParagraph/m4/wchar_h.m4
    trunk/tp/Texinfo/Convert/XSParagraph/m4/wchar_t.m4
    trunk/tp/Texinfo/Convert/XSParagraph/m4/wint_t.m4
    trunk/tp/Texinfo/Convert/XSParagraph/m4/xsize.m4

Added Paths:
-----------
    trunk/gnulib/lib/_Noreturn.h
    trunk/gnulib/lib/basename-lgpl.c
    trunk/gnulib/lib/dirname-lgpl.c
    trunk/gnulib/lib/dirname.h
    trunk/gnulib/lib/dosname.h
    trunk/gnulib/lib/getopt-cdefs.in.h
    trunk/gnulib/lib/getopt-core.h
    trunk/gnulib/lib/getopt-ext.h
    trunk/gnulib/lib/getopt-pfx-core.h
    trunk/gnulib/lib/getopt-pfx-ext.h
    trunk/gnulib/lib/getprogname.c
    trunk/gnulib/lib/getprogname.h
    trunk/gnulib/lib/limits.in.h
    trunk/gnulib/lib/stripslash.c
    trunk/gnulib/m4/builtin-expect.m4
    trunk/gnulib/m4/dirname.m4
    trunk/gnulib/m4/double-slash-root.m4
    trunk/gnulib/m4/getprogname.m4
    trunk/gnulib/m4/limits-h.m4
    trunk/gnulib/m4/pthread_rwlock_rdlock.m4
    trunk/tp/Texinfo/Convert/XSParagraph/lib/limits.in.h
    trunk/tp/Texinfo/Convert/XSParagraph/m4/limits-h.m4

Removed Paths:
-------------
    trunk/build-aux/snippet/
    trunk/tp/Texinfo/Convert/XSParagraph/snippet/

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog     2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/ChangeLog     2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,10 @@
 2017-04-14  Gavin Smith  <address@hidden>
 
+       * tp/Texinfo/Convert/XSParagraph: Run gnulib-tool --add-import.
+       * (top-level): Run gnulib-tool --add-import.
+
+2017-04-14  Gavin Smith  <address@hidden>
+
        * po_document/LINGUAS: Add cs, da.
 
 2017-04-14  Gavin Smith  <address@hidden>

Modified: trunk/build-aux/config.rpath
===================================================================
--- trunk/build-aux/config.rpath        2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/build-aux/config.rpath        2017-04-14 17:20:48 UTC (rev 7726)
@@ -2,7 +2,7 @@
 # Output a system dependent set of variables, describing how to set the
 # run time search path of shared libraries in an executable.
 #
-#   Copyright 1996-2016 Free Software Foundation, Inc.
+#   Copyright 1996-2017 Free Software Foundation, Inc.
 #   Taken from GNU libtool, 2001
 #   Originally by Gordon Matzigkeit <address@hidden>, 1996
 #

Modified: trunk/gnulib/lib/Makefile.am
===================================================================
--- trunk/gnulib/lib/Makefile.am        2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/Makefile.am        2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,6 +1,6 @@
 ## DO NOT EDIT! GENERATED AUTOMATICALLY!
 ## Process this file with automake to produce Makefile.in.
-# Copyright (C) 2002-2016 Free Software Foundation, Inc.
+# Copyright (C) 2002-2017 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
@@ -37,6 +37,7 @@
 CLEANFILES =
 DISTCLEANFILES =
 MAINTAINERCLEANFILES =
+# No GNU Make output.
 
 AM_CPPFLAGS =
 AM_CFLAGS =
@@ -163,6 +164,21 @@
 endif
 ## end   gnulib module configmake
 
+## begin gnulib module dirname-lgpl
+
+libgnu_a_SOURCES += dirname-lgpl.c basename-lgpl.c stripslash.c
+
+EXTRA_DIST += dirname.h
+
+## end   gnulib module dirname-lgpl
+
+## begin gnulib module dosname
+
+
+EXTRA_DIST += dosname.h
+
+## end   gnulib module dosname
+
 ## begin gnulib module errno
 
 BUILT_SOURCES += $(ERRNO_H)
@@ -247,11 +263,11 @@
 
 ## begin gnulib module getopt-posix
 
-BUILT_SOURCES += $(GETOPT_H)
+BUILT_SOURCES += $(GETOPT_H) $(GETOPT_CDEFS_H)
 
 # We need the following in order to create <getopt.h> when the system
 # doesn't have one that works with the given compiler.
-getopt.h: getopt.in.h $(top_builddir)/config.status $(ARG_NONNULL_H)
+getopt.h: getopt.in.h $(top_builddir)/config.status
        $(AM_V_GEN)rm -f address@hidden $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
          sed -e 's|@''GUARD_PREFIX''@|GL|g' \
@@ -264,14 +280,29 @@
              < $(srcdir)/getopt.in.h; \
        } > address@hidden && \
        mv -f address@hidden $@
-MOSTLYCLEANFILES += getopt.h getopt.h-t
 
-EXTRA_DIST += getopt.c getopt.in.h getopt1.c getopt_int.h
+getopt-cdefs.h: getopt-cdefs.in.h $(top_builddir)/config.status
+       $(AM_V_GEN)rm -f address@hidden $@ && \
+       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+          sed -e 's|@''HAVE_SYS_CDEFS_H''@|$(HAVE_SYS_CDEFS_H)|g' \
+             < $(srcdir)/getopt-cdefs.in.h; \
+       } > address@hidden && \
+       mv -f address@hidden $@
 
+MOSTLYCLEANFILES += getopt.h getopt.h-t getopt-cdefs.h getopt-cdefs.h-t
+
+EXTRA_DIST += getopt-cdefs.in.h getopt-core.h getopt-ext.h getopt-pfx-core.h 
getopt-pfx-ext.h getopt.c getopt.in.h getopt1.c getopt_int.h
+
 EXTRA_libgnu_a_SOURCES += getopt.c getopt1.c
 
 ## end   gnulib module getopt-posix
 
+## begin gnulib module getprogname
+
+libgnu_a_SOURCES += getprogname.h getprogname.c
+
+## end   gnulib module getprogname
+
 ## begin gnulib module gettext
 
 # If your project uses "gettextize --intl" to put a source-code
@@ -365,6 +396,34 @@
 
 ## end   gnulib module langinfo
 
+## begin gnulib module limits-h
+
+BUILT_SOURCES += $(LIMITS_H)
+
+# We need the following in order to create <limits.h> when the system
+# doesn't have one that is compatible with GNU.
+if GL_GENERATE_LIMITS_H
+limits.h: limits.in.h $(top_builddir)/config.status
+       $(AM_V_GEN)rm -f address@hidden $@ && \
+       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
+         sed -e 's|@''GUARD_PREFIX''@|GL|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_LIMITS_H''@|$(NEXT_LIMITS_H)|g' \
+             < $(srcdir)/limits.in.h; \
+       } > address@hidden && \
+       mv address@hidden $@
+else
+limits.h: $(top_builddir)/config.status
+       rm -f $@
+endif
+MOSTLYCLEANFILES += limits.h limits.h-t
+
+EXTRA_DIST += limits.in.h
+
+## end   gnulib module limits-h
+
 ## begin gnulib module localcharset
 
 if gl_GNULIB_ENABLED_localcharset
@@ -499,9 +558,7 @@
 
 ## begin gnulib module malloc-posix
 
-if gl_GNULIB_ENABLED_ef455225c00f5049c808c2eda3e76866
 
-endif
 EXTRA_DIST += malloc.c
 
 EXTRA_libgnu_a_SOURCES += malloc.c
@@ -685,81 +742,48 @@
 ## begin gnulib module snippet/_Noreturn
 
 # Because this Makefile snippet defines a variable used by other
-# gnulib Makefile snippets, it must be present in all Makefile.am that
+# gnulib Makefile snippets, it must be present in all makefiles that
 # need it. This is ensured by the applicability 'all' defined above.
 
-_NORETURN_H=$(top_srcdir)/build-aux/snippet/_Noreturn.h
+_NORETURN_H=$(srcdir)/_Noreturn.h
 
-EXTRA_DIST += $(top_srcdir)/build-aux/snippet/_Noreturn.h
+EXTRA_DIST += _Noreturn.h
 
 ## end   gnulib module snippet/_Noreturn
 
 ## begin gnulib module snippet/arg-nonnull
 
-# The BUILT_SOURCES created by this Makefile snippet are not used via #include
-# statements but through direct file reference. Therefore this snippet must be
-# present in all Makefile.am that need it. This is ensured by the applicability
-# 'all' defined above.
+# Because this Makefile snippet defines a variable used by other
+# gnulib Makefile snippets, it must be present in all makefiles that
+# need it. This is ensured by the applicability 'all' defined above.
 
-BUILT_SOURCES += arg-nonnull.h
-# The arg-nonnull.h that gets inserted into generated .h files is the same as
-# build-aux/snippet/arg-nonnull.h, except that it has the copyright header cut
-# off.
-arg-nonnull.h: $(top_srcdir)/build-aux/snippet/arg-nonnull.h
-       $(AM_V_GEN)rm -f address@hidden $@ && \
-       sed -n -e '/GL_ARG_NONNULL/,$$p' \
-         < $(top_srcdir)/build-aux/snippet/arg-nonnull.h \
-         > address@hidden && \
-       mv address@hidden $@
-MOSTLYCLEANFILES += arg-nonnull.h arg-nonnull.h-t
+ARG_NONNULL_H=$(srcdir)/arg-nonnull.h
 
-ARG_NONNULL_H=arg-nonnull.h
+EXTRA_DIST += arg-nonnull.h
 
-EXTRA_DIST += $(top_srcdir)/build-aux/snippet/arg-nonnull.h
-
 ## end   gnulib module snippet/arg-nonnull
 
 ## begin gnulib module snippet/c++defs
 
-# The BUILT_SOURCES created by this Makefile snippet are not used via #include
-# statements but through direct file reference. Therefore this snippet must be
-# present in all Makefile.am that need it. This is ensured by the applicability
-# 'all' defined above.
+# Because this Makefile snippet defines a variable used by other
+# gnulib Makefile snippets, it must be present in all makefiles that
+# need it. This is ensured by the applicability 'all' defined above.
 
-BUILT_SOURCES += c++defs.h
-# The c++defs.h that gets inserted into generated .h files is the same as
-# build-aux/snippet/c++defs.h, except that it has the copyright header cut off.
-c++defs.h: $(top_srcdir)/build-aux/snippet/c++defs.h
-       $(AM_V_GEN)rm -f address@hidden $@ && \
-       sed -n -e '/_GL_CXXDEFS/,$$p' \
-         < $(top_srcdir)/build-aux/snippet/c++defs.h \
-         > address@hidden && \
-       mv address@hidden $@
-MOSTLYCLEANFILES += c++defs.h c++defs.h-t
+CXXDEFS_H=$(srcdir)/c++defs.h
 
-CXXDEFS_H=c++defs.h
+EXTRA_DIST += c++defs.h
 
-EXTRA_DIST += $(top_srcdir)/build-aux/snippet/c++defs.h
-
 ## end   gnulib module snippet/c++defs
 
 ## begin gnulib module snippet/warn-on-use
 
-BUILT_SOURCES += warn-on-use.h
-# The warn-on-use.h that gets inserted into generated .h files is the same as
-# build-aux/snippet/warn-on-use.h, except that it has the copyright header cut
-# off.
-warn-on-use.h: $(top_srcdir)/build-aux/snippet/warn-on-use.h
-       $(AM_V_GEN)rm -f address@hidden $@ && \
-       sed -n -e '/^.ifndef/,$$p' \
-         < $(top_srcdir)/build-aux/snippet/warn-on-use.h \
-         > address@hidden && \
-       mv address@hidden $@
-MOSTLYCLEANFILES += warn-on-use.h warn-on-use.h-t
+# Because this Makefile snippet defines a variable used by other
+# gnulib Makefile snippets, it must be present in all makefiles that
+# need it. This is ensured by the applicability 'all' defined above.
 
-WARN_ON_USE_H=warn-on-use.h
+WARN_ON_USE_H=$(srcdir)/warn-on-use.h
 
-EXTRA_DIST += $(top_srcdir)/build-aux/snippet/warn-on-use.h
+EXTRA_DIST += warn-on-use.h
 
 ## end   gnulib module snippet/warn-on-use
 
@@ -861,6 +885,7 @@
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
              -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
              -e 's|@''NEXT_STDINT_H''@|$(NEXT_STDINT_H)|g' \
+             -e 's/@''HAVE_C99_STDINT_H''@/$(HAVE_C99_STDINT_H)/g' \
              -e 's/@''HAVE_SYS_TYPES_H''@/$(HAVE_SYS_TYPES_H)/g' \
              -e 's/@''HAVE_INTTYPES_H''@/$(HAVE_INTTYPES_H)/g' \
              -e 's/@''HAVE_SYS_INTTYPES_H''@/$(HAVE_SYS_INTTYPES_H)/g' \
@@ -882,6 +907,7 @@
              -e 's/@''BITSIZEOF_WINT_T''@/$(BITSIZEOF_WINT_T)/g' \
              -e 's/@''HAVE_SIGNED_WINT_T''@/$(HAVE_SIGNED_WINT_T)/g' \
              -e 's/@''WINT_T_SUFFIX''@/$(WINT_T_SUFFIX)/g' \
+             -e 's/@''GNULIB_OVERRIDES_WINT_T''@/$(GNULIB_OVERRIDES_WINT_T)/g' 
\
              < $(srcdir)/stdint.in.h; \
        } > address@hidden && \
        mv address@hidden $@
@@ -1086,6 +1112,7 @@
              -e 's|@''HAVE_POSIX_OPENPT''@|$(HAVE_POSIX_OPENPT)|g' \
              -e 's|@''HAVE_PTSNAME''@|$(HAVE_PTSNAME)|g' \
              -e 's|@''HAVE_PTSNAME_R''@|$(HAVE_PTSNAME_R)|g' \
+             -e 's|@''HAVE_QSORT_R''@|$(HAVE_QSORT_R)|g' \
              -e 's|@''HAVE_RANDOM''@|$(HAVE_RANDOM)|g' \
              -e 's|@''HAVE_RANDOM_H''@|$(HAVE_RANDOM_H)|g' \
              -e 's|@''HAVE_RANDOM_R''@|$(HAVE_RANDOM_R)|g' \
@@ -1476,7 +1503,6 @@
              -e 's|@''HAVE_GETDTABLESIZE''@|$(HAVE_GETDTABLESIZE)|g' \
              -e 's|@''HAVE_GETGROUPS''@|$(HAVE_GETGROUPS)|g' \
              -e 's|@''HAVE_GETHOSTNAME''@|$(HAVE_GETHOSTNAME)|g' \
-             -e 's|@''HAVE_GETLOGIN''@|$(HAVE_GETLOGIN)|g' \
              -e 's|@''HAVE_GETPAGESIZE''@|$(HAVE_GETPAGESIZE)|g' \
              -e 's|@''HAVE_GROUP_MEMBER''@|$(HAVE_GROUP_MEMBER)|g' \
              -e 's|@''HAVE_LCHOWN''@|$(HAVE_LCHOWN)|g' \
@@ -1498,6 +1524,7 @@
              -e 's|@''HAVE_DECL_FCHDIR''@|$(HAVE_DECL_FCHDIR)|g' \
              -e 's|@''HAVE_DECL_FDATASYNC''@|$(HAVE_DECL_FDATASYNC)|g' \
              -e 's|@''HAVE_DECL_GETDOMAINNAME''@|$(HAVE_DECL_GETDOMAINNAME)|g' 
\
+             -e 's|@''HAVE_DECL_GETLOGIN''@|$(HAVE_DECL_GETLOGIN)|g' \
              -e 's|@''HAVE_DECL_GETLOGIN_R''@|$(HAVE_DECL_GETLOGIN_R)|g' \
              -e 's|@''HAVE_DECL_GETPAGESIZE''@|$(HAVE_DECL_GETPAGESIZE)|g' \
              -e 's|@''HAVE_DECL_GETUSERSHELL''@|$(HAVE_DECL_GETUSERSHELL)|g' \
@@ -1635,6 +1662,7 @@
              -e 's|@''HAVE_FEATURES_H''@|$(HAVE_FEATURES_H)|g' \
              -e 's|@''NEXT_WCHAR_H''@|$(NEXT_WCHAR_H)|g' \
              -e 's|@''HAVE_WCHAR_H''@|$(HAVE_WCHAR_H)|g' \
+             -e 's/@''GNULIB_OVERRIDES_WINT_T''@/$(GNULIB_OVERRIDES_WINT_T)/g' 
\
              -e 's/@''GNULIB_BTOWC''@/$(GNULIB_BTOWC)/g' \
              -e 's/@''GNULIB_WCTOB''@/$(GNULIB_WCTOB)/g' \
              -e 's/@''GNULIB_MBSINIT''@/$(GNULIB_MBSINIT)/g' \
@@ -1767,6 +1795,7 @@
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
              -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
              -e 's|@''NEXT_WCTYPE_H''@|$(NEXT_WCTYPE_H)|g' \
+             -e 's/@''GNULIB_OVERRIDES_WINT_T''@/$(GNULIB_OVERRIDES_WINT_T)/g' 
\
              -e 's/@''GNULIB_ISWBLANK''@/$(GNULIB_ISWBLANK)/g' \
              -e 's/@''GNULIB_WCTYPE''@/$(GNULIB_WCTYPE)/g' \
              -e 's/@''GNULIB_ISWCTYPE''@/$(GNULIB_ISWCTYPE)/g' \

Added: trunk/gnulib/lib/_Noreturn.h
===================================================================
--- trunk/gnulib/lib/_Noreturn.h                                (rev 0)
+++ trunk/gnulib/lib/_Noreturn.h        2017-04-14 17:20:48 UTC (rev 7726)
@@ -0,0 +1,10 @@
+#if !defined _Noreturn && __STDC_VERSION__ < 201112
+# if (3 <= __GNUC__ || (__GNUC__ == 2 && 8 <= __GNUC_MINOR__) \
+      || 0x5110 <= __SUNPRO_C)
+#  define _Noreturn __attribute__ ((__noreturn__))
+# elif 1200 <= _MSC_VER
+#  define _Noreturn __declspec (noreturn)
+# else
+#  define _Noreturn
+# endif
+#endif

Modified: trunk/gnulib/lib/alloca.in.h
===================================================================
--- trunk/gnulib/lib/alloca.in.h        2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/alloca.in.h        2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,6 +1,6 @@
 /* Memory allocation on the stack.
 
-   Copyright (C) 1995, 1999, 2001-2004, 2006-2016 Free Software Foundation,
+   Copyright (C) 1995, 1999, 2001-2004, 2006-2017 Free Software Foundation,
    Inc.
 
    This program is free software; you can redistribute it and/or modify it

Modified: trunk/gnulib/lib/argz.c
===================================================================
--- trunk/gnulib/lib/argz.c     2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/argz.c     2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 /* Functions for dealing with '\0' separated arg vectors.
-   Copyright (C) 1995-1998, 2000-2002, 2006, 2008-2016 Free Software
+   Copyright (C) 1995-1998, 2000-2002, 2006, 2008-2017 Free Software
    Foundation, Inc.
    This file is part of the GNU C Library.
 

Modified: trunk/gnulib/lib/argz.in.h
===================================================================
--- trunk/gnulib/lib/argz.in.h  2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/argz.in.h  2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 /* Routines for dealing with '\0' separated arg vectors.
-   Copyright (C) 1995-2000, 2004, 2007, 2009-2016 Free Software Foundation,
+   Copyright (C) 1995-2000, 2004, 2007, 2009-2017 Free Software Foundation,
    Inc.
    This file is part of the GNU C Library.
 

Modified: trunk/gnulib/lib/asnprintf.c
===================================================================
--- trunk/gnulib/lib/asnprintf.c        2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/asnprintf.c        2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 /* Formatted output to strings.
-   Copyright (C) 1999, 2002, 2006, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2002, 2006, 2009-2017 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

Modified: trunk/gnulib/lib/asprintf.c
===================================================================
--- trunk/gnulib/lib/asprintf.c 2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/asprintf.c 2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 /* Formatted output to strings.
-   Copyright (C) 1999, 2002, 2006-2007, 2009-2016 Free Software Foundation,
+   Copyright (C) 1999, 2002, 2006-2007, 2009-2017 Free Software Foundation,
    Inc.
 
    This program is free software; you can redistribute it and/or modify

Added: trunk/gnulib/lib/basename-lgpl.c
===================================================================
--- trunk/gnulib/lib/basename-lgpl.c                            (rev 0)
+++ trunk/gnulib/lib/basename-lgpl.c    2017-04-14 17:20:48 UTC (rev 7726)
@@ -0,0 +1,75 @@
+/* basename.c -- return the last element in a file name
+
+   Copyright (C) 1990, 1998-2001, 2003-2006, 2009-2017 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 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU 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/>.  */
+
+#include <config.h>
+
+#include "dirname.h"
+
+#include <string.h>
+
+/* Return the address of the last file name component of NAME.  If
+   NAME has no relative file name components because it is a file
+   system root, return the empty string.  */
+
+char *
+last_component (char const *name)
+{
+  char const *base = name + FILE_SYSTEM_PREFIX_LEN (name);
+  char const *p;
+  bool saw_slash = false;
+
+  while (ISSLASH (*base))
+    base++;
+
+  for (p = base; *p; p++)
+    {
+      if (ISSLASH (*p))
+        saw_slash = true;
+      else if (saw_slash)
+        {
+          base = p;
+          saw_slash = false;
+        }
+    }
+
+  return (char *) base;
+}
+
+/* Return the length of the basename NAME.  Typically NAME is the
+   value returned by base_name or last_component.  Act like strlen
+   (NAME), except omit all trailing slashes.  */
+
+size_t
+base_len (char const *name)
+{
+  size_t len;
+  size_t prefix_len = FILE_SYSTEM_PREFIX_LEN (name);
+
+  for (len = strlen (name);  1 < len && ISSLASH (name[len - 1]);  len--)
+    continue;
+
+  if (DOUBLE_SLASH_IS_DISTINCT_ROOT && len == 1
+      && ISSLASH (name[0]) && ISSLASH (name[1]) && ! name[2])
+    return 2;
+
+  if (FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE && prefix_len
+      && len == prefix_len && ISSLASH (name[prefix_len]))
+    return prefix_len + 1;
+
+  return len;
+}

Modified: trunk/gnulib/lib/btowc.c
===================================================================
--- trunk/gnulib/lib/btowc.c    2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/btowc.c    2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 /* Convert unibyte character to wide character.
-   Copyright (C) 2008, 2010-2016 Free Software Foundation, Inc.
+   Copyright (C) 2008, 2010-2017 Free Software Foundation, Inc.
    Written by Bruno Haible <address@hidden>, 2008.
 
    This program is free software: you can redistribute it and/or modify

Modified: trunk/gnulib/lib/config.charset
===================================================================
--- trunk/gnulib/lib/config.charset     2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/config.charset     2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,7 +1,7 @@
 #! /bin/sh
 # Output a system dependent table of character encoding aliases.
 #
-#   Copyright (C) 2000-2004, 2006-2016 Free Software Foundation, Inc.
+#   Copyright (C) 2000-2004, 2006-2017 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

Added: trunk/gnulib/lib/dirname-lgpl.c
===================================================================
--- trunk/gnulib/lib/dirname-lgpl.c                             (rev 0)
+++ trunk/gnulib/lib/dirname-lgpl.c     2017-04-14 17:20:48 UTC (rev 7726)
@@ -0,0 +1,86 @@
+/* dirname.c -- return all but the last element in a file name
+
+   Copyright (C) 1990, 1998, 2000-2001, 2003-2006, 2009-2017 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 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU 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/>.  */
+
+#include <config.h>
+
+#include "dirname.h"
+
+#include <stdlib.h>
+#include <string.h>
+
+/* Return the length of the prefix of FILE that will be used by
+   dir_name.  If FILE is in the working directory, this returns zero
+   even though 'dir_name (FILE)' will return ".".  Works properly even
+   if there are trailing slashes (by effectively ignoring them).  */
+
+size_t
+dir_len (char const *file)
+{
+  size_t prefix_length = FILE_SYSTEM_PREFIX_LEN (file);
+  size_t length;
+
+  /* Advance prefix_length beyond important leading slashes.  */
+  prefix_length += (prefix_length != 0
+                    ? (FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE
+                       && ISSLASH (file[prefix_length]))
+                    : (ISSLASH (file[0])
+                       ? ((DOUBLE_SLASH_IS_DISTINCT_ROOT
+                           && ISSLASH (file[1]) && ! ISSLASH (file[2])
+                           ? 2 : 1))
+                       : 0));
+
+  /* Strip the basename and any redundant slashes before it.  */
+  for (length = last_component (file) - file;
+       prefix_length < length; length--)
+    if (! ISSLASH (file[length - 1]))
+      break;
+  return length;
+}
+
+
+/* In general, we can't use the builtin 'dirname' function if available,
+   since it has different meanings in different environments.
+   In some environments the builtin 'dirname' modifies its argument.
+
+   Return the leading directories part of FILE, allocated with malloc.
+   Works properly even if there are trailing slashes (by effectively
+   ignoring them).  Return NULL on failure.
+
+   If lstat (FILE) would succeed, then { chdir (dir_name (FILE));
+   lstat (base_name (FILE)); } will access the same file.  Likewise,
+   if the sequence { chdir (dir_name (FILE));
+   rename (base_name (FILE), "foo"); } succeeds, you have renamed FILE
+   to "foo" in the same directory FILE was in.  */
+
+char *
+mdir_name (char const *file)
+{
+  size_t length = dir_len (file);
+  bool append_dot = (length == 0
+                     || (FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE
+                         && length == FILE_SYSTEM_PREFIX_LEN (file)
+                         && file[2] != '\0' && ! ISSLASH (file[2])));
+  char *dir = malloc (length + append_dot + 1);
+  if (!dir)
+    return NULL;
+  memcpy (dir, file, length);
+  if (append_dot)
+    dir[length++] = '.';
+  dir[length] = '\0';
+  return dir;
+}

Added: trunk/gnulib/lib/dirname.h
===================================================================
--- trunk/gnulib/lib/dirname.h                          (rev 0)
+++ trunk/gnulib/lib/dirname.h  2017-04-14 17:20:48 UTC (rev 7726)
@@ -0,0 +1,54 @@
+/*  Take file names apart into directory and base names.
+
+    Copyright (C) 1998, 2001, 2003-2006, 2009-2017 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 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU 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/>.  */
+
+#ifndef DIRNAME_H_
+# define DIRNAME_H_ 1
+
+# include <stdbool.h>
+# include <stddef.h>
+# include "dosname.h"
+
+# ifndef DIRECTORY_SEPARATOR
+#  define DIRECTORY_SEPARATOR '/'
+# endif
+
+# ifndef DOUBLE_SLASH_IS_DISTINCT_ROOT
+#  define DOUBLE_SLASH_IS_DISTINCT_ROOT 0
+# endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+# if GNULIB_DIRNAME
+char *base_name (char const *file);
+char *dir_name (char const *file);
+# endif
+
+char *mdir_name (char const *file);
+size_t base_len (char const *file) _GL_ATTRIBUTE_PURE;
+size_t dir_len (char const *file) _GL_ATTRIBUTE_PURE;
+char *last_component (char const *file) _GL_ATTRIBUTE_PURE;
+
+bool strip_trailing_slashes (char *file);
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /* not DIRNAME_H_ */

Added: trunk/gnulib/lib/dosname.h
===================================================================
--- trunk/gnulib/lib/dosname.h                          (rev 0)
+++ trunk/gnulib/lib/dosname.h  2017-04-14 17:20:48 UTC (rev 7726)
@@ -0,0 +1,53 @@
+/* File names on MS-DOS/Windows systems.
+
+   Copyright (C) 2000-2001, 2004-2006, 2009-2017 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 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU 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/>.
+
+   From Paul Eggert and Jim Meyering.  */
+
+#ifndef _DOSNAME_H
+#define _DOSNAME_H
+
+#if (defined _WIN32 || defined __WIN32__ ||     \
+     defined __MSDOS__ || defined __CYGWIN__ || \
+     defined __EMX__ || defined __DJGPP__)
+   /* This internal macro assumes ASCII, but all hosts that support drive
+      letters use ASCII.  */
+# define _IS_DRIVE_LETTER(C) (((unsigned int) (C) | ('a' - 'A')) - 'a'  \
+                              <= 'z' - 'a')
+# define FILE_SYSTEM_PREFIX_LEN(Filename) \
+          (_IS_DRIVE_LETTER ((Filename)[0]) && (Filename)[1] == ':' ? 2 : 0)
+# ifndef __CYGWIN__
+#  define FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE 1
+# endif
+# define ISSLASH(C) ((C) == '/' || (C) == '\\')
+#else
+# define FILE_SYSTEM_PREFIX_LEN(Filename) 0
+# define ISSLASH(C) ((C) == '/')
+#endif
+
+#ifndef FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE
+# define FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE 0
+#endif
+
+#if FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE
+#  define IS_ABSOLUTE_FILE_NAME(F) ISSLASH ((F)[FILE_SYSTEM_PREFIX_LEN (F)])
+# else
+#  define IS_ABSOLUTE_FILE_NAME(F)                              \
+     (ISSLASH ((F)[0]) || FILE_SYSTEM_PREFIX_LEN (F) != 0)
+#endif
+#define IS_RELATIVE_FILE_NAME(F) (! IS_ABSOLUTE_FILE_NAME (F))
+
+#endif /* DOSNAME_H_ */

Modified: trunk/gnulib/lib/errno.in.h
===================================================================
--- trunk/gnulib/lib/errno.in.h 2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/errno.in.h 2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,6 +1,6 @@
 /* A POSIX-like <errno.h>.
 
-   Copyright (C) 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 2008-2017 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

Modified: trunk/gnulib/lib/error.c
===================================================================
--- trunk/gnulib/lib/error.c    2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/error.c    2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 /* Error handler for noninteractive utilities
-   Copyright (C) 1990-1998, 2000-2007, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 1990-1998, 2000-2007, 2009-2017 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
@@ -42,6 +42,8 @@
 # define USE_UNLOCKED_IO 0
 # define _GL_ATTRIBUTE_FORMAT_PRINTF(a, b)
 # define _GL_ARG_NONNULL(a)
+#else
+# include "getprogname.h"
 #endif
 
 #if USE_UNLOCKED_IO
@@ -113,9 +115,7 @@
 #  endif
 # endif
 
-/* The calling program should define program_name and set it to the
-   name of the executing program.  */
-extern char *program_name;
+#define program_name getprogname ()
 
 # if HAVE_STRERROR_R || defined strerror_r
 #  define __strerror_r strerror_r

Modified: trunk/gnulib/lib/error.h
===================================================================
--- trunk/gnulib/lib/error.h    2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/error.h    2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 /* Declaration for error-reporting function
-   Copyright (C) 1995-1997, 2003, 2006, 2008-2016 Free Software Foundation,
+   Copyright (C) 1995-1997, 2003, 2006, 2008-2017 Free Software Foundation,
    Inc.
    This file is part of the GNU C Library.
 

Modified: trunk/gnulib/lib/exitfail.c
===================================================================
--- trunk/gnulib/lib/exitfail.c 2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/exitfail.c 2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,6 +1,6 @@
 /* Failure exit status
 
-   Copyright (C) 2002-2003, 2005-2007, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2002-2003, 2005-2007, 2009-2017 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

Modified: trunk/gnulib/lib/exitfail.h
===================================================================
--- trunk/gnulib/lib/exitfail.h 2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/exitfail.h 2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,6 +1,6 @@
 /* Failure exit status
 
-   Copyright (C) 2002, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2009-2017 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

Modified: trunk/gnulib/lib/float+.h
===================================================================
--- trunk/gnulib/lib/float+.h   2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/float+.h   2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 /* Supplemental information about the floating-point formats.
-   Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009-2017 Free Software Foundation, Inc.
    Written by Bruno Haible <address@hidden>, 2007.
 
    This program is free software; you can redistribute it and/or modify

Modified: trunk/gnulib/lib/float.c
===================================================================
--- trunk/gnulib/lib/float.c    2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/float.c    2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 /* Auxiliary definitions for <float.h>.
-   Copyright (C) 2011-2016 Free Software Foundation, Inc.
+   Copyright (C) 2011-2017 Free Software Foundation, Inc.
    Written by Bruno Haible <address@hidden>, 2011.
 
    This program is free software: you can redistribute it and/or modify

Modified: trunk/gnulib/lib/float.in.h
===================================================================
--- trunk/gnulib/lib/float.in.h 2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/float.in.h 2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,6 +1,6 @@
 /* A correct <float.h>.
 
-   Copyright (C) 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007-2017 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

Added: trunk/gnulib/lib/getopt-cdefs.in.h
===================================================================
--- trunk/gnulib/lib/getopt-cdefs.in.h                          (rev 0)
+++ trunk/gnulib/lib/getopt-cdefs.in.h  2017-04-14 17:20:48 UTC (rev 7726)
@@ -0,0 +1,67 @@
+/* getopt-on-non-glibc compatibility macros.
+   Copyright (C) 1989-2017 Free Software Foundation, Inc.
+   This file is part of gnulib.
+   Unlike most of the getopt implementation, it is NOT shared
+   with the GNU C Library.
+
+   gnulib 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 of
+   the License, or (at your option) any later version.
+
+   gnulib 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 gnulib; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef _GETOPT_CDEFS_H
+#define _GETOPT_CDEFS_H 1
+
+/* This header should not be used directly; include getopt.h or
+   unistd.h instead.  It does not have a protective #error, because
+   the guard macro for getopt.h in gnulib is not fixed.  */
+
+/* getopt-core.h and getopt-ext.h are shared with GNU libc, and expect
+   a number of the internal macros supplied to GNU libc's headers by
+   sys/cdefs.h.  Provide fallback definitions for all of them.  */
+#if @HAVE_SYS_CDEFS_H@
+# include <sys/cdefs.h>
+#endif
+
+#ifndef __BEGIN_DECLS
+# ifdef __cplusplus
+#  define __BEGIN_DECLS extern "C" {
+# else
+#  define __BEGIN_DECLS /* nothing */
+# endif
+#endif
+#ifndef __END_DECLS
+# ifdef __cplusplus
+#  define __END_DECLS }
+# else
+#  define __END_DECLS /* nothing */
+# endif
+#endif
+
+#ifndef __GNUC_PREREQ
+# if defined __GNUC__ && defined __GNUC_VERSION__
+# define __GNUC_PREREQ(maj, min) \
+        ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
+# else
+#  define __GNUC_PREREQ(maj, min) 0
+# endif
+#endif
+
+#ifndef __THROW
+# if defined __cplusplus && __GNUC_PREREQ (2,8)
+#  define __THROW       throw ()
+# else
+#  define __THROW
+# endif
+#endif
+
+#endif /* _GETOPT_CDEFS_H */

Added: trunk/gnulib/lib/getopt-core.h
===================================================================
--- trunk/gnulib/lib/getopt-core.h                              (rev 0)
+++ trunk/gnulib/lib/getopt-core.h      2017-04-14 17:20:48 UTC (rev 7726)
@@ -0,0 +1,96 @@
+/* Declarations for getopt (basic, portable features only).
+   Copyright (C) 1989-2017 Free Software Foundation, Inc.
+   This file is part of the GNU C Library and is also part of gnulib.
+   Patches to this file should be submitted to both projects.
+
+   The GNU C Library 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 of the License, or (at your option) any later version.
+
+   The GNU C Library 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 the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef _GETOPT_CORE_H
+#define _GETOPT_CORE_H 1
+
+/* This header should not be used directly; include getopt.h or
+   unistd.h instead.  Unlike most bits headers, it does not have
+   a protective #error, because the guard macro for getopt.h in
+   gnulib is not fixed.  */
+
+__BEGIN_DECLS
+
+/* For communication from 'getopt' to the caller.
+   When 'getopt' finds an option that takes an argument,
+   the argument value is returned here.
+   Also, when 'ordering' is RETURN_IN_ORDER,
+   each non-option ARGV-element is returned here.  */
+
+extern char *optarg;
+
+/* Index in ARGV of the next element to be scanned.
+   This is used for communication to and from the caller
+   and for communication between successive calls to 'getopt'.
+
+   On entry to 'getopt', zero means this is the first call; initialize.
+
+   When 'getopt' returns -1, this is the index of the first of the
+   non-option elements that the caller should itself scan.
+
+   Otherwise, 'optind' communicates from one call to the next
+   how much of ARGV has been scanned so far.  */
+
+extern int optind;
+
+/* Callers store zero here to inhibit the error message 'getopt' prints
+   for unrecognized options.  */
+
+extern int opterr;
+
+/* Set to an option character which was unrecognized.  */
+
+extern int optopt;
+
+/* Get definitions and prototypes for functions to process the
+   arguments in ARGV (ARGC of them, minus the program name) for
+   options given in OPTS.
+
+   Return the option character from OPTS just read.  Return -1 when
+   there are no more options.  For unrecognized options, or options
+   missing arguments, 'optopt' is set to the option letter, and '?' is
+   returned.
+
+   The OPTS string is a list of characters which are recognized option
+   letters, optionally followed by colons, specifying that that letter
+   takes an argument, to be placed in 'optarg'.
+
+   If a letter in OPTS is followed by two colons, its argument is
+   optional.  This behavior is specific to the GNU 'getopt'.
+
+   The argument '--' causes premature termination of argument
+   scanning, explicitly telling 'getopt' that there are no more
+   options.
+
+   If OPTS begins with '-', then non-option arguments are treated as
+   arguments to the option '\1'.  This behavior is specific to the GNU
+   'getopt'.  If OPTS begins with '+', or POSIXLY_CORRECT is set in
+   the environment, then do not permute arguments.
+
+   For standards compliance, the 'argv' argument has the type
+   char *const *, but this is inaccurate; if argument permutation is
+   enabled, the argv array (not the strings it points to) must be
+   writable.  */
+
+extern int getopt (int ___argc, char *const *___argv, const char *__shortopts)
+       __THROW _GL_ARG_NONNULL ((2, 3));
+
+__END_DECLS
+
+#endif /* _GETOPT_CORE_H */

Added: trunk/gnulib/lib/getopt-ext.h
===================================================================
--- trunk/gnulib/lib/getopt-ext.h                               (rev 0)
+++ trunk/gnulib/lib/getopt-ext.h       2017-04-14 17:20:48 UTC (rev 7726)
@@ -0,0 +1,77 @@
+/* Declarations for getopt (GNU extensions).
+   Copyright (C) 1989-2017 Free Software Foundation, Inc.
+   This file is part of the GNU C Library and is also part of gnulib.
+   Patches to this file should be submitted to both projects.
+
+   The GNU C Library 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 of the License, or (at your option) any later version.
+
+   The GNU C Library 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 the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef _GETOPT_EXT_H
+#define _GETOPT_EXT_H 1
+
+/* This header should not be used directly; include getopt.h instead.
+   Unlike most bits headers, it does not have a protective #error,
+   because the guard macro for getopt.h in gnulib is not fixed.  */
+
+__BEGIN_DECLS
+
+/* Describe the long-named options requested by the application.
+   The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector
+   of 'struct option' terminated by an element containing a name which is
+   zero.
+
+   The field 'has_arg' is:
+   no_argument         (or 0) if the option does not take an argument,
+   required_argument   (or 1) if the option requires an argument,
+   optional_argument   (or 2) if the option takes an optional argument.
+
+   If the field 'flag' is not NULL, it points to a variable that is set
+   to the value given in the field 'val' when the option is found, but
+   left unchanged if the option is not found.
+
+   To have a long-named option do something other than set an 'int' to
+   a compiled-in constant, such as set a value from 'optarg', set the
+   option's 'flag' field to zero and its 'val' field to a nonzero
+   value (the equivalent single-letter option character, if there is
+   one).  For long options that have a zero 'flag' field, 'getopt'
+   returns the contents of the 'val' field.  */
+
+struct option
+{
+  const char *name;
+  /* has_arg can't be an enum because some compilers complain about
+     type mismatches in all the code that assumes it is an int.  */
+  int has_arg;
+  int *flag;
+  int val;
+};
+
+/* Names for the values of the 'has_arg' field of 'struct option'.  */
+
+#define no_argument            0
+#define required_argument      1
+#define optional_argument      2
+
+extern int getopt_long (int ___argc, char *__getopt_argv_const *___argv,
+                       const char *__shortopts,
+                       const struct option *__longopts, int *__longind)
+       __THROW _GL_ARG_NONNULL ((2, 3));
+extern int getopt_long_only (int ___argc, char *__getopt_argv_const *___argv,
+                            const char *__shortopts,
+                            const struct option *__longopts, int *__longind)
+       __THROW _GL_ARG_NONNULL ((2, 3));
+
+__END_DECLS
+
+#endif /* _GETOPT_EXT_H */

Added: trunk/gnulib/lib/getopt-pfx-core.h
===================================================================
--- trunk/gnulib/lib/getopt-pfx-core.h                          (rev 0)
+++ trunk/gnulib/lib/getopt-pfx-core.h  2017-04-14 17:20:48 UTC (rev 7726)
@@ -0,0 +1,54 @@
+/* getopt (basic, portable features) gnulib wrapper header.
+   Copyright (C) 1989-2017 Free Software Foundation, Inc.
+   This file is part of gnulib.
+   Unlike most of the getopt implementation, it is NOT shared
+   with the GNU C Library.
+
+   gnulib 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 of
+   the License, or (at your option) any later version.
+
+   gnulib 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 gnulib; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef _GETOPT_PFX_CORE_H
+#define _GETOPT_PFX_CORE_H 1
+
+/* This header should not be used directly; include getopt.h or
+   unistd.h instead.  It does not have a protective #error, because
+   the guard macro for getopt.h in gnulib is not fixed.  */
+
+/* Standalone applications should #define __GETOPT_PREFIX to an
+   identifier that prefixes the external functions and variables
+   defined in getopt-core.h and getopt-ext.h.  Systematically
+   rename identifiers so that they do not collide with the system
+   functions and variables.  Renaming avoids problems with some
+   compilers and linkers.  */
+#ifdef __GETOPT_PREFIX
+# ifndef __GETOPT_ID
+#  define __GETOPT_CONCAT(x, y) x ## y
+#  define __GETOPT_XCONCAT(x, y) __GETOPT_CONCAT (x, y)
+#  define __GETOPT_ID(y) __GETOPT_XCONCAT (__GETOPT_PREFIX, y)
+# endif
+# undef getopt
+# undef optarg
+# undef opterr
+# undef optind
+# undef optopt
+# define getopt __GETOPT_ID (getopt)
+# define optarg __GETOPT_ID (optarg)
+# define opterr __GETOPT_ID (opterr)
+# define optind __GETOPT_ID (optind)
+# define optopt __GETOPT_ID (optopt)
+#endif
+
+#include <getopt-core.h>
+
+#endif /* _GETOPT_PFX_CORE_H */

Added: trunk/gnulib/lib/getopt-pfx-ext.h
===================================================================
--- trunk/gnulib/lib/getopt-pfx-ext.h                           (rev 0)
+++ trunk/gnulib/lib/getopt-pfx-ext.h   2017-04-14 17:20:48 UTC (rev 7726)
@@ -0,0 +1,64 @@
+/* getopt (GNU extensions) gnulib wrapper header.
+   Copyright (C) 1989-2017 Free Software Foundation, Inc.
+   This file is part of gnulib.
+   Unlike most of the getopt implementation, it is NOT shared
+   with the GNU C Library.
+
+   gnulib 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 of
+   the License, or (at your option) any later version.
+
+   gnulib 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 gnulib; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef _GETOPT_PFX_EXT_H
+#define _GETOPT_PFX_EXT_H 1
+
+/* This header should not be used directly; include getopt.h instead.
+   It does not have a protective #error, because the guard macro for
+   getopt.h in gnulib is not fixed.  */
+
+/* Standalone applications should #define __GETOPT_PREFIX to an
+   identifier that prefixes the external functions and variables
+   defined in getopt-core.h and getopt-ext.h.  Systematically
+   rename identifiers so that they do not collide with the system
+   functions and variables.  Renaming avoids problems with some
+   compilers and linkers.  */
+#ifdef __GETOPT_PREFIX
+# ifndef __GETOPT_ID
+#  define __GETOPT_CONCAT(x, y) x ## y
+#  define __GETOPT_XCONCAT(x, y) __GETOPT_CONCAT (x, y)
+#  define __GETOPT_ID(y) __GETOPT_XCONCAT (__GETOPT_PREFIX, y)
+# endif
+# undef getopt_long
+# undef getopt_long_only
+# undef option
+# define getopt_long __GETOPT_ID (getopt_long)
+# define getopt_long_only __GETOPT_ID (getopt_long_only)
+# define option __GETOPT_ID (option)
+#endif
+
+/* Standalone applications get correct prototypes for getopt_long and
+   getopt_long_only; they declare "char **argv".  For backward
+   compatibility with old applications, if __GETOPT_PREFIX is not
+   defined, we supply GNU-libc-compatible, but incorrect, prototypes
+   using "char *const *argv".  (GNU libc is stuck with the incorrect
+   prototypes, as they are baked into older versions of LSB.)  */
+#ifndef __getopt_argv_const
+# if defined __GETOPT_PREFIX
+#  define __getopt_argv_const /* empty */
+# else
+#  define __getopt_argv_const const
+# endif
+#endif
+
+#include <getopt-ext.h>
+
+#endif /* _GETOPT_PFX_EXT_H */

Modified: trunk/gnulib/lib/getopt.c
===================================================================
--- trunk/gnulib/lib/getopt.c   2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/getopt.c   2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,23 +1,21 @@
 /* Getopt for GNU.
-   NOTE: getopt is part of the C library, so if you don't know what
-   "Keep this file name-space clean" means, talk to address@hidden
-   before changing it!
-   Copyright (C) 1987-1996, 1998-2004, 2006, 2008-2016 Free Software
-   Foundation, Inc.
-   This file is part of the GNU C Library.
+   Copyright (C) 1987-2017 Free Software Foundation, Inc.
+   This file is part of the GNU C Library and is also part of gnulib.
+   Patches to this file should be submitted to both projects.
 
-   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 of the License, or
-   (at your option) any later version.
+   The GNU C Library 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 of the License, or (at your option) any later version.
 
-   This program is distributed in the hope that it will be useful,
+   The GNU C Library 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.
+   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/>.  */
+   You should have received a copy of the GNU General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
 
 #ifndef _LIBC
 # include <config.h>
@@ -31,30 +29,53 @@
 #include <unistd.h>
 
 #ifdef _LIBC
+/* When used as part of glibc, error printing must be done differently
+   for standards compliance.  getopt is not a cancellation point, so
+   it must not call functions that are, and it is specified by an
+   older standard than stdio locking, so it must not refer to
+   functions in the "user namespace" related to stdio locking.
+   Finally, it must use glibc's internal message translation so that
+   the messages are looked up in the proper text domain.  */
 # include <libintl.h>
+# define fprintf __fxprintf_nocancel
+# define flockfile(fp) _IO_flockfile (fp)
+# define funlockfile(fp) _IO_funlockfile (fp)
 #else
 # include "gettext.h"
 # define _(msgid) gettext (msgid)
+/* When used standalone, flockfile and funlockfile might not be
+   available.  */
+# ifndef _POSIX_THREAD_SAFE_FUNCTIONS
+#  define flockfile(fp) /* nop */
+#  define funlockfile(fp) /* nop */
+# endif
+/* When used standalone, do not attempt to use alloca.  */
+# define __libc_use_alloca(size) 0
+# undef alloca
+# define alloca(size) (abort (), (void *)0)
 #endif
 
-#if defined _LIBC && defined USE_IN_LIBIO
-# include <wchar.h>
-#endif
+/* This implementation of 'getopt' has three modes for handling
+   options interspersed with non-option arguments.  It can stop
+   scanning for options at the first non-option argument encountered,
+   as POSIX specifies.  It can continue scanning for options after the
+   first non-option argument, but permute 'argv' as it goes so that,
+   after 'getopt' is done, all the options precede all the non-option
+   arguments and 'optind' points to the first non-option argument.
+   Or, it can report non-option arguments as if they were arguments to
+   the option character '\x01'.
 
-/* This version of 'getopt' appears to the caller like standard Unix 'getopt'
-   but it behaves differently for the user, since it allows the user
-   to intersperse the options with the other arguments.
-
-   As 'getopt_long' works, it permutes the elements of ARGV so that,
-   when it is done, all the options precede everything else.  Thus
-   all application programs are extended to handle flexible argument order.
-
-   Using 'getopt' or setting the environment variable POSIXLY_CORRECT
+   The default behavior of 'getopt_long' is to permute the argument list.
+   When this implementation is used standalone, the default behavior of
+   'getopt' is to stop at the first non-option argument, but when it is
+   used as part of GNU libc it also permutes the argument list.  In both
+   cases, setting the environment variable POSIXLY_CORRECT to any value
    disables permutation.
-   Then the behavior is completely standard.
 
-   GNU application programs can use a third alternative mode in which
-   they can distinguish the relative order of options and other arguments.  */
+   If the first character of the OPTSTRING argument to 'getopt' or
+   'getopt_long' is '+', both functions will stop at the first
+   non-option argument.  If it is '-', both functions will report
+   non-option arguments as arguments to the option character '\x01'.  */
 
 #include "getopt_int.h"
 
@@ -95,42 +116,7 @@
 /* Keep a global copy of all internal members of getopt_data.  */
 
 static struct _getopt_data getopt_data;
-
 
-#if defined HAVE_DECL_GETENV && !HAVE_DECL_GETENV
-extern char *getenv ();
-#endif
-
-#ifdef _LIBC
-/* Stored original parameters.
-   XXX This is no good solution.  We should rather copy the args so
-   that we can compare them later.  But we must not use malloc(3).  */
-extern int __libc_argc;
-extern char **__libc_argv;
-
-/* Bash 2.0 gives us an environment variable containing flags
-   indicating ARGV elements that should not be considered arguments.  */
-
-# ifdef USE_NONOPTION_FLAGS
-/* Defined in getopt_init.c  */
-extern char *__getopt_nonoption_flags;
-# endif
-
-# ifdef USE_NONOPTION_FLAGS
-#  define SWAP_FLAGS(ch1, ch2) \
-  if (d->__nonoption_flags_len > 0)                                           \
-    {                                                                         \
-      char __tmp = __getopt_nonoption_flags[ch1];                             \
-      __getopt_nonoption_flags[ch1] = __getopt_nonoption_flags[ch2];          \
-      __getopt_nonoption_flags[ch2] = __tmp;                                  \
-    }
-# else
-#  define SWAP_FLAGS(ch1, ch2)
-# endif
-#else   /* !_LIBC */
-# define SWAP_FLAGS(ch1, ch2)
-#endif  /* _LIBC */
-
 /* Exchange two adjacent subsequences of ARGV.
    One subsequence is elements [first_nonopt,last_nonopt)
    which contains all the non-options that have been skipped so far.
@@ -153,64 +139,40 @@
      It leaves the longer segment in the right place overall,
      but it consists of two parts that need to be swapped next.  */
 
-#if defined _LIBC && defined USE_NONOPTION_FLAGS
-  /* First make sure the handling of the '__getopt_nonoption_flags'
-     string can work normally.  Our top argument must be in the range
-     of the string.  */
-  if (d->__nonoption_flags_len > 0 && top >= d->__nonoption_flags_max_len)
-    {
-      /* We must extend the array.  The user plays games with us and
-         presents new arguments.  */
-      char *new_str = malloc (top + 1);
-      if (new_str == NULL)
-        d->__nonoption_flags_len = d->__nonoption_flags_max_len = 0;
-      else
-        {
-          memset (__mempcpy (new_str, __getopt_nonoption_flags,
-                             d->__nonoption_flags_max_len),
-                  '\0', top + 1 - d->__nonoption_flags_max_len);
-          d->__nonoption_flags_max_len = top + 1;
-          __getopt_nonoption_flags = new_str;
-        }
-    }
-#endif
-
   while (top > middle && middle > bottom)
     {
       if (top - middle > middle - bottom)
-        {
-          /* Bottom segment is the short one.  */
-          int len = middle - bottom;
-          register int i;
+       {
+         /* Bottom segment is the short one.  */
+         int len = middle - bottom;
+         int i;
 
-          /* Swap it with the top part of the top segment.  */
-          for (i = 0; i < len; i++)
-            {
-              tem = argv[bottom + i];
-              argv[bottom + i] = argv[top - (middle - bottom) + i];
-              argv[top - (middle - bottom) + i] = tem;
-              SWAP_FLAGS (bottom + i, top - (middle - bottom) + i);
-            }
-          /* Exclude the moved bottom segment from further swapping.  */
-          top -= len;
-        }
+         /* Swap it with the top part of the top segment.  */
+         for (i = 0; i < len; i++)
+           {
+             tem = argv[bottom + i];
+             argv[bottom + i] = argv[top - (middle - bottom) + i];
+             argv[top - (middle - bottom) + i] = tem;
+           }
+         /* Exclude the moved bottom segment from further swapping.  */
+         top -= len;
+       }
       else
-        {
-          /* Top segment is the short one.  */
-          int len = top - middle;
-          register int i;
+       {
+         /* Top segment is the short one.  */
+         int len = top - middle;
+         int i;
 
-          /* Swap it with the bottom part of the bottom segment.  */
-          for (i = 0; i < len; i++)
-            {
-              tem = argv[bottom + i];
-              argv[bottom + i] = argv[middle + i];
-              argv[middle + i] = tem;
-              SWAP_FLAGS (bottom + i, middle + i);
-            }
-          /* Exclude the moved top segment from further swapping.  */
-          bottom += len;
-        }
+         /* Swap it with the bottom part of the bottom segment.  */
+         for (i = 0; i < len; i++)
+           {
+             tem = argv[bottom + i];
+             argv[bottom + i] = argv[middle + i];
+             argv[middle + i] = tem;
+           }
+         /* Exclude the moved top segment from further swapping.  */
+         bottom += len;
+       }
     }
 
   /* Update records for the slots the non-options now occupy.  */
@@ -219,25 +181,216 @@
   d->__last_nonopt = d->optind;
 }
 
-/* Initialize the internal data when the first call is made.  */
+/* Process the argument starting with d->__nextchar as a long option.
+   d->optind should *not* have been advanced over this argument.
 
+   If the value returned is -1, it was not actually a long option, the
+   state is unchanged, and the argument should be processed as a set
+   of short options (this can only happen when long_only is true).
+   Otherwise, the option (and its argument, if any) have been consumed
+   and the return value is the value to return from _getopt_internal_r.  */
+static int
+process_long_option (int argc, char **argv, const char *optstring,
+                    const struct option *longopts, int *longind,
+                    int long_only, struct _getopt_data *d,
+                    int print_errors, const char *prefix)
+{
+  char *nameend;
+  size_t namelen;
+  const struct option *p;
+  const struct option *pfound = NULL;
+  int n_options;
+  int option_index;
+
+  for (nameend = d->__nextchar; *nameend && *nameend != '='; nameend++)
+    /* Do nothing.  */ ;
+  namelen = nameend - d->__nextchar;
+
+  /* First look for an exact match, counting the options as a side
+     effect.  */
+  for (p = longopts, n_options = 0; p->name; p++, n_options++)
+    if (!strncmp (p->name, d->__nextchar, namelen)
+       && namelen == strlen (p->name))
+      {
+       /* Exact match found.  */
+       pfound = p;
+       option_index = n_options;
+       break;
+      }
+
+  if (pfound == NULL)
+    {
+      /* Didn't find an exact match, so look for abbreviations.  */
+      unsigned char *ambig_set = NULL;
+      int ambig_malloced = 0;
+      int ambig_fallback = 0;
+      int indfound = -1;
+
+      for (p = longopts, option_index = 0; p->name; p++, option_index++)
+       if (!strncmp (p->name, d->__nextchar, namelen))
+         {
+           if (pfound == NULL)
+             {
+               /* First nonexact match found.  */
+               pfound = p;
+               indfound = option_index;
+             }
+           else if (long_only
+                    || pfound->has_arg != p->has_arg
+                    || pfound->flag != p->flag
+                    || pfound->val != p->val)
+             {
+               /* Second or later nonexact match found.  */
+               if (!ambig_fallback)
+                 {
+                   if (!print_errors)
+                     /* Don't waste effort tracking the ambig set if
+                        we're not going to print it anyway.  */
+                     ambig_fallback = 1;
+                   else if (!ambig_set)
+                     {
+                       if (__libc_use_alloca (n_options))
+                         ambig_set = alloca (n_options);
+                       else if ((ambig_set = malloc (n_options)) == NULL)
+                         /* Fall back to simpler error message.  */
+                         ambig_fallback = 1;
+                       else
+                         ambig_malloced = 1;
+
+                       if (ambig_set)
+                         {
+                           memset (ambig_set, 0, n_options);
+                           ambig_set[indfound] = 1;
+                         }
+                     }
+                   if (ambig_set)
+                     ambig_set[option_index] = 1;
+                 }
+             }
+         }
+
+      if (ambig_set || ambig_fallback)
+       {
+         if (print_errors)
+           {
+             if (ambig_fallback)
+               fprintf (stderr, _("%s: option '%s%s' is ambiguous\n"),
+                        argv[0], prefix, d->__nextchar);
+             else
+               {
+                 flockfile (stderr);
+                 fprintf (stderr,
+                          _("%s: option '%s%s' is ambiguous; possibilities:"),
+                          argv[0], prefix, d->__nextchar);
+
+                 for (option_index = 0; option_index < n_options; 
option_index++)
+                   if (ambig_set[option_index])
+                     fprintf (stderr, " '%s%s'",
+                              prefix, longopts[option_index].name);
+
+                 /* This must use 'fprintf' even though it's only
+                    printing a single character, so that it goes through
+                    __fxprintf_nocancel when compiled as part of glibc.  */
+                 fprintf (stderr, "\n");
+                 funlockfile (stderr);
+               }
+           }
+         if (ambig_malloced)
+           free (ambig_set);
+         d->__nextchar += strlen (d->__nextchar);
+         d->optind++;
+         d->optopt = 0;
+         return '?';
+       }
+
+      option_index = indfound;
+    }
+
+  if (pfound == NULL)
+    {
+      /* Can't find it as a long option.  If this is not getopt_long_only,
+        or the option starts with '--' or is not a valid short option,
+        then it's an error.  */
+      if (!long_only || argv[d->optind][1] == '-'
+         || strchr (optstring, *d->__nextchar) == NULL)
+       {
+         if (print_errors)
+           fprintf (stderr, _("%s: unrecognized option '%s%s'\n"),
+                    argv[0], prefix, d->__nextchar);
+
+         d->__nextchar = NULL;
+         d->optind++;
+         d->optopt = 0;
+         return '?';
+       }
+
+      /* Otherwise interpret it as a short option.  */
+      return -1;
+    }
+
+  /* We have found a matching long option.  Consume it.  */
+  d->optind++;
+  d->__nextchar = NULL;
+  if (*nameend)
+    {
+      /* Don't test has_arg with >, because some C compilers don't
+        allow it to be used on enums.  */
+      if (pfound->has_arg)
+       d->optarg = nameend + 1;
+      else
+       {
+         if (print_errors)
+           fprintf (stderr,
+                    _("%s: option '%s%s' doesn't allow an argument\n"),
+                    argv[0], prefix, pfound->name);
+
+         d->optopt = pfound->val;
+         return '?';
+       }
+    }
+  else if (pfound->has_arg == 1)
+    {
+      if (d->optind < argc)
+       d->optarg = argv[d->optind++];
+      else
+       {
+         if (print_errors)
+           fprintf (stderr,
+                    _("%s: option '%s%s' requires an argument\n"),
+                    argv[0], prefix, pfound->name);
+
+         d->optopt = pfound->val;
+         return optstring[0] == ':' ? ':' : '?';
+       }
+    }
+
+  if (longind != NULL)
+    *longind = option_index;
+  if (pfound->flag)
+    {
+      *(pfound->flag) = pfound->val;
+      return 0;
+    }
+  return pfound->val;
+}
+
+/* Initialize internal data upon the first call to getopt.  */
+
 static const char *
 _getopt_initialize (int argc _GL_UNUSED,
-                    char **argv _GL_UNUSED, const char *optstring,
-                    struct _getopt_data *d, int posixly_correct)
+                   char **argv _GL_UNUSED, const char *optstring,
+                   struct _getopt_data *d, int posixly_correct)
 {
   /* Start processing options with ARGV-element 1 (since ARGV-element 0
      is the program name); the sequence of previously skipped
      non-option ARGV-elements is empty.  */
+  if (d->optind == 0)
+    d->optind = 1;
 
   d->__first_nonopt = d->__last_nonopt = d->optind;
-
   d->__nextchar = NULL;
 
-  d->__posixly_correct = posixly_correct || !!getenv ("POSIXLY_CORRECT");
-
   /* Determine how to handle the ordering of options and nonoptions.  */
-
   if (optstring[0] == '-')
     {
       d->__ordering = RETURN_IN_ORDER;
@@ -248,41 +401,12 @@
       d->__ordering = REQUIRE_ORDER;
       ++optstring;
     }
-  else if (d->__posixly_correct)
+  else if (posixly_correct || !!getenv ("POSIXLY_CORRECT"))
     d->__ordering = REQUIRE_ORDER;
   else
     d->__ordering = PERMUTE;
 
-#if defined _LIBC && defined USE_NONOPTION_FLAGS
-  if (!d->__posixly_correct
-      && argc == __libc_argc && argv == __libc_argv)
-    {
-      if (d->__nonoption_flags_max_len == 0)
-        {
-          if (__getopt_nonoption_flags == NULL
-              || __getopt_nonoption_flags[0] == '\0')
-            d->__nonoption_flags_max_len = -1;
-          else
-            {
-              const char *orig_str = __getopt_nonoption_flags;
-              int len = d->__nonoption_flags_max_len = strlen (orig_str);
-              if (d->__nonoption_flags_max_len < argc)
-                d->__nonoption_flags_max_len = argc;
-              __getopt_nonoption_flags =
-                (char *) malloc (d->__nonoption_flags_max_len);
-              if (__getopt_nonoption_flags == NULL)
-                d->__nonoption_flags_max_len = -1;
-              else
-                memset (__mempcpy (__getopt_nonoption_flags, orig_str, len),
-                        '\0', d->__nonoption_flags_max_len - len);
-            }
-        }
-      d->__nonoption_flags_len = d->__nonoption_flags_max_len;
-    }
-  else
-    d->__nonoption_flags_len = 0;
-#endif
-
+  d->__initialized = 1;
   return optstring;
 }
 
@@ -344,8 +468,8 @@
 
 int
 _getopt_internal_r (int argc, char **argv, const char *optstring,
-                    const struct option *longopts, int *longind,
-                    int long_only, struct _getopt_data *d, int posixly_correct)
+                   const struct option *longopts, int *longind,
+                   int long_only, struct _getopt_data *d, int posixly_correct)
 {
   int print_errors = d->opterr;
 
@@ -355,29 +479,15 @@
   d->optarg = NULL;
 
   if (d->optind == 0 || !d->__initialized)
-    {
-      if (d->optind == 0)
-        d->optind = 1;  /* Don't scan ARGV[0], the program name.  */
-      optstring = _getopt_initialize (argc, argv, optstring, d,
-                                      posixly_correct);
-      d->__initialized = 1;
-    }
+    optstring = _getopt_initialize (argc, argv, optstring, d, posixly_correct);
   else if (optstring[0] == '-' || optstring[0] == '+')
     optstring++;
+
   if (optstring[0] == ':')
     print_errors = 0;
 
-  /* Test whether ARGV[optind] points to a non-option argument.
-     Either it does not have option syntax, or there is an environment flag
-     from the shell indicating it is not an option.  The later information
-     is only used when the used in the GNU libc.  */
-#if defined _LIBC && defined USE_NONOPTION_FLAGS
-# define NONOPTION_P (argv[d->optind][0] != '-' || argv[d->optind][1] == '\0' \
-                      || (d->optind < d->__nonoption_flags_len                \
-                          && __getopt_nonoption_flags[d->optind] == '1'))
-#else
-# define NONOPTION_P (argv[d->optind][0] != '-' || argv[d->optind][1] == '\0')
-#endif
+  /* Test whether ARGV[optind] points to a non-option argument.  */
+#define NONOPTION_P (argv[d->optind][0] != '-' || argv[d->optind][1] == '\0')
 
   if (d->__nextchar == NULL || *d->__nextchar == '\0')
     {
@@ -384,432 +494,114 @@
       /* Advance to the next ARGV-element.  */
 
       /* Give FIRST_NONOPT & LAST_NONOPT rational values if OPTIND has been
-         moved back by the user (who may also have changed the arguments).  */
+        moved back by the user (who may also have changed the arguments).  */
       if (d->__last_nonopt > d->optind)
-        d->__last_nonopt = d->optind;
+       d->__last_nonopt = d->optind;
       if (d->__first_nonopt > d->optind)
-        d->__first_nonopt = d->optind;
+       d->__first_nonopt = d->optind;
 
       if (d->__ordering == PERMUTE)
-        {
-          /* If we have just processed some options following some non-options,
-             exchange them so that the options come first.  */
+       {
+         /* If we have just processed some options following some non-options,
+            exchange them so that the options come first.  */
 
-          if (d->__first_nonopt != d->__last_nonopt
-              && d->__last_nonopt != d->optind)
-            exchange ((char **) argv, d);
-          else if (d->__last_nonopt != d->optind)
-            d->__first_nonopt = d->optind;
+         if (d->__first_nonopt != d->__last_nonopt
+             && d->__last_nonopt != d->optind)
+           exchange (argv, d);
+         else if (d->__last_nonopt != d->optind)
+           d->__first_nonopt = d->optind;
 
-          /* Skip any additional non-options
-             and extend the range of non-options previously skipped.  */
+         /* Skip any additional non-options
+            and extend the range of non-options previously skipped.  */
 
-          while (d->optind < argc && NONOPTION_P)
-            d->optind++;
-          d->__last_nonopt = d->optind;
-        }
+         while (d->optind < argc && NONOPTION_P)
+           d->optind++;
+         d->__last_nonopt = d->optind;
+       }
 
       /* The special ARGV-element '--' means premature end of options.
-         Skip it like a null option,
-         then exchange with previous non-options as if it were an option,
-         then skip everything else like a non-option.  */
+        Skip it like a null option,
+        then exchange with previous non-options as if it were an option,
+        then skip everything else like a non-option.  */
 
       if (d->optind != argc && !strcmp (argv[d->optind], "--"))
-        {
-          d->optind++;
+       {
+         d->optind++;
 
-          if (d->__first_nonopt != d->__last_nonopt
-              && d->__last_nonopt != d->optind)
-            exchange ((char **) argv, d);
-          else if (d->__first_nonopt == d->__last_nonopt)
-            d->__first_nonopt = d->optind;
-          d->__last_nonopt = argc;
+         if (d->__first_nonopt != d->__last_nonopt
+             && d->__last_nonopt != d->optind)
+           exchange (argv, d);
+         else if (d->__first_nonopt == d->__last_nonopt)
+           d->__first_nonopt = d->optind;
+         d->__last_nonopt = argc;
 
-          d->optind = argc;
-        }
+         d->optind = argc;
+       }
 
       /* If we have done all the ARGV-elements, stop the scan
-         and back over any non-options that we skipped and permuted.  */
+        and back over any non-options that we skipped and permuted.  */
 
       if (d->optind == argc)
-        {
-          /* Set the next-arg-index to point at the non-options
-             that we previously skipped, so the caller will digest them.  */
-          if (d->__first_nonopt != d->__last_nonopt)
-            d->optind = d->__first_nonopt;
-          return -1;
-        }
+       {
+         /* Set the next-arg-index to point at the non-options
+            that we previously skipped, so the caller will digest them.  */
+         if (d->__first_nonopt != d->__last_nonopt)
+           d->optind = d->__first_nonopt;
+         return -1;
+       }
 
       /* If we have come to a non-option and did not permute it,
-         either stop the scan or describe it to the caller and pass it by.  */
+        either stop the scan or describe it to the caller and pass it by.  */
 
       if (NONOPTION_P)
-        {
-          if (d->__ordering == REQUIRE_ORDER)
-            return -1;
-          d->optarg = argv[d->optind++];
-          return 1;
-        }
+       {
+         if (d->__ordering == REQUIRE_ORDER)
+           return -1;
+         d->optarg = argv[d->optind++];
+         return 1;
+       }
 
       /* We have found another option-ARGV-element.
-         Skip the initial punctuation.  */
+        Check whether it might be a long option.  */
+      if (longopts)
+       {
+         if (argv[d->optind][1] == '-')
+           {
+             /* "--foo" is always a long option.  The special option
+                "--" was handled above.  */
+             d->__nextchar = argv[d->optind] + 2;
+             return process_long_option (argc, argv, optstring, longopts,
+                                         longind, long_only, d,
+                                         print_errors, "--");
+           }
 
-      d->__nextchar = (argv[d->optind] + 1
-                  + (longopts != NULL && argv[d->optind][1] == '-'));
-    }
+         /* If long_only and the ARGV-element has the form "-f",
+            where f is a valid short option, don't consider it an
+            abbreviated form of a long option that starts with f.
+            Otherwise there would be no way to give the -f short
+            option.
 
-  /* Decode the current option-ARGV-element.  */
+            On the other hand, if there's a long option "fubar" and
+            the ARGV-element is "-fu", do consider that an
+            abbreviation of the long option, just like "--fu", and
+            not "-f" with arg "u".
 
-  /* Check whether the ARGV-element is a long option.
+            This distinction seems to be the most useful approach.  */
+         if (long_only && (argv[d->optind][2]
+                           || !strchr (optstring, argv[d->optind][1])))
+           {
+             int code;
+             d->__nextchar = argv[d->optind] + 1;
+             code = process_long_option (argc, argv, optstring, longopts,
+                                         longind, long_only, d,
+                                         print_errors, "-");
+             if (code != -1)
+               return code;
+           }
+       }
 
-     If long_only and the ARGV-element has the form "-f", where f is
-     a valid short option, don't consider it an abbreviated form of
-     a long option that starts with f.  Otherwise there would be no
-     way to give the -f short option.
-
-     On the other hand, if there's a long option "fubar" and
-     the ARGV-element is "-fu", do consider that an abbreviation of
-     the long option, just like "--fu", and not "-f" with arg "u".
-
-     This distinction seems to be the most useful approach.  */
-
-  if (longopts != NULL
-      && (argv[d->optind][1] == '-'
-          || (long_only && (argv[d->optind][2]
-                            || !strchr (optstring, argv[d->optind][1])))))
-    {
-      char *nameend;
-      unsigned int namelen;
-      const struct option *p;
-      const struct option *pfound = NULL;
-      struct option_list
-      {
-        const struct option *p;
-        struct option_list *next;
-      } *ambig_list = NULL;
-#ifdef _LIBC
-/* malloc() not used for _LIBC to simplify failure messages.  */
-# define free_option_list(l)
-#else
-# define free_option_list(l)                   \
-      while (l != NULL)                                \
-        {                                      \
-          struct option_list *pn = l->next;    \
-          free (l);                            \
-          l = pn;                              \
-        }
-#endif
-      int exact = 0;
-      int ambig = 0;
-      int indfound = -1;
-      int option_index;
-
-      for (nameend = d->__nextchar; *nameend && *nameend != '='; nameend++)
-        /* Do nothing.  */ ;
-      namelen = nameend - d->__nextchar;
-
-      /* Test all long options for either exact match
-         or abbreviated matches.  */
-      for (p = longopts, option_index = 0; p->name; p++, option_index++)
-        if (!strncmp (p->name, d->__nextchar, namelen))
-          {
-            if (namelen == (unsigned int) strlen (p->name))
-              {
-                /* Exact match found.  */
-                pfound = p;
-                indfound = option_index;
-                exact = 1;
-                break;
-              }
-            else if (pfound == NULL)
-              {
-                /* First nonexact match found.  */
-                pfound = p;
-                indfound = option_index;
-              }
-            else if (ambig)
-              ; /* Taking simpler path to handling ambiguities.  */
-            else if (long_only
-                     || pfound->has_arg != p->has_arg
-                     || pfound->flag != p->flag
-                     || pfound->val != p->val)
-              {
-                /* Second or later nonexact match found.  */
-#ifdef _LIBC
-                struct option_list *newp = alloca (sizeof (*newp));
-#else
-                struct option_list *newp = malloc (sizeof (*newp));
-                if (newp == NULL)
-                  {
-                    free_option_list (ambig_list);
-                    ambig_list = NULL;
-                    ambig = 1; /* Use simpler fallback message.  */
-                  }
-                else
-#endif
-                  {
-                    newp->p = p;
-                    newp->next = ambig_list;
-                    ambig_list = newp;
-                  }
-              }
-          }
-
-      if ((ambig || ambig_list) && !exact)
-        {
-          if (print_errors && ambig_list)
-            {
-              struct option_list first;
-              first.p = pfound;
-              first.next = ambig_list;
-              ambig_list = &first;
-
-#if defined _LIBC && defined USE_IN_LIBIO
-              char *buf = NULL;
-              size_t buflen = 0;
-
-              FILE *fp = open_memstream (&buf, &buflen);
-              if (fp != NULL)
-                {
-                  fprintf (fp,
-                           _("%s: option '%s' is ambiguous; possibilities:"),
-                           argv[0], argv[d->optind]);
-
-                  do
-                    {
-                      fprintf (fp, " '--%s'", ambig_list->p->name);
-                      ambig_list = ambig_list->next;
-                    }
-                  while (ambig_list != NULL);
-
-                  fputc_unlocked ('\n', fp);
-
-                  if (__builtin_expect (fclose (fp) != EOF, 1))
-                    {
-                      _IO_flockfile (stderr);
-
-                      int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
-                      ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL;
-
-                      __fxprintf (NULL, "%s", buf);
-
-                      ((_IO_FILE *) stderr)->_flags2 = old_flags2;
-                      _IO_funlockfile (stderr);
-
-                      free (buf);
-                    }
-                }
-#else
-              fprintf (stderr,
-                       _("%s: option '%s' is ambiguous; possibilities:"),
-                       argv[0], argv[d->optind]);
-              do
-                {
-                  fprintf (stderr, " '--%s'", ambig_list->p->name);
-                  ambig_list = ambig_list->next;
-                }
-              while (ambig_list != NULL);
-
-              fputc ('\n', stderr);
-#endif
-            }
-          else if (print_errors && ambig)
-            {
-              fprintf (stderr,
-                       _("%s: option '%s' is ambiguous\n"),
-                       argv[0], argv[d->optind]);
-            }
-          d->__nextchar += strlen (d->__nextchar);
-          d->optind++;
-          d->optopt = 0;
-          free_option_list (ambig_list);
-          return '?';
-        }
-
-      free_option_list (ambig_list);
-
-      if (pfound != NULL)
-        {
-          option_index = indfound;
-          d->optind++;
-          if (*nameend)
-            {
-              /* Don't test has_arg with >, because some C compilers don't
-                 allow it to be used on enums.  */
-              if (pfound->has_arg)
-                d->optarg = nameend + 1;
-              else
-                {
-                  if (print_errors)
-                    {
-#if defined _LIBC && defined USE_IN_LIBIO
-                      char *buf;
-                      int n;
-#endif
-
-                      if (argv[d->optind - 1][1] == '-')
-                        {
-                          /* --option */
-#if defined _LIBC && defined USE_IN_LIBIO
-                          n = __asprintf (&buf, _("\
-%s: option '--%s' doesn't allow an argument\n"),
-                                          argv[0], pfound->name);
-#else
-                          fprintf (stderr, _("\
-%s: option '--%s' doesn't allow an argument\n"),
-                                   argv[0], pfound->name);
-#endif
-                        }
-                      else
-                        {
-                          /* +option or -option */
-#if defined _LIBC && defined USE_IN_LIBIO
-                          n = __asprintf (&buf, _("\
-%s: option '%c%s' doesn't allow an argument\n"),
-                                          argv[0], argv[d->optind - 1][0],
-                                          pfound->name);
-#else
-                          fprintf (stderr, _("\
-%s: option '%c%s' doesn't allow an argument\n"),
-                                   argv[0], argv[d->optind - 1][0],
-                                   pfound->name);
-#endif
-                        }
-
-#if defined _LIBC && defined USE_IN_LIBIO
-                      if (n >= 0)
-                        {
-                          _IO_flockfile (stderr);
-
-                          int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
-                          ((_IO_FILE *) stderr)->_flags2
-                            |= _IO_FLAGS2_NOTCANCEL;
-
-                          __fxprintf (NULL, "%s", buf);
-
-                          ((_IO_FILE *) stderr)->_flags2 = old_flags2;
-                          _IO_funlockfile (stderr);
-
-                          free (buf);
-                        }
-#endif
-                    }
-
-                  d->__nextchar += strlen (d->__nextchar);
-
-                  d->optopt = pfound->val;
-                  return '?';
-                }
-            }
-          else if (pfound->has_arg == 1)
-            {
-              if (d->optind < argc)
-                d->optarg = argv[d->optind++];
-              else
-                {
-                  if (print_errors)
-                    {
-#if defined _LIBC && defined USE_IN_LIBIO
-                      char *buf;
-
-                      if (__asprintf (&buf, _("\
-%s: option '--%s' requires an argument\n"),
-                                      argv[0], pfound->name) >= 0)
-                        {
-                          _IO_flockfile (stderr);
-
-                          int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
-                          ((_IO_FILE *) stderr)->_flags2
-                            |= _IO_FLAGS2_NOTCANCEL;
-
-                          __fxprintf (NULL, "%s", buf);
-
-                          ((_IO_FILE *) stderr)->_flags2 = old_flags2;
-                          _IO_funlockfile (stderr);
-
-                          free (buf);
-                        }
-#else
-                      fprintf (stderr,
-                               _("%s: option '--%s' requires an argument\n"),
-                               argv[0], pfound->name);
-#endif
-                    }
-                  d->__nextchar += strlen (d->__nextchar);
-                  d->optopt = pfound->val;
-                  return optstring[0] == ':' ? ':' : '?';
-                }
-            }
-          d->__nextchar += strlen (d->__nextchar);
-          if (longind != NULL)
-            *longind = option_index;
-          if (pfound->flag)
-            {
-              *(pfound->flag) = pfound->val;
-              return 0;
-            }
-          return pfound->val;
-        }
-
-      /* Can't find it as a long option.  If this is not getopt_long_only,
-         or the option starts with '--' or is not a valid short
-         option, then it's an error.
-         Otherwise interpret it as a short option.  */
-      if (!long_only || argv[d->optind][1] == '-'
-          || strchr (optstring, *d->__nextchar) == NULL)
-        {
-          if (print_errors)
-            {
-#if defined _LIBC && defined USE_IN_LIBIO
-              char *buf;
-              int n;
-#endif
-
-              if (argv[d->optind][1] == '-')
-                {
-                  /* --option */
-#if defined _LIBC && defined USE_IN_LIBIO
-                  n = __asprintf (&buf, _("%s: unrecognized option '--%s'\n"),
-                                  argv[0], d->__nextchar);
-#else
-                  fprintf (stderr, _("%s: unrecognized option '--%s'\n"),
-                           argv[0], d->__nextchar);
-#endif
-                }
-              else
-                {
-                  /* +option or -option */
-#if defined _LIBC && defined USE_IN_LIBIO
-                  n = __asprintf (&buf, _("%s: unrecognized option '%c%s'\n"),
-                                  argv[0], argv[d->optind][0], d->__nextchar);
-#else
-                  fprintf (stderr, _("%s: unrecognized option '%c%s'\n"),
-                           argv[0], argv[d->optind][0], d->__nextchar);
-#endif
-                }
-
-#if defined _LIBC && defined USE_IN_LIBIO
-              if (n >= 0)
-                {
-                  _IO_flockfile (stderr);
-
-                  int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
-                  ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL;
-
-                  __fxprintf (NULL, "%s", buf);
-
-                  ((_IO_FILE *) stderr)->_flags2 = old_flags2;
-                  _IO_funlockfile (stderr);
-
-                  free (buf);
-                }
-#endif
-            }
-          d->__nextchar = (char *) "";
-          d->optind++;
-          d->optopt = 0;
-          return '?';
-        }
+      /* It is not a long option.  Skip the initial punctuation.  */
+      d->__nextchar = argv[d->optind] + 1;
     }
 
   /* Look at and handle the next short option-character.  */
@@ -824,331 +616,83 @@
 
     if (temp == NULL || c == ':' || c == ';')
       {
-        if (print_errors)
-          {
-#if defined _LIBC && defined USE_IN_LIBIO
-              char *buf;
-              int n;
-#endif
+       if (print_errors)
+         fprintf (stderr, _("%s: invalid option -- '%c'\n"), argv[0], c);
+       d->optopt = c;
+       return '?';
+      }
 
-#if defined _LIBC && defined USE_IN_LIBIO
-              n = __asprintf (&buf, _("%s: invalid option -- '%c'\n"),
-                              argv[0], c);
-#else
-              fprintf (stderr, _("%s: invalid option -- '%c'\n"), argv[0], c);
-#endif
-
-#if defined _LIBC && defined USE_IN_LIBIO
-            if (n >= 0)
-              {
-                _IO_flockfile (stderr);
-
-                int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
-                ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL;
-
-                __fxprintf (NULL, "%s", buf);
-
-                ((_IO_FILE *) stderr)->_flags2 = old_flags2;
-                _IO_funlockfile (stderr);
-
-                free (buf);
-              }
-#endif
-          }
-        d->optopt = c;
-        return '?';
-      }
     /* Convenience. Treat POSIX -W foo same as long option --foo */
-    if (temp[0] == 'W' && temp[1] == ';')
+    if (temp[0] == 'W' && temp[1] == ';' && longopts != NULL)
       {
-        char *nameend;
-        const struct option *p;
-        const struct option *pfound = NULL;
-        int exact = 0;
-        int ambig = 0;
-        int indfound = 0;
-        int option_index;
+       /* This is an option that requires an argument.  */
+       if (*d->__nextchar != '\0')
+         d->optarg = d->__nextchar;
+       else if (d->optind == argc)
+         {
+           if (print_errors)
+             fprintf (stderr,
+                      _("%s: option requires an argument -- '%c'\n"),
+                      argv[0], c);
 
-        if (longopts == NULL)
-          goto no_longs;
+           d->optopt = c;
+           if (optstring[0] == ':')
+             c = ':';
+           else
+             c = '?';
+           return c;
+         }
+       else
+         d->optarg = argv[d->optind];
 
-        /* This is an option that requires an argument.  */
-        if (*d->__nextchar != '\0')
-          {
-            d->optarg = d->__nextchar;
-            /* If we end this ARGV-element by taking the rest as an arg,
-               we must advance to the next element now.  */
-            d->optind++;
-          }
-        else if (d->optind == argc)
-          {
-            if (print_errors)
-              {
-#if defined _LIBC && defined USE_IN_LIBIO
-                char *buf;
-
-                if (__asprintf (&buf,
-                                _("%s: option requires an argument -- '%c'\n"),
-                                argv[0], c) >= 0)
-                  {
-                    _IO_flockfile (stderr);
-
-                    int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
-                    ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL;
-
-                    __fxprintf (NULL, "%s", buf);
-
-                    ((_IO_FILE *) stderr)->_flags2 = old_flags2;
-                    _IO_funlockfile (stderr);
-
-                    free (buf);
-                  }
-#else
-                fprintf (stderr,
-                         _("%s: option requires an argument -- '%c'\n"),
-                         argv[0], c);
-#endif
-              }
-            d->optopt = c;
-            if (optstring[0] == ':')
-              c = ':';
-            else
-              c = '?';
-            return c;
-          }
-        else
-          /* We already incremented 'd->optind' once;
-             increment it again when taking next ARGV-elt as argument.  */
-          d->optarg = argv[d->optind++];
-
-        /* optarg is now the argument, see if it's in the
-           table of longopts.  */
-
-        for (d->__nextchar = nameend = d->optarg; *nameend && *nameend != '=';
-             nameend++)
-          /* Do nothing.  */ ;
-
-        /* Test all long options for either exact match
-           or abbreviated matches.  */
-        for (p = longopts, option_index = 0; p->name; p++, option_index++)
-          if (!strncmp (p->name, d->__nextchar, nameend - d->__nextchar))
-            {
-              if ((unsigned int) (nameend - d->__nextchar) == strlen (p->name))
-                {
-                  /* Exact match found.  */
-                  pfound = p;
-                  indfound = option_index;
-                  exact = 1;
-                  break;
-                }
-              else if (pfound == NULL)
-                {
-                  /* First nonexact match found.  */
-                  pfound = p;
-                  indfound = option_index;
-                }
-              else if (long_only
-                       || pfound->has_arg != p->has_arg
-                       || pfound->flag != p->flag
-                       || pfound->val != p->val)
-                /* Second or later nonexact match found.  */
-                ambig = 1;
-            }
-        if (ambig && !exact)
-          {
-            if (print_errors)
-              {
-#if defined _LIBC && defined USE_IN_LIBIO
-                char *buf;
-
-                if (__asprintf (&buf, _("%s: option '-W %s' is ambiguous\n"),
-                                argv[0], d->optarg) >= 0)
-                  {
-                    _IO_flockfile (stderr);
-
-                    int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
-                    ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL;
-
-                    __fxprintf (NULL, "%s", buf);
-
-                    ((_IO_FILE *) stderr)->_flags2 = old_flags2;
-                    _IO_funlockfile (stderr);
-
-                    free (buf);
-                  }
-#else
-                fprintf (stderr, _("%s: option '-W %s' is ambiguous\n"),
-                         argv[0], d->optarg);
-#endif
-              }
-            d->__nextchar += strlen (d->__nextchar);
-            d->optind++;
-            return '?';
-          }
-        if (pfound != NULL)
-          {
-            option_index = indfound;
-            if (*nameend)
-              {
-                /* Don't test has_arg with >, because some C compilers don't
-                   allow it to be used on enums.  */
-                if (pfound->has_arg)
-                  d->optarg = nameend + 1;
-                else
-                  {
-                    if (print_errors)
-                      {
-#if defined _LIBC && defined USE_IN_LIBIO
-                        char *buf;
-
-                        if (__asprintf (&buf, _("\
-%s: option '-W %s' doesn't allow an argument\n"),
-                                        argv[0], pfound->name) >= 0)
-                          {
-                            _IO_flockfile (stderr);
-
-                            int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
-                            ((_IO_FILE *) stderr)->_flags2
-                              |= _IO_FLAGS2_NOTCANCEL;
-
-                            __fxprintf (NULL, "%s", buf);
-
-                            ((_IO_FILE *) stderr)->_flags2 = old_flags2;
-                            _IO_funlockfile (stderr);
-
-                            free (buf);
-                          }
-#else
-                        fprintf (stderr, _("\
-%s: option '-W %s' doesn't allow an argument\n"),
-                                 argv[0], pfound->name);
-#endif
-                      }
-
-                    d->__nextchar += strlen (d->__nextchar);
-                    return '?';
-                  }
-              }
-            else if (pfound->has_arg == 1)
-              {
-                if (d->optind < argc)
-                  d->optarg = argv[d->optind++];
-                else
-                  {
-                    if (print_errors)
-                      {
-#if defined _LIBC && defined USE_IN_LIBIO
-                        char *buf;
-
-                        if (__asprintf (&buf, _("\
-%s: option '-W %s' requires an argument\n"),
-                                        argv[0], pfound->name) >= 0)
-                          {
-                            _IO_flockfile (stderr);
-
-                            int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
-                            ((_IO_FILE *) stderr)->_flags2
-                              |= _IO_FLAGS2_NOTCANCEL;
-
-                            __fxprintf (NULL, "%s", buf);
-
-                            ((_IO_FILE *) stderr)->_flags2 = old_flags2;
-                            _IO_funlockfile (stderr);
-
-                            free (buf);
-                          }
-#else
-                        fprintf (stderr, _("\
-%s: option '-W %s' requires an argument\n"),
-                                 argv[0], pfound->name);
-#endif
-                      }
-                    d->__nextchar += strlen (d->__nextchar);
-                    return optstring[0] == ':' ? ':' : '?';
-                  }
-              }
-            else
-              d->optarg = NULL;
-            d->__nextchar += strlen (d->__nextchar);
-            if (longind != NULL)
-              *longind = option_index;
-            if (pfound->flag)
-              {
-                *(pfound->flag) = pfound->val;
-                return 0;
-              }
-            return pfound->val;
-          }
-
-      no_longs:
-        d->__nextchar = NULL;
-        return 'W';   /* Let the application handle it.   */
+       d->__nextchar = d->optarg;
+       d->optarg = NULL;
+       return process_long_option (argc, argv, optstring, longopts, longind,
+                                   0 /* long_only */, d, print_errors, "-W ");
       }
     if (temp[1] == ':')
       {
-        if (temp[2] == ':')
-          {
-            /* This is an option that accepts an argument optionally.  */
-            if (*d->__nextchar != '\0')
-              {
-                d->optarg = d->__nextchar;
-                d->optind++;
-              }
-            else
-              d->optarg = NULL;
-            d->__nextchar = NULL;
-          }
-        else
-          {
-            /* This is an option that requires an argument.  */
-            if (*d->__nextchar != '\0')
-              {
-                d->optarg = d->__nextchar;
-                /* If we end this ARGV-element by taking the rest as an arg,
-                   we must advance to the next element now.  */
-                d->optind++;
-              }
-            else if (d->optind == argc)
-              {
-                if (print_errors)
-                  {
-#if defined _LIBC && defined USE_IN_LIBIO
-                    char *buf;
+       if (temp[2] == ':')
+         {
+           /* This is an option that accepts an argument optionally.  */
+           if (*d->__nextchar != '\0')
+             {
+               d->optarg = d->__nextchar;
+               d->optind++;
+             }
+           else
+             d->optarg = NULL;
+           d->__nextchar = NULL;
+         }
+       else
+         {
+           /* This is an option that requires an argument.  */
+           if (*d->__nextchar != '\0')
+             {
+               d->optarg = d->__nextchar;
+               /* If we end this ARGV-element by taking the rest as an arg,
+                  we must advance to the next element now.  */
+               d->optind++;
+             }
+           else if (d->optind == argc)
+             {
+               if (print_errors)
+                 fprintf (stderr,
+                          _("%s: option requires an argument -- '%c'\n"),
+                          argv[0], c);
 
-                    if (__asprintf (&buf, _("\
-%s: option requires an argument -- '%c'\n"),
-                                    argv[0], c) >= 0)
-                      {
-                        _IO_flockfile (stderr);
-
-                        int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
-                        ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL;
-
-                        __fxprintf (NULL, "%s", buf);
-
-                        ((_IO_FILE *) stderr)->_flags2 = old_flags2;
-                        _IO_funlockfile (stderr);
-
-                        free (buf);
-                      }
-#else
-                    fprintf (stderr,
-                             _("%s: option requires an argument -- '%c'\n"),
-                             argv[0], c);
-#endif
-                  }
-                d->optopt = c;
-                if (optstring[0] == ':')
-                  c = ':';
-                else
-                  c = '?';
-              }
-            else
-              /* We already incremented 'optind' once;
-                 increment it again when taking next ARGV-elt as argument.  */
-              d->optarg = argv[d->optind++];
-            d->__nextchar = NULL;
-          }
+               d->optopt = c;
+               if (optstring[0] == ':')
+                 c = ':';
+               else
+                 c = '?';
+             }
+           else
+             /* We already incremented 'optind' once;
+                increment it again when taking next ARGV-elt as argument.  */
+             d->optarg = argv[d->optind++];
+           d->__nextchar = NULL;
+         }
       }
     return c;
   }
@@ -1156,8 +700,8 @@
 
 int
 _getopt_internal (int argc, char **argv, const char *optstring,
-                  const struct option *longopts, int *longind, int long_only,
-                  int posixly_correct)
+                 const struct option *longopts, int *longind, int long_only,
+                 int posixly_correct)
 {
   int result;
 
@@ -1165,8 +709,8 @@
   getopt_data.opterr = opterr;
 
   result = _getopt_internal_r (argc, argv, optstring, longopts,
-                               longind, long_only, &getopt_data,
-                               posixly_correct);
+                              longind, long_only, &getopt_data,
+                              posixly_correct);
 
   optind = getopt_data.optind;
   optarg = getopt_data.optarg;
@@ -1175,32 +719,23 @@
   return result;
 }
 
-/* glibc gets a LSB-compliant getopt.
-   Standalone applications get a POSIX-compliant getopt.  */
-#if _LIBC
-enum { POSIXLY_CORRECT = 0 };
-#else
-enum { POSIXLY_CORRECT = 1 };
-#endif
+/* glibc gets a LSB-compliant getopt and a POSIX-complaint __posix_getopt.
+   Standalone applications just get a POSIX-compliant getopt.
+   POSIX and LSB both require these functions to take 'char *const *argv'
+   even though this is incorrect (because of the permutation).  */
+#define GETOPT_ENTRY(NAME, POSIXLY_CORRECT)                    \
+  int                                                          \
+  NAME (int argc, char *const *argv, const char *optstring)    \
+  {                                                            \
+    return _getopt_internal (argc, (char **)argv, optstring,   \
+                            0, 0, 0, POSIXLY_CORRECT);         \
+  }
 
-int
-getopt (int argc, char *const *argv, const char *optstring)
-{
-  return _getopt_internal (argc, (char **) argv, optstring,
-                           (const struct option *) 0,
-                           (int *) 0,
-                           0, POSIXLY_CORRECT);
-}
-
 #ifdef _LIBC
-int
-__posix_getopt (int argc, char *const *argv, const char *optstring)
-{
-  return _getopt_internal (argc, argv, optstring,
-                           (const struct option *) 0,
-                           (int *) 0,
-                           0, 1);
-}
+GETOPT_ENTRY(getopt, 0)
+GETOPT_ENTRY(__posix_getopt, 1)
+#else
+GETOPT_ENTRY(getopt, 1)
 #endif
 
 
@@ -1221,44 +756,44 @@
 
       c = getopt (argc, argv, "abc:d:0123456789");
       if (c == -1)
-        break;
+       break;
 
       switch (c)
-        {
-        case '0':
-        case '1':
-        case '2':
-        case '3':
-        case '4':
-        case '5':
-        case '6':
-        case '7':
-        case '8':
-        case '9':
-          if (digit_optind != 0 && digit_optind != this_option_optind)
-            printf ("digits occur in two different argv-elements.\n");
-          digit_optind = this_option_optind;
-          printf ("option %c\n", c);
-          break;
+       {
+       case '0':
+       case '1':
+       case '2':
+       case '3':
+       case '4':
+       case '5':
+       case '6':
+       case '7':
+       case '8':
+       case '9':
+         if (digit_optind != 0 && digit_optind != this_option_optind)
+           printf ("digits occur in two different argv-elements.\n");
+         digit_optind = this_option_optind;
+         printf ("option %c\n", c);
+         break;
 
-        case 'a':
-          printf ("option a\n");
-          break;
+       case 'a':
+         printf ("option a\n");
+         break;
 
-        case 'b':
-          printf ("option b\n");
-          break;
+       case 'b':
+         printf ("option b\n");
+         break;
 
-        case 'c':
-          printf ("option c with value '%s'\n", optarg);
-          break;
+       case 'c':
+         printf ("option c with value '%s'\n", optarg);
+         break;
 
-        case '?':
-          break;
+       case '?':
+         break;
 
-        default:
-          printf ("?? getopt returned character code 0%o ??\n", c);
-        }
+       default:
+         printf ("?? getopt returned character code 0%o ??\n", c);
+       }
     }
 
   if (optind < argc)
@@ -1265,7 +800,7 @@
     {
       printf ("non-option ARGV-elements: ");
       while (optind < argc)
-        printf ("%s ", argv[optind++]);
+       printf ("%s ", argv[optind++]);
       printf ("\n");
     }
 

Modified: trunk/gnulib/lib/getopt.in.h
===================================================================
--- trunk/gnulib/lib/getopt.in.h        2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/getopt.in.h        2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,20 +1,22 @@
 /* Declarations for getopt.
-   Copyright (C) 1989-1994, 1996-1999, 2001, 2003-2007, 2009-2016 Free Software
-   Foundation, Inc.
-   This file is part of the GNU C Library.
+   Copyright (C) 1989-2017 Free Software Foundation, Inc.
+   This file is part of gnulib.
+   Unlike most of the getopt implementation, it is NOT shared
+   with the GNU C Library, which supplies a different version of
+   this file.
 
-   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 of the License, or
-   (at your option) any later version.
+   gnulib 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 of
+   the License, or (at your option) any later version.
 
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
+   gnulib 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/>.  */
+   You should have received a copy of the GNU General Public
+   License along with gnulib; if not, see <http://www.gnu.org/licenses/>.  */
 
 #ifndef address@hidden@_GETOPT_H
 
@@ -32,22 +34,15 @@
 # undef _GL_SYSTEM_GETOPT
 #endif
 
-#ifndef address@hidden@_GETOPT_H
+#define address@hidden@_GETOPT_H 1
 
-#ifndef __need_getopt
-# define address@hidden@_GETOPT_H 1
-#endif
-
 /* Standalone applications should #define __GETOPT_PREFIX to an
    identifier that prefixes the external functions and variables
-   defined in this header.  When this happens, include the
-   headers that might declare getopt so that they will not cause
-   confusion if included after this file (if the system had <getopt.h>,
-   we have already included it).  Then systematically rename
-   identifiers so that they do not collide with the system functions
-   and variables.  Renaming avoids problems with some compilers and
-   linkers.  */
-#if defined __GETOPT_PREFIX && !defined __need_getopt
+   defined in getopt-core.h and getopt-ext.h.  When this happens,
+   include the headers that might declare getopt so that they will not
+   cause confusion if included after this file (if the system had
+   <getopt.h>, we have already included it).  */
+#if defined __GETOPT_PREFIX
 # if address@hidden@
 #  define __need_system_stdlib_h
 #  include <stdlib.h>
@@ -55,201 +50,12 @@
 #  include <stdio.h>
 #  include <unistd.h>
 # endif
-# undef __need_getopt
-# undef getopt
-# undef getopt_long
-# undef getopt_long_only
-# undef optarg
-# undef opterr
-# undef optind
-# undef optopt
-# undef option
-# define __GETOPT_CONCAT(x, y) x ## y
-# define __GETOPT_XCONCAT(x, y) __GETOPT_CONCAT (x, y)
-# define __GETOPT_ID(y) __GETOPT_XCONCAT (__GETOPT_PREFIX, y)
-# define getopt __GETOPT_ID (getopt)
-# define getopt_long __GETOPT_ID (getopt_long)
-# define getopt_long_only __GETOPT_ID (getopt_long_only)
-# define optarg __GETOPT_ID (optarg)
-# define opterr __GETOPT_ID (opterr)
-# define optind __GETOPT_ID (optind)
-# define optopt __GETOPT_ID (optopt)
-# define option __GETOPT_ID (option)
-# define _getopt_internal __GETOPT_ID (getopt_internal)
 #endif
 
-/* Standalone applications get correct prototypes for getopt_long and
-   getopt_long_only; they declare "char **argv".  libc uses prototypes
-   with "char *const *argv" that are incorrect because getopt_long and
-   getopt_long_only can permute argv; this is required for backward
-   compatibility (e.g., for LSB 2.0.1).
-
-   This used to be '#if defined __GETOPT_PREFIX && !defined __need_getopt',
-   but it caused redefinition warnings if both unistd.h and getopt.h were
-   included, since unistd.h includes getopt.h having previously defined
-   __need_getopt.
-
-   The only place where __getopt_argv_const is used is in definitions
-   of getopt_long and getopt_long_only below, but these are visible
-   only if __need_getopt is not defined, so it is quite safe to rewrite
-   the conditional as follows:
-*/
-#if !defined __need_getopt
-# if defined __GETOPT_PREFIX
-#  define __getopt_argv_const /* empty */
-# else
-#  define __getopt_argv_const const
-# endif
-#endif
-
-/* If __GNU_LIBRARY__ is not already defined, either we are being used
-   standalone, or this is the first header included in the source file.
-   If we are being used with glibc, we need to include <features.h>, but
-   that does not exist if we are standalone.  So: if __GNU_LIBRARY__ is
-   not defined, include <ctype.h>, which will pull in <features.h> for us
-   if it's from glibc.  (Why ctype.h?  It's guaranteed to exist and it
-   doesn't flood the namespace with stuff the way some other headers do.)  */
-#if !defined __GNU_LIBRARY__
-# include <ctype.h>
-#endif
-
-#ifndef __THROW
-# ifndef __GNUC_PREREQ
-#  define __GNUC_PREREQ(maj, min) (0)
-# endif
-# if defined __cplusplus && __GNUC_PREREQ (2,8)
-#  define __THROW       throw ()
-# else
-#  define __THROW
-# endif
-#endif
-
 /* The definition of _GL_ARG_NONNULL is copied here.  */
 
-#ifdef __cplusplus
-extern "C" {
-#endif
+#include <getopt-cdefs.h>
+#include <getopt-pfx-core.h>
+#include <getopt-pfx-ext.h>
 
-/* For communication from 'getopt' to the caller.
-   When 'getopt' finds an option that takes an argument,
-   the argument value is returned here.
-   Also, when 'ordering' is RETURN_IN_ORDER,
-   each non-option ARGV-element is returned here.  */
-
-extern char *optarg;
-
-/* Index in ARGV of the next element to be scanned.
-   This is used for communication to and from the caller
-   and for communication between successive calls to 'getopt'.
-
-   On entry to 'getopt', zero means this is the first call; initialize.
-
-   When 'getopt' returns -1, this is the index of the first of the
-   non-option elements that the caller should itself scan.
-
-   Otherwise, 'optind' communicates from one call to the next
-   how much of ARGV has been scanned so far.  */
-
-extern int optind;
-
-/* Callers store zero here to inhibit the error message 'getopt' prints
-   for unrecognized options.  */
-
-extern int opterr;
-
-/* Set to an option character which was unrecognized.  */
-
-extern int optopt;
-
-#ifndef __need_getopt
-/* Describe the long-named options requested by the application.
-   The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector
-   of 'struct option' terminated by an element containing a name which is
-   zero.
-
-   The field 'has_arg' is:
-   no_argument          (or 0) if the option does not take an argument,
-   required_argument    (or 1) if the option requires an argument,
-   optional_argument    (or 2) if the option takes an optional argument.
-
-   If the field 'flag' is not NULL, it points to a variable that is set
-   to the value given in the field 'val' when the option is found, but
-   left unchanged if the option is not found.
-
-   To have a long-named option do something other than set an 'int' to
-   a compiled-in constant, such as set a value from 'optarg', set the
-   option's 'flag' field to zero and its 'val' field to a nonzero
-   value (the equivalent single-letter option character, if there is
-   one).  For long options that have a zero 'flag' field, 'getopt'
-   returns the contents of the 'val' field.  */
-
-# if !GNULIB_defined_struct_option
-struct option
-{
-  const char *name;
-  /* has_arg can't be an enum because some compilers complain about
-     type mismatches in all the code that assumes it is an int.  */
-  int has_arg;
-  int *flag;
-  int val;
-};
-#  define GNULIB_defined_struct_option 1
-# endif
-
-/* Names for the values of the 'has_arg' field of 'struct option'.  */
-
-# define no_argument            0
-# define required_argument      1
-# define optional_argument      2
-#endif  /* need getopt */
-
-
-/* Get definitions and prototypes for functions to process the
-   arguments in ARGV (ARGC of them, minus the program name) for
-   options given in OPTS.
-
-   Return the option character from OPTS just read.  Return -1 when
-   there are no more options.  For unrecognized options, or options
-   missing arguments, 'optopt' is set to the option letter, and '?' is
-   returned.
-
-   The OPTS string is a list of characters which are recognized option
-   letters, optionally followed by colons, specifying that that letter
-   takes an argument, to be placed in 'optarg'.
-
-   If a letter in OPTS is followed by two colons, its argument is
-   optional.  This behavior is specific to the GNU 'getopt'.
-
-   The argument '--' causes premature termination of argument
-   scanning, explicitly telling 'getopt' that there are no more
-   options.
-
-   If OPTS begins with '-', then non-option arguments are treated as
-   arguments to the option '\1'.  This behavior is specific to the GNU
-   'getopt'.  If OPTS begins with '+', or POSIXLY_CORRECT is set in
-   the environment, then do not permute arguments.  */
-
-extern int getopt (int ___argc, char *const *___argv, const char *__shortopts)
-       __THROW _GL_ARG_NONNULL ((2, 3));
-
-#ifndef __need_getopt
-extern int getopt_long (int ___argc, char *__getopt_argv_const *___argv,
-                        const char *__shortopts,
-                        const struct option *__longopts, int *__longind)
-       __THROW _GL_ARG_NONNULL ((2, 3));
-extern int getopt_long_only (int ___argc, char *__getopt_argv_const *___argv,
-                             const char *__shortopts,
-                             const struct option *__longopts, int *__longind)
-       __THROW _GL_ARG_NONNULL ((2, 3));
-
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-/* Make sure we later can get all the definitions and declarations.  */
-#undef __need_getopt
-
 #endif /* address@hidden@_GETOPT_H */
-#endif /* address@hidden@_GETOPT_H */

Modified: trunk/gnulib/lib/getopt1.c
===================================================================
--- trunk/gnulib/lib/getopt1.c  2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/getopt1.c  2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,56 +1,44 @@
 /* getopt_long and getopt_long_only entry points for GNU getopt.
-   Copyright (C) 1987-1994, 1996-1998, 2004, 2006, 2009-2016 Free Software
-   Foundation, Inc.
-   This file is part of the GNU C Library.
+   Copyright (C) 1987-2017 Free Software Foundation, Inc.
+   This file is part of the GNU C Library and is also part of gnulib.
+   Patches to this file should be submitted to both projects.
 
-   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 of the License, or
-   (at your option) any later version.
+   The GNU C Library 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 of the License, or (at your option) any later version.
 
-   This program is distributed in the hope that it will be useful,
+   The GNU C Library 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.
+   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/>.  */
+   You should have received a copy of the GNU General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
 
-#ifdef _LIBC
-# include <getopt.h>
-#else
+#ifndef _LIBC
 # include <config.h>
-# include "getopt.h"
 #endif
+
+#include "getopt.h"
 #include "getopt_int.h"
 
-#include <stdio.h>
-
-/* This needs to come after some library #include
-   to get __GNU_LIBRARY__ defined.  */
-#ifdef __GNU_LIBRARY__
-#include <stdlib.h>
-#endif
-
-#ifndef NULL
-#define NULL 0
-#endif
-
 int
 getopt_long (int argc, char *__getopt_argv_const *argv, const char *options,
-             const struct option *long_options, int *opt_index)
+            const struct option *long_options, int *opt_index)
 {
   return _getopt_internal (argc, (char **) argv, options, long_options,
-                           opt_index, 0, 0);
+                          opt_index, 0, 0);
 }
 
 int
 _getopt_long_r (int argc, char **argv, const char *options,
-                const struct option *long_options, int *opt_index,
-                struct _getopt_data *d)
+               const struct option *long_options, int *opt_index,
+               struct _getopt_data *d)
 {
   return _getopt_internal_r (argc, argv, options, long_options, opt_index,
-                             0, d, 0);
+                            0, d, 0);
 }
 
 /* Like getopt_long, but '-' as well as '--' can indicate a long option.
@@ -60,20 +48,20 @@
 
 int
 getopt_long_only (int argc, char *__getopt_argv_const *argv,
-                  const char *options,
-                  const struct option *long_options, int *opt_index)
+                 const char *options,
+                 const struct option *long_options, int *opt_index)
 {
   return _getopt_internal (argc, (char **) argv, options, long_options,
-                           opt_index, 1, 0);
+                          opt_index, 1, 0);
 }
 
 int
 _getopt_long_only_r (int argc, char **argv, const char *options,
-                     const struct option *long_options, int *opt_index,
-                     struct _getopt_data *d)
+                    const struct option *long_options, int *opt_index,
+                    struct _getopt_data *d)
 {
   return _getopt_internal_r (argc, argv, options, long_options, opt_index,
-                             1, d, 0);
+                            1, d, 0);
 }
 
 
@@ -80,6 +68,7 @@
 #ifdef TEST
 
 #include <stdio.h>
+#include <stdlib.h>
 
 int
 main (int argc, char **argv)
@@ -93,67 +82,67 @@
       int option_index = 0;
       static const struct option long_options[] =
       {
-        {"add", 1, 0, 0},
-        {"append", 0, 0, 0},
-        {"delete", 1, 0, 0},
-        {"verbose", 0, 0, 0},
-        {"create", 0, 0, 0},
-        {"file", 1, 0, 0},
-        {0, 0, 0, 0}
+       {"add", 1, 0, 0},
+       {"append", 0, 0, 0},
+       {"delete", 1, 0, 0},
+       {"verbose", 0, 0, 0},
+       {"create", 0, 0, 0},
+       {"file", 1, 0, 0},
+       {0, 0, 0, 0}
       };
 
       c = getopt_long (argc, argv, "abc:d:0123456789",
-                       long_options, &option_index);
+                      long_options, &option_index);
       if (c == -1)
-        break;
+       break;
 
       switch (c)
-        {
-        case 0:
-          printf ("option %s", long_options[option_index].name);
-          if (optarg)
-            printf (" with arg %s", optarg);
-          printf ("\n");
-          break;
+       {
+       case 0:
+         printf ("option %s", long_options[option_index].name);
+         if (optarg)
+           printf (" with arg %s", optarg);
+         printf ("\n");
+         break;
 
-        case '0':
-        case '1':
-        case '2':
-        case '3':
-        case '4':
-        case '5':
-        case '6':
-        case '7':
-        case '8':
-        case '9':
-          if (digit_optind != 0 && digit_optind != this_option_optind)
-            printf ("digits occur in two different argv-elements.\n");
-          digit_optind = this_option_optind;
-          printf ("option %c\n", c);
-          break;
+       case '0':
+       case '1':
+       case '2':
+       case '3':
+       case '4':
+       case '5':
+       case '6':
+       case '7':
+       case '8':
+       case '9':
+         if (digit_optind != 0 && digit_optind != this_option_optind)
+           printf ("digits occur in two different argv-elements.\n");
+         digit_optind = this_option_optind;
+         printf ("option %c\n", c);
+         break;
 
-        case 'a':
-          printf ("option a\n");
-          break;
+       case 'a':
+         printf ("option a\n");
+         break;
 
-        case 'b':
-          printf ("option b\n");
-          break;
+       case 'b':
+         printf ("option b\n");
+         break;
 
-        case 'c':
-          printf ("option c with value '%s'\n", optarg);
-          break;
+       case 'c':
+         printf ("option c with value '%s'\n", optarg);
+         break;
 
-        case 'd':
-          printf ("option d with value '%s'\n", optarg);
-          break;
+       case 'd':
+         printf ("option d with value '%s'\n", optarg);
+         break;
 
-        case '?':
-          break;
+       case '?':
+         break;
 
-        default:
-          printf ("?? getopt returned character code 0%o ??\n", c);
-        }
+       default:
+         printf ("?? getopt returned character code 0%o ??\n", c);
+       }
     }
 
   if (optind < argc)
@@ -160,7 +149,7 @@
     {
       printf ("non-option ARGV-elements: ");
       while (optind < argc)
-        printf ("%s ", argv[optind++]);
+       printf ("%s ", argv[optind++]);
       printf ("\n");
     }
 

Modified: trunk/gnulib/lib/getopt_int.h
===================================================================
--- trunk/gnulib/lib/getopt_int.h       2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/getopt_int.h       2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,30 +1,31 @@
 /* Internal declarations for getopt.
-   Copyright (C) 1989-1994, 1996-1999, 2001, 2003-2004, 2009-2016 Free Software
-   Foundation, Inc.
-   This file is part of the GNU C Library.
+   Copyright (C) 1989-2017 Free Software Foundation, Inc.
+   This file is part of the GNU C Library and is also part of gnulib.
+   Patches to this file should be submitted to both projects.
 
-   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 of the License, or
-   (at your option) any later version.
+   The GNU C Library 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 of the License, or (at your option) any later version.
 
-   This program is distributed in the hope that it will be useful,
+   The GNU C Library 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.
+   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/>.  */
+   You should have received a copy of the GNU General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
 
 #ifndef _GETOPT_INT_H
-#define _GETOPT_INT_H   1
+#define _GETOPT_INT_H  1
 
 #include <getopt.h>
 
 extern int _getopt_internal (int ___argc, char **___argv,
-                             const char *__shortopts,
-                             const struct option *__longopts, int *__longind,
-                             int __long_only, int __posixly_correct);
+                            const char *__shortopts,
+                            const struct option *__longopts, int *__longind,
+                            int __long_only, int __posixly_correct);
 
 
 /* Reentrant versions which can handle parsing multiple argument
@@ -32,28 +33,20 @@
 
 /* Describe how to deal with options that follow non-option ARGV-elements.
 
-   If the caller did not specify anything,
-   the default is REQUIRE_ORDER if the environment variable
-   POSIXLY_CORRECT is defined, PERMUTE otherwise.
+   REQUIRE_ORDER means don't recognize them as options; stop option
+   processing when the first non-option is seen.  This is what POSIX
+   specifies should happen.
 
-   REQUIRE_ORDER means don't recognize them as options;
-   stop option processing when the first non-option is seen.
-   This is what Unix does.
-   This mode of operation is selected by either setting the environment
-   variable POSIXLY_CORRECT, or using '+' as the first character
-   of the list of option characters, or by calling getopt.
+   PERMUTE means permute the contents of ARGV as we scan, so that
+   eventually all the non-options are at the end.  This allows options
+   to be given in any order, even with programs that were not written
+   to expect this.
 
-   PERMUTE is the default.  We permute the contents of ARGV as we
-   scan, so that eventually all the non-options are at the end.
-   This allows options to be given in any order, even with programs
-   that were not written to expect this.
-
    RETURN_IN_ORDER is an option available to programs that were
    written to expect options and other ARGV-elements in any order
    and that care about the ordering of the two.  We describe each
    non-option ARGV-element as if it were the argument of an option
-   with character code 1.  Using '-' as the first character of the
-   list of option characters selects this mode of operation.
+   with character code 1.
 
    The special argument '--' forces an end of option-scanning regardless
    of the value of 'ordering'.  In the case of RETURN_IN_ORDER, only
@@ -91,11 +84,6 @@
   /* See __ord above.  */
   enum __ord __ordering;
 
-  /* If the POSIXLY_CORRECT environment variable is set
-     or getopt was called.  */
-  int __posixly_correct;
-
-
   /* Handle permutation of arguments.  */
 
   /* Describe the part of ARGV that contains non-options that have
@@ -104,32 +92,27 @@
 
   int __first_nonopt;
   int __last_nonopt;
-
-#if defined _LIBC && defined USE_NONOPTION_FLAGS
-  int __nonoption_flags_max_len;
-  int __nonoption_flags_len;
-#endif
 };
 
 /* The initializer is necessary to set OPTIND and OPTERR to their
    default values and to clear the initialization flag.  */
-#define _GETOPT_DATA_INITIALIZER        { 1, 1 }
+#define _GETOPT_DATA_INITIALIZER       { 1, 1 }
 
 extern int _getopt_internal_r (int ___argc, char **___argv,
-                               const char *__shortopts,
-                               const struct option *__longopts, int *__longind,
-                               int __long_only, struct _getopt_data *__data,
-                               int __posixly_correct);
+                              const char *__shortopts,
+                              const struct option *__longopts, int *__longind,
+                              int __long_only, struct _getopt_data *__data,
+                              int __posixly_correct);
 
 extern int _getopt_long_r (int ___argc, char **___argv,
-                           const char *__shortopts,
-                           const struct option *__longopts, int *__longind,
-                           struct _getopt_data *__data);
+                          const char *__shortopts,
+                          const struct option *__longopts, int *__longind,
+                          struct _getopt_data *__data);
 
 extern int _getopt_long_only_r (int ___argc, char **___argv,
-                                const char *__shortopts,
-                                const struct option *__longopts,
-                                int *__longind,
-                                struct _getopt_data *__data);
+                               const char *__shortopts,
+                               const struct option *__longopts,
+                               int *__longind,
+                               struct _getopt_data *__data);
 
 #endif /* getopt_int.h */

Added: trunk/gnulib/lib/getprogname.c
===================================================================
--- trunk/gnulib/lib/getprogname.c                              (rev 0)
+++ trunk/gnulib/lib/getprogname.c      2017-04-14 17:20:48 UTC (rev 7726)
@@ -0,0 +1,185 @@
+/* Program name management.
+   Copyright (C) 2016-2017 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 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU 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/>.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include "getprogname.h"
+
+#include <errno.h> /* get program_invocation_name declaration */
+#include <stdlib.h> /* get __argv declaration */
+
+#ifdef _AIX
+# include <unistd.h>
+# include <procinfo.h>
+# include <string.h>
+#endif
+
+#ifdef __MVS__
+# ifndef _OPEN_SYS
+#  define _OPEN_SYS
+# endif
+# include <string.h>
+# include <sys/ps.h>
+#endif
+
+#ifdef __hpux
+# include <unistd.h>
+# include <sys/param.h>
+# include <sys/pstat.h>
+# include <string.h>
+#endif
+
+#ifdef __sgi
+# include <string.h>
+# include <unistd.h>
+# include <stdio.h>
+# include <fcntl.h>
+# include <sys/procfs.h>
+#endif
+
+#include "dirname.h"
+
+#ifndef HAVE_GETPROGNAME             /* not Mac OS X, FreeBSD, NetBSD, OpenBSD 
>= 5.4, Cygwin */
+char const *
+getprogname (void)
+{
+# if HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME                /* glibc, BeOS */
+  /* https://www.gnu.org/software/libc/manual/html_node/Error-Messages.html */
+  return program_invocation_short_name;
+# elif HAVE_DECL_PROGRAM_INVOCATION_NAME                    /* glibc, BeOS */
+  /* https://www.gnu.org/software/libc/manual/html_node/Error-Messages.html */
+  return last_component (program_invocation_name);
+# elif HAVE_GETEXECNAME                                     /* Solaris */
+  /* http://docs.oracle.com/cd/E19253-01/816-5168/6mbb3hrb1/index.html */
+  const char *p = getexecname ();
+  if (!p)
+    p = "?";
+  return last_component (p);
+# elif HAVE_DECL___ARGV                                     /* mingw, MSVC */
+  /* https://msdn.microsoft.com/en-us/library/dn727674.aspx */
+  const char *p = __argv && __argv[0] ? __argv[0] : "?";
+  return last_component (p);
+# elif HAVE_VAR___PROGNAME                                  /* OpenBSD, QNX */
+  /* http://man.openbsd.org/style.9 */
+  /* 
http://www.qnx.de/developers/docs/6.5.0/index.jsp?topic=%2Fcom.qnx.doc.neutrino_lib_ref%2Fp%2F__progname.html
 */
+  /* Be careful to declare this only when we absolutely need it
+     (OpenBSD 5.1), rather than when it's available.  Otherwise,
+     its mere declaration makes program_invocation_short_name
+     malfunction (have zero length) with Fedora 25's glibc.  */
+  extern char *__progname;
+  const char *p = __progname;
+  return p && p[0] ? p : "?";
+# elif _AIX                                                 /* AIX */
+  /* Idea by Bastien ROUCARIÈS,
+     http://lists.gnu.org/archive/html/bug-gnulib/2010-12/msg00095.html
+     Reference: http://
+   ibm.biz/knowctr#ssw_aix_53/com.ibm.aix.basetechref/doc/basetrf1/getprocs.htm
+  */
+  static char *p;
+  static int first = 1;
+  if (first)
+    {
+      first = 0;
+      pid_t pid = getpid ();
+      struct procentry64 procs;
+      p = (0 < getprocs64 (&procs, sizeof procs, NULL, 0, &pid, 1)
+           ? strdup (procs.pi_comm)
+           : NULL);
+      if (!p)
+        p = "?";
+    }
+  return p;
+# elif defined __hpux
+  static char *p;
+  static int first = 1;
+  if (first)
+    {
+      first = 0;
+      pid_t pid = getpid ();
+      struct pst_status status;
+      p = (0 < pstat_getproc (&status, sizeof status, 0, pid)
+           ? strdup (status.pst_ucomm)
+           : NULL);
+      if (!p)
+        p = "?";
+    }
+  return p;
+# elif __MVS__                                              /* z/OS */
+  /* 
https://www.ibm.com/support/knowledgecenter/SSLTBW_2.1.0/com.ibm.zos.v2r1.bpxbd00/rtwgetp.htm
 */
+  static char *p = "?";
+  static int first = 1;
+  if (first)
+    {
+      pid_t pid = getpid ();
+      int token;
+      W_PSPROC buf;
+      first = 0;
+      memset (&buf, 0, sizeof(buf));
+      buf.ps_cmdptr    = (char *) malloc (buf.ps_cmdlen    = PS_CMDBLEN_LONG);
+      buf.ps_conttyptr = (char *) malloc (buf.ps_conttylen = PS_CONTTYBLEN);
+      buf.ps_pathptr   = (char *) malloc (buf.ps_pathlen   = PS_PATHBLEN);
+      if (buf.ps_cmdptr && buf.ps_conttyptr && buf.ps_pathptr)
+        {
+          for (token = 0; token >= 0;
+               token = w_getpsent (token, &buf, sizeof(buf)))
+            {
+              if (token > 0 && buf.ps_pid == pid)
+                {
+                  char *s = strdup (last_component (buf.ps_pathptr));
+                  if (s)
+                    p = s;
+                  break;
+                }
+            }
+        }
+      free (buf.ps_cmdptr);
+      free (buf.ps_conttyptr);
+      free (buf.ps_pathptr);
+    }
+  return p;
+# elif defined __sgi                                        /* IRIX */
+  char filename[50];
+  int fd;
+
+  sprintf (filename, "/proc/pinfo/%d", (int) getpid ());
+  fd = open (filename, O_RDONLY);
+  if (0 <= fd)
+    {
+      prpsinfo_t buf;
+      int ioctl_ok = 0 <= ioctl (fd, PIOCPSINFO, &buf);
+      close (fd);
+      if (ioctl_ok)
+        {
+          char *name = buf.pr_fname;
+          char *namesize = sizeof buf.pr_fname;
+          char *namenul = memchr (name, '\0', namesize);
+          size_t namelen = namenul ? namenul - name : namesize;
+          char *namecopy = malloc (namelen + 1);
+          if (namecopy)
+            {
+              namecopy[namelen] = 0;
+              return memcpy (namecopy, name, namelen);
+            }
+        }
+    }
+  return NULL;
+# else
+#  error "getprogname module not ported to this OS"
+# endif
+}
+
+#endif

Added: trunk/gnulib/lib/getprogname.h
===================================================================
--- trunk/gnulib/lib/getprogname.h                              (rev 0)
+++ trunk/gnulib/lib/getprogname.h      2017-04-14 17:20:48 UTC (rev 7726)
@@ -0,0 +1,40 @@
+/* Program name management.
+   Copyright (C) 2016-2017 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 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU 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/>.  */
+
+#ifndef _GL_GETPROGNAME_H
+#define _GL_GETPROGNAME_H
+
+#include <stdlib.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Return the base name of the executing program.
+   On native Windows this will usually end in ".exe" or ".EXE". */
+#ifndef HAVE_GETPROGNAME
+extern char const *getprogname (void)
+# ifdef HAVE_DECL_PROGRAM_INVOCATION_NAME
+  _GL_ATTRIBUTE_PURE
+# endif
+  ;
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif

Modified: trunk/gnulib/lib/gettext.h
===================================================================
--- trunk/gnulib/lib/gettext.h  2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/gettext.h  2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 /* Convenience header for conditional use of GNU <libintl.h>.
-   Copyright (C) 1995-1998, 2000-2002, 2004-2006, 2009-2016 Free Software
+   Copyright (C) 1995-1998, 2000-2002, 2004-2006, 2009-2017 Free Software
    Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify

Modified: trunk/gnulib/lib/glthread/lock.c
===================================================================
--- trunk/gnulib/lib/glthread/lock.c    2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/glthread/lock.c    2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 /* Locking in multithreaded situations.
-   Copyright (C) 2005-2016 Free Software Foundation, Inc.
+   Copyright (C) 2005-2017 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -30,11 +30,40 @@
 
 /* ------------------------- gl_rwlock_t datatype ------------------------- */
 
-# if HAVE_PTHREAD_RWLOCK
+# if HAVE_PTHREAD_RWLOCK && (HAVE_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER || 
(defined PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP && (__GNU_LIBRARY__ 
> 1)))
 
-#  if !defined PTHREAD_RWLOCK_INITIALIZER
+#  ifdef PTHREAD_RWLOCK_INITIALIZER
 
+#   if !HAVE_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER
+     /* glibc with bug https://sourceware.org/bugzilla/show_bug.cgi?id=13701 */
+
 int
+glthread_rwlock_init_for_glibc (pthread_rwlock_t *lock)
+{
+  pthread_rwlockattr_t attributes;
+  int err;
+
+  err = pthread_rwlockattr_init (&attributes);
+  if (err != 0)
+    return err;
+  /* Note: PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP is the only value that
+     causes the writer to be preferred. PTHREAD_RWLOCK_PREFER_WRITER_NP does 
not
+     do this; see
+     http://man7.org/linux/man-pages/man3/pthread_rwlockattr_setkind_np.3.html 
*/
+  err = pthread_rwlockattr_setkind_np (&attributes,
+                                       
PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP);
+  if (err == 0)
+    err = pthread_rwlock_init(lock, &attributes);
+  /* pthread_rwlockattr_destroy always returns 0.  It cannot influence the
+     return value.  */
+  pthread_rwlockattr_destroy (&attributes);
+  return err;
+}
+
+#   endif
+#  else
+
+int
 glthread_rwlock_init_multithreaded (gl_rwlock_t *lock)
 {
   int err;
@@ -152,11 +181,9 @@
   if (err != 0)
     return err;
   /* Test whether only readers are currently running, and whether the runcount
-     field will not overflow.  */
-  /* POSIX says: "It is implementation-defined whether the calling thread
-     acquires the lock when a writer does not hold the lock and there are
-     writers blocked on the lock."  Let's say, no: give the writers a higher
-     priority.  */
+     field will not overflow, and whether no writer is waiting.  The latter
+     condition is because POSIX recommends that "write locks shall take
+     precedence over read locks", to avoid "writer starvation".  */
   while (!(lock->runcount + 1 > 0 && lock->waiting_writers_count == 0))
     {
       /* This thread has to wait for a while.  Enqueue it among the
@@ -481,6 +508,141 @@
 
 /* ------------------------- gl_rwlock_t datatype ------------------------- */
 
+# if !HAVE_PTH_RWLOCK_ACQUIRE_PREFER_WRITER
+
+int
+glthread_rwlock_init_multithreaded (gl_rwlock_t *lock)
+{
+  if (!pth_mutex_init (&lock->lock))
+    return errno;
+  if (!pth_cond_init (&lock->waiting_readers))
+    return errno;
+  if (!pth_cond_init (&lock->waiting_writers))
+    return errno;
+  lock->waiting_writers_count = 0;
+  lock->runcount = 0;
+  lock->initialized = 1;
+  return 0;
+}
+
+int
+glthread_rwlock_rdlock_multithreaded (gl_rwlock_t *lock)
+{
+  if (!lock->initialized)
+    glthread_rwlock_init_multithreaded (lock);
+  if (!pth_mutex_acquire (&lock->lock, 0, NULL))
+    return errno;
+  /* Test whether only readers are currently running, and whether the runcount
+     field will not overflow, and whether no writer is waiting.  The latter
+     condition is because POSIX recommends that "write locks shall take
+     precedence over read locks", to avoid "writer starvation".  */
+  while (!(lock->runcount + 1 > 0 && lock->waiting_writers_count == 0))
+    {
+      /* This thread has to wait for a while.  Enqueue it among the
+         waiting_readers.  */
+      if (!pth_cond_await (&lock->waiting_readers, &lock->lock, NULL))
+        {
+          int err = errno;
+          pth_mutex_release (&lock->lock);
+          return err;
+        }
+    }
+  lock->runcount++;
+  return (!pth_mutex_release (&lock->lock) ? errno : 0);
+}
+
+int
+glthread_rwlock_wrlock_multithreaded (gl_rwlock_t *lock)
+{
+  if (!lock->initialized)
+    glthread_rwlock_init_multithreaded (lock);
+  if (!pth_mutex_acquire (&lock->lock, 0, NULL))
+    return errno;
+  /* Test whether no readers or writers are currently running.  */
+  while (!(lock->runcount == 0))
+    {
+      /* This thread has to wait for a while.  Enqueue it among the
+         waiting_writers.  */
+      lock->waiting_writers_count++;
+      if (!pth_cond_await (&lock->waiting_writers, &lock->lock, NULL))
+        {
+          int err = errno;
+          lock->waiting_writers_count--;
+          pth_mutex_release (&lock->lock);
+          return err;
+        }
+      lock->waiting_writers_count--;
+    }
+  lock->runcount--; /* runcount becomes -1 */
+  return (!pth_mutex_release (&lock->lock) ? errno : 0);
+}
+
+int
+glthread_rwlock_unlock_multithreaded (gl_rwlock_t *lock)
+{
+  int err;
+
+  if (!lock->initialized)
+    return EINVAL;
+  if (!pth_mutex_acquire (&lock->lock, 0, NULL))
+    return errno;
+  if (lock->runcount < 0)
+    {
+      /* Drop a writer lock.  */
+      if (!(lock->runcount == -1))
+        {
+          pth_mutex_release (&lock->lock);
+          return EINVAL;
+        }
+      lock->runcount = 0;
+    }
+  else
+    {
+      /* Drop a reader lock.  */
+      if (!(lock->runcount > 0))
+        {
+          pth_mutex_release (&lock->lock);
+          return EINVAL;
+        }
+      lock->runcount--;
+    }
+  if (lock->runcount == 0)
+    {
+      /* POSIX recommends that "write locks shall take precedence over read
+         locks", to avoid "writer starvation".  */
+      if (lock->waiting_writers_count > 0)
+        {
+          /* Wake up one of the waiting writers.  */
+          if (!pth_cond_notify (&lock->waiting_writers, FALSE))
+            {
+              int err = errno;
+              pth_mutex_release (&lock->lock);
+              return err;
+            }
+        }
+      else
+        {
+          /* Wake up all waiting readers.  */
+          if (!pth_cond_notify (&lock->waiting_readers, TRUE))
+            {
+              int err = errno;
+              pth_mutex_release (&lock->lock);
+              return err;
+            }
+        }
+    }
+  return (!pth_mutex_release (&lock->lock) ? errno : 0);
+}
+
+int
+glthread_rwlock_destroy_multithreaded (gl_rwlock_t *lock)
+{
+  lock->initialized = 0;
+  return 0;
+}
+
+# endif
+
 /* --------------------- gl_recursive_lock_t datatype --------------------- */
 
 /* -------------------------- gl_once_t datatype -------------------------- */
@@ -796,8 +958,10 @@
     }
   EnterCriticalSection (&lock->lock);
   /* Test whether only readers are currently running, and whether the runcount
-     field will not overflow.  */
-  if (!(lock->runcount + 1 > 0))
+     field will not overflow, and whether no writer is waiting.  The latter
+     condition is because POSIX recommends that "write locks shall take
+     precedence over read locks", to avoid "writer starvation".  */
+  if (!(lock->runcount + 1 > 0 && lock->waiting_writers.count == 0))
     {
       /* This thread has to wait for a while.  Enqueue it among the
          waiting_readers.  */

Modified: trunk/gnulib/lib/glthread/lock.h
===================================================================
--- trunk/gnulib/lib/glthread/lock.h    2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/glthread/lock.h    2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 /* Locking in multithreaded situations.
-   Copyright (C) 2005-2016 Free Software Foundation, Inc.
+   Copyright (C) 2005-2017 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
@@ -139,6 +139,11 @@
 #  pragma weak pthread_mutexattr_init
 #  pragma weak pthread_mutexattr_settype
 #  pragma weak pthread_mutexattr_destroy
+#  pragma weak pthread_rwlockattr_init
+#  if __GNU_LIBRARY__ > 1
+#   pragma weak pthread_rwlockattr_setkind_np
+#  endif
+#  pragma weak pthread_rwlockattr_destroy
 #  ifndef pthread_self
 #   pragma weak pthread_self
 #  endif
@@ -176,7 +181,7 @@
 
 /* ------------------------- gl_rwlock_t datatype ------------------------- */
 
-# if HAVE_PTHREAD_RWLOCK
+# if HAVE_PTHREAD_RWLOCK && (HAVE_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER || 
(defined PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP && (__GNU_LIBRARY__ 
> 1)))
 
 #  ifdef PTHREAD_RWLOCK_INITIALIZER
 
@@ -185,10 +190,18 @@
       STORAGECLASS pthread_rwlock_t NAME;
 #   define gl_rwlock_define_initialized(STORAGECLASS, NAME) \
       STORAGECLASS pthread_rwlock_t NAME = gl_rwlock_initializer;
-#   define gl_rwlock_initializer \
-      PTHREAD_RWLOCK_INITIALIZER
-#   define glthread_rwlock_init(LOCK) \
-      (pthread_in_use () ? pthread_rwlock_init (LOCK, NULL) : 0)
+#   if HAVE_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER
+#    define gl_rwlock_initializer \
+       PTHREAD_RWLOCK_INITIALIZER
+#    define glthread_rwlock_init(LOCK) \
+       (pthread_in_use () ? pthread_rwlock_init (LOCK, NULL) : 0)
+#   else /* glibc with bug 
https://sourceware.org/bugzilla/show_bug.cgi?id=13701 */
+#    define gl_rwlock_initializer \
+       PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP
+#    define glthread_rwlock_init(LOCK) \
+       (pthread_in_use () ? glthread_rwlock_init_for_glibc (LOCK) : 0)
+extern int glthread_rwlock_init_for_glibc (pthread_rwlock_t *lock);
+#   endif
 #   define glthread_rwlock_rdlock(LOCK) \
       (pthread_in_use () ? pthread_rwlock_rdlock (LOCK) : 0)
 #   define glthread_rwlock_wrlock(LOCK) \
@@ -427,6 +440,9 @@
 
 /* ------------------------- gl_rwlock_t datatype ------------------------- */
 
+/* Pth pth_rwlock_acquire always prefers readers.  No autoconf test so far.  */
+# if HAVE_PTH_RWLOCK_ACQUIRE_PREFER_WRITER
+
 typedef pth_rwlock_t gl_rwlock_t;
 #  define gl_rwlock_define(STORAGECLASS, NAME) \
      STORAGECLASS pth_rwlock_t NAME;
@@ -445,6 +461,42 @@
 #  define glthread_rwlock_destroy(LOCK) \
      ((void)(LOCK), 0)
 
+# else
+
+typedef struct
+        {
+          int initialized;
+          pth_mutex_t lock; /* protects the remaining fields */
+          pth_cond_t waiting_readers; /* waiting readers */
+          pth_cond_t waiting_writers; /* waiting writers */
+          unsigned int waiting_writers_count; /* number of waiting writers */
+          int runcount; /* number of readers running, or -1 when a writer runs 
*/
+        }
+        gl_rwlock_t;
+#  define gl_rwlock_define(STORAGECLASS, NAME) \
+     STORAGECLASS gl_rwlock_t NAME;
+#  define gl_rwlock_define_initialized(STORAGECLASS, NAME) \
+     STORAGECLASS gl_rwlock_t NAME = gl_rwlock_initializer;
+#  define gl_rwlock_initializer \
+     { 0 }
+#  define glthread_rwlock_init(LOCK) \
+     (pth_in_use () ? glthread_rwlock_init_multithreaded (LOCK) : 0)
+#  define glthread_rwlock_rdlock(LOCK) \
+     (pth_in_use () ? glthread_rwlock_rdlock_multithreaded (LOCK) : 0)
+#  define glthread_rwlock_wrlock(LOCK) \
+     (pth_in_use () ? glthread_rwlock_wrlock_multithreaded (LOCK) : 0)
+#  define glthread_rwlock_unlock(LOCK) \
+     (pth_in_use () ? glthread_rwlock_unlock_multithreaded (LOCK) : 0)
+#  define glthread_rwlock_destroy(LOCK) \
+     (pth_in_use () ? glthread_rwlock_destroy_multithreaded (LOCK) : 0)
+extern int glthread_rwlock_init_multithreaded (gl_rwlock_t *lock);
+extern int glthread_rwlock_rdlock_multithreaded (gl_rwlock_t *lock);
+extern int glthread_rwlock_wrlock_multithreaded (gl_rwlock_t *lock);
+extern int glthread_rwlock_unlock_multithreaded (gl_rwlock_t *lock);
+extern int glthread_rwlock_destroy_multithreaded (gl_rwlock_t *lock);
+
+# endif
+
 /* --------------------- gl_recursive_lock_t datatype --------------------- */
 
 /* In Pth, mutexes are recursive by default.  */

Modified: trunk/gnulib/lib/glthread/threadlib.c
===================================================================
--- trunk/gnulib/lib/glthread/threadlib.c       2017-04-14 16:36:56 UTC (rev 
7725)
+++ trunk/gnulib/lib/glthread/threadlib.c       2017-04-14 17:20:48 UTC (rev 
7726)
@@ -1,5 +1,5 @@
 /* Multithreading primitives.
-   Copyright (C) 2005-2016 Free Software Foundation, Inc.
+   Copyright (C) 2005-2017 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

Modified: trunk/gnulib/lib/hard-locale.c
===================================================================
--- trunk/gnulib/lib/hard-locale.c      2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/hard-locale.c      2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,6 +1,6 @@
 /* hard-locale.c -- Determine whether a locale is hard.
 
-   Copyright (C) 1997-1999, 2002-2004, 2006-2007, 2009-2016 Free Software
+   Copyright (C) 1997-1999, 2002-2004, 2006-2007, 2009-2017 Free Software
    Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify

Modified: trunk/gnulib/lib/hard-locale.h
===================================================================
--- trunk/gnulib/lib/hard-locale.h      2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/hard-locale.h      2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,6 +1,6 @@
 /* Determine whether a locale is hard.
 
-   Copyright (C) 1999, 2003-2004, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2003-2004, 2009-2017 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

Modified: trunk/gnulib/lib/intprops.h
===================================================================
--- trunk/gnulib/lib/intprops.h 2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/intprops.h 2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,6 +1,6 @@
 /* intprops.h -- properties of integer types
 
-   Copyright (C) 2001-2016 Free Software Foundation, Inc.
+   Copyright (C) 2001-2017 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
@@ -23,10 +23,6 @@
 #include <limits.h>
 #include <verify.h>
 
-#ifndef __has_builtin
-# define __has_builtin(x) 0
-#endif
-
 /* Return a value with the common real type of E and V and the value of V.  */
 #define _GL_INT_CONVERT(e, v) (0 * (e) + (v))
 
@@ -51,12 +47,16 @@
 
 /* Minimum and maximum values for integer types and expressions.  */
 
+/* The width in bits of the integer type or expression T.
+   Padding bits are not supported; this is checked at compile-time below.  */
+#define TYPE_WIDTH(t) (sizeof (t) * CHAR_BIT)
+
 /* The maximum and minimum values for the integer type T.  */
 #define TYPE_MINIMUM(t) ((t) ~ TYPE_MAXIMUM (t))
 #define TYPE_MAXIMUM(t)                                                 \
   ((t) (! TYPE_SIGNED (t)                                               \
         ? (t) -1                                                        \
-        : ((((t) 1 << (sizeof (t) * CHAR_BIT - 2)) - 1) * 2 + 1)))
+        : ((((t) 1 << (TYPE_WIDTH (t) - 2)) - 1) * 2 + 1)))
 
 /* The maximum and minimum values for the type of the expression E,
    after integer promotion.  E should not have side effects.  */
@@ -69,7 +69,7 @@
    ? _GL_SIGNED_INT_MAXIMUM (e)                                         \
    : _GL_INT_NEGATE_CONVERT (e, 1))
 #define _GL_SIGNED_INT_MAXIMUM(e)                                       \
-  (((_GL_INT_CONVERT (e, 1) << (sizeof ((e) + 0) * CHAR_BIT - 2)) - 1) * 2 + 1)
+  (((_GL_INT_CONVERT (e, 1) << (TYPE_WIDTH ((e) + 0) - 2)) - 1) * 2 + 1)
 
 /* Work around OpenVMS incompatibility with C99.  */
 #if !defined LLONG_MAX && defined __INT64_MAX
@@ -94,10 +94,15 @@
 verify (TYPE_MINIMUM (long long int) == LLONG_MIN);
 verify (TYPE_MAXIMUM (long long int) == LLONG_MAX);
 #endif
+/* Similarly, sanity-check one ISO/IEC TS 18661-1:2014 macro if defined.  */
+#ifdef UINT_WIDTH
+verify (TYPE_WIDTH (unsigned int) == UINT_WIDTH);
+#endif
 
 /* Does the __typeof__ keyword work?  This could be done by
    'configure', but for now it's easier to do it by hand.  */
-#if (2 <= __GNUC__ || defined __IBM__TYPEOF__ \
+#if (2 <= __GNUC__ \
+     || (1210 <= __IBMC__ && defined __IBM__TYPEOF__) \
      || (0x5110 <= __SUNPRO_C && !__STDC__))
 # define _GL_HAVE___TYPEOF__ 1
 #else
@@ -126,8 +131,7 @@
    signed, this macro may overestimate the true bound by one byte when
    applied to unsigned types of size 2, 4, 16, ... bytes.  */
 #define INT_STRLEN_BOUND(t)                                     \
-  (INT_BITS_STRLEN_BOUND (sizeof (t) * CHAR_BIT                 \
-                          - _GL_SIGNED_TYPE_OR_EXPR (t))        \
+  (INT_BITS_STRLEN_BOUND (TYPE_WIDTH (t) - _GL_SIGNED_TYPE_OR_EXPR (t)) \
    + _GL_SIGNED_TYPE_OR_EXPR (t))
 
 /* Bound on buffer size needed to represent an integer type or expression T,
@@ -233,12 +237,10 @@
    : (max) >> (b) < (a))
 
 /* True if __builtin_add_overflow (A, B, P) works when P is non-null.  */
-#define _GL_HAS_BUILTIN_OVERFLOW \
-  (5 <= __GNUC__ || __has_builtin (__builtin_add_overflow))
+#define _GL_HAS_BUILTIN_OVERFLOW (5 <= __GNUC__)
 
 /* True if __builtin_add_overflow_p (A, B, C) works.  */
-#define _GL_HAS_BUILTIN_OVERFLOW_P \
-  (7 <= __GNUC__ || __has_builtin (__builtin_add_overflow_p))
+#define _GL_HAS_BUILTIN_OVERFLOW_P (7 <= __GNUC__)
 
 /* The _GL*_OVERFLOW macros have the same restrictions as the
    *_RANGE_OVERFLOW macros, except that they do not assume that operands
@@ -330,7 +332,7 @@
   _GL_BINARY_OP_OVERFLOW (a, b, _GL_ADD_OVERFLOW)
 #define INT_SUBTRACT_OVERFLOW(a, b) \
   _GL_BINARY_OP_OVERFLOW (a, b, _GL_SUBTRACT_OVERFLOW)
-#if _GL_HAS_BUILTIN_OVERFLOW || _GL_HAS_BUILTIN_OVERFLOW_P
+#if _GL_HAS_BUILTIN_OVERFLOW_P
 # define INT_NEGATE_OVERFLOW(a) INT_SUBTRACT_OVERFLOW (0, a)
 #else
 # define INT_NEGATE_OVERFLOW(a) \

Modified: trunk/gnulib/lib/iswblank.c
===================================================================
--- trunk/gnulib/lib/iswblank.c 2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/iswblank.c 2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 /* Test wide character for being blank.
-   Copyright (C) 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 2008-2017 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

Modified: trunk/gnulib/lib/itold.c
===================================================================
--- trunk/gnulib/lib/itold.c    2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/itold.c    2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 /* Replacement for 'int' to 'long double' conversion routine.
-   Copyright (C) 2011-2016 Free Software Foundation, Inc.
+   Copyright (C) 2011-2017 Free Software Foundation, Inc.
    Written by Bruno Haible <address@hidden>, 2011.
 
    This program is free software: you can redistribute it and/or modify

Modified: trunk/gnulib/lib/langinfo.in.h
===================================================================
--- trunk/gnulib/lib/langinfo.in.h      2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/langinfo.in.h      2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 /* Substitute for and wrapper around <langinfo.h>.
-   Copyright (C) 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2009-2017 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

Added: trunk/gnulib/lib/limits.in.h
===================================================================
--- trunk/gnulib/lib/limits.in.h                                (rev 0)
+++ trunk/gnulib/lib/limits.in.h        2017-04-14 17:20:48 UTC (rev 7726)
@@ -0,0 +1,74 @@
+/* A GNU-like <limits.h>.
+
+   Copyright 2016-2017 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/>.  */
+
+#ifndef address@hidden@_LIMITS_H
+
+#if __GNUC__ >= 3
address@hidden@
+#endif
address@hidden@
+
+/* The include_next requires a split double-inclusion guard.  */
address@hidden@ @NEXT_LIMITS_H@
+
+#ifndef address@hidden@_LIMITS_H
+#define address@hidden@_LIMITS_H
+
+/* For HP-UX 11.31.  */
+#if defined LONG_LONG_MIN && !defined LLONG_MIN
+# define LLONG_MIN LONG_LONG_MIN
+#endif
+#if defined LONG_LONG_MAX && !defined LLONG_MAX
+# define LLONG_MAX LONG_LONG_MAX
+#endif
+#if defined ULONG_LONG_MAX && !defined ULLONG_MAX
+# define ULLONG_MAX ULONG_LONG_MAX
+#endif
+
+/* The number of usable bits in an unsigned or signed integer type
+   with minimum value MIN and maximum value MAX, as an int expression
+   suitable in #if.  Cover all known practical hosts.  This
+   implementation exploits the fact that MAX is 1 less than a power of
+   2, and merely counts the number of 1 bits in MAX; "COBn" means
+   "count the number of 1 bits in the low-order n bits").  */
+#define _GL_INTEGER_WIDTH(min, max) (((min) < 0) + _GL_COB128 (max))
+#define _GL_COB128(n) (_GL_COB64 ((n) >> 31 >> 31 >> 2) + _GL_COB64 (n))
+#define _GL_COB64(n) (_GL_COB32 ((n) >> 31 >> 1) + _GL_COB32 (n))
+#define _GL_COB32(n) (_GL_COB16 ((n) >> 16) + _GL_COB16 (n))
+#define _GL_COB16(n) (_GL_COB8 ((n) >> 8) + _GL_COB8 (n))
+#define _GL_COB8(n) (_GL_COB4 ((n) >> 4) + _GL_COB4 (n))
+#define _GL_COB4(n) (!!((n) & 8) + !!((n) & 4) + !!((n) & 2) + !!((n) & 1))
+
+/* Macros specified by ISO/IEC TS 18661-1:2014.  */
+
+#if (! defined ULLONG_WIDTH                                             \
+     && (defined _GNU_SOURCE || defined __STDC_WANT_IEC_60559_BFP_EXT__))
+# define CHAR_WIDTH _GL_INTEGER_WIDTH (CHAR_MIN, CHAR_MAX)
+# define SCHAR_WIDTH _GL_INTEGER_WIDTH (SCHAR_MIN, SCHAR_MAX)
+# define UCHAR_WIDTH _GL_INTEGER_WIDTH (0, UCHAR_MAX)
+# define SHRT_WIDTH _GL_INTEGER_WIDTH (SHRT_MIN, SHRT_MAX)
+# define USHRT_WIDTH _GL_INTEGER_WIDTH (0, USHRT_MAX)
+# define INT_WIDTH _GL_INTEGER_WIDTH (INT_MIN, INT_MAX)
+# define UINT_WIDTH _GL_INTEGER_WIDTH (0, UINT_MAX)
+# define LONG_WIDTH _GL_INTEGER_WIDTH (LONG_MIN, LONG_MAX)
+# define ULONG_WIDTH _GL_INTEGER_WIDTH (0, ULONG_MAX)
+# define LLONG_WIDTH _GL_INTEGER_WIDTH (LLONG_MIN, LLONG_MAX)
+# define ULLONG_WIDTH _GL_INTEGER_WIDTH (0, ULLONG_MAX)
+#endif /* !ULLONG_WIDTH && (_GNU_SOURCE || __STDC_WANT_IEC_60559_BFP_EXT__) */
+
+#endif /* address@hidden@_LIMITS_H */
+#endif /* address@hidden@_LIMITS_H */

Modified: trunk/gnulib/lib/localcharset.c
===================================================================
--- trunk/gnulib/lib/localcharset.c     2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/localcharset.c     2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,6 +1,6 @@
 /* Determine a canonical name for the current locale's character encoding.
 
-   Copyright (C) 2000-2006, 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 2000-2006, 2008-2017 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
@@ -507,7 +507,7 @@
     current_locale = setlocale (LC_CTYPE, NULL);
 
   pdot = strrchr (current_locale, '.');
-  if (pdot)
+  if (pdot && 2 + strlen (pdot + 1) + 1 <= sizeof (buf))
     sprintf (buf, "CP%s", pdot + 1);
   else
     {

Modified: trunk/gnulib/lib/localcharset.h
===================================================================
--- trunk/gnulib/lib/localcharset.h     2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/localcharset.h     2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 /* Determine a canonical name for the current locale's character encoding.
-   Copyright (C) 2000-2003, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2000-2003, 2009-2017 Free Software Foundation, Inc.
    This file is part of the GNU CHARSET Library.
 
    This program is free software; you can redistribute it and/or modify

Modified: trunk/gnulib/lib/locale.in.h
===================================================================
--- trunk/gnulib/lib/locale.in.h        2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/locale.in.h        2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 /* A POSIX <locale.h>.
-   Copyright (C) 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007-2017 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

Modified: trunk/gnulib/lib/localeconv.c
===================================================================
--- trunk/gnulib/lib/localeconv.c       2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/localeconv.c       2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 /* Query locale dependent information for formatting numbers.
-   Copyright (C) 2012-2016 Free Software Foundation, Inc.
+   Copyright (C) 2012-2017 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

Modified: trunk/gnulib/lib/malloc.c
===================================================================
--- trunk/gnulib/lib/malloc.c   2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/malloc.c   2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,6 +1,6 @@
 /* malloc() function that is glibc compatible.
 
-   Copyright (C) 1997-1998, 2006-2007, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 1997-1998, 2006-2007, 2009-2017 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

Modified: trunk/gnulib/lib/malloca.c
===================================================================
--- trunk/gnulib/lib/malloca.c  2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/malloca.c  2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 /* Safe automatic memory allocation.
-   Copyright (C) 2003, 2006-2007, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2006-2007, 2009-2017 Free Software Foundation, Inc.
    Written by Bruno Haible <address@hidden>, 2003.
 
    This program is free software; you can redistribute it and/or modify

Modified: trunk/gnulib/lib/malloca.h
===================================================================
--- trunk/gnulib/lib/malloca.h  2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/malloca.h  2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 /* Safe automatic memory allocation.
-   Copyright (C) 2003-2007, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2003-2007, 2009-2017 Free Software Foundation, Inc.
    Written by Bruno Haible <address@hidden>, 2003.
 
    This program is free software; you can redistribute it and/or modify
@@ -21,8 +21,11 @@
 #include <alloca.h>
 #include <stddef.h>
 #include <stdlib.h>
+#include <stdint.h>
 
+#include "xalloc-oversized.h"
 
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -73,15 +76,7 @@
    It allocates an array of N objects, each with S bytes of memory,
    on the stack.  S must be positive and N must be nonnegative.
    The array must be freed using freea() before the function returns.  */
-#if 1
-/* Cf. the definition of xalloc_oversized.  */
-# define nmalloca(n, s) \
-    ((n) > (size_t) (sizeof (ptrdiff_t) <= sizeof (size_t) ? -1 : -2) / (s) \
-     ? NULL \
-     : malloca ((n) * (s)))
-#else
-extern void * nmalloca (size_t n, size_t s);
-#endif
+#define nmalloca(n, s) (xalloc_oversized (n, s) ? NULL : malloca ((n) * (s)))
 
 
 #ifdef __cplusplus

Modified: trunk/gnulib/lib/mbchar.c
===================================================================
--- trunk/gnulib/lib/mbchar.c   2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/mbchar.c   2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001, 2006, 2009-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2001, 2006, 2009-2017 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

Modified: trunk/gnulib/lib/mbchar.h
===================================================================
--- trunk/gnulib/lib/mbchar.h   2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/mbchar.h   2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 /* Multibyte character data type.
-   Copyright (C) 2001, 2005-2007, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2001, 2005-2007, 2009-2017 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

Modified: trunk/gnulib/lib/mbiter.h
===================================================================
--- trunk/gnulib/lib/mbiter.h   2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/mbiter.h   2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 /* Iterating through multibyte strings: macros for multi-byte encodings.
-   Copyright (C) 2001, 2005, 2007, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2001, 2005, 2007, 2009-2017 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

Modified: trunk/gnulib/lib/mbrtowc.c
===================================================================
--- trunk/gnulib/lib/mbrtowc.c  2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/mbrtowc.c  2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 /* Convert multibyte character to wide character.
-   Copyright (C) 1999-2002, 2005-2016 Free Software Foundation, Inc.
+   Copyright (C) 1999-2002, 2005-2017 Free Software Foundation, Inc.
    Written by Bruno Haible <address@hidden>, 2008.
 
    This program is free software: you can redistribute it and/or modify

Modified: trunk/gnulib/lib/mbscasecmp.c
===================================================================
--- trunk/gnulib/lib/mbscasecmp.c       2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/mbscasecmp.c       2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 /* Case-insensitive string comparison function.
-   Copyright (C) 1998-1999, 2005-2016 Free Software Foundation, Inc.
+   Copyright (C) 1998-1999, 2005-2017 Free Software Foundation, Inc.
    Written by Bruno Haible <address@hidden>, 2005,
    based on earlier glibc code.
 

Modified: trunk/gnulib/lib/mbschr.c
===================================================================
--- trunk/gnulib/lib/mbschr.c   2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/mbschr.c   2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 /* Searching a string for a character.
-   Copyright (C) 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007-2017 Free Software Foundation, Inc.
    Written by Bruno Haible <address@hidden>, 2007.
 
    This program is free software: you can redistribute it and/or modify

Modified: trunk/gnulib/lib/mbsinit.c
===================================================================
--- trunk/gnulib/lib/mbsinit.c  2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/mbsinit.c  2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 /* Test for initial conversion state.
-   Copyright (C) 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 2008-2017 Free Software Foundation, Inc.
    Written by Bruno Haible <address@hidden>, 2008.
 
    This program is free software: you can redistribute it and/or modify

Modified: trunk/gnulib/lib/mbslen.c
===================================================================
--- trunk/gnulib/lib/mbslen.c   2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/mbslen.c   2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 /* Counting the multibyte characters in a string.
-   Copyright (C) 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007-2017 Free Software Foundation, Inc.
    Written by Bruno Haible <address@hidden>, 2007.
 
    This program is free software: you can redistribute it and/or modify

Modified: trunk/gnulib/lib/mbsncasecmp.c
===================================================================
--- trunk/gnulib/lib/mbsncasecmp.c      2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/mbsncasecmp.c      2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 /* Case-insensitive string comparison function.
-   Copyright (C) 1998-1999, 2005-2016 Free Software Foundation, Inc.
+   Copyright (C) 1998-1999, 2005-2017 Free Software Foundation, Inc.
    Written by Bruno Haible <address@hidden>, 2005,
    based on earlier glibc code.
 

Modified: trunk/gnulib/lib/mbsstr.c
===================================================================
--- trunk/gnulib/lib/mbsstr.c   2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/mbsstr.c   2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 /* Searching in a string.  -*- coding: utf-8 -*-
-   Copyright (C) 2005-2016 Free Software Foundation, Inc.
+   Copyright (C) 2005-2017 Free Software Foundation, Inc.
    Written by Bruno Haible <address@hidden>, 2005.
 
    This program is free software: you can redistribute it and/or modify

Modified: trunk/gnulib/lib/mbswidth.c
===================================================================
--- trunk/gnulib/lib/mbswidth.c 2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/mbswidth.c 2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 /* Determine the number of screen columns needed for a string.
-   Copyright (C) 2000-2016 Free Software Foundation, Inc.
+   Copyright (C) 2000-2017 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

Modified: trunk/gnulib/lib/mbswidth.h
===================================================================
--- trunk/gnulib/lib/mbswidth.h 2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/mbswidth.h 2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 /* Determine the number of screen columns needed for a string.
-   Copyright (C) 2000-2004, 2007, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2000-2004, 2007, 2009-2017 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

Modified: trunk/gnulib/lib/mbtowc-impl.h
===================================================================
--- trunk/gnulib/lib/mbtowc-impl.h      2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/mbtowc-impl.h      2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 /* Convert multibyte character to wide character.
-   Copyright (C) 2011-2016 Free Software Foundation, Inc.
+   Copyright (C) 2011-2017 Free Software Foundation, Inc.
    Written by Bruno Haible <address@hidden>, 2011.
 
    This program is free software: you can redistribute it and/or modify

Modified: trunk/gnulib/lib/mbtowc.c
===================================================================
--- trunk/gnulib/lib/mbtowc.c   2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/mbtowc.c   2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 /* Convert multibyte character to wide character.
-   Copyright (C) 2011-2016 Free Software Foundation, Inc.
+   Copyright (C) 2011-2017 Free Software Foundation, Inc.
    Written by Bruno Haible <address@hidden>, 2011.
 
    This program is free software: you can redistribute it and/or modify

Modified: trunk/gnulib/lib/mbuiter.h
===================================================================
--- trunk/gnulib/lib/mbuiter.h  2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/mbuiter.h  2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 /* Iterating through multibyte strings: macros for multi-byte encodings.
-   Copyright (C) 2001, 2005, 2007, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2001, 2005, 2007, 2009-2017 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

Modified: trunk/gnulib/lib/memchr.c
===================================================================
--- trunk/gnulib/lib/memchr.c   2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/memchr.c   2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1993, 1996-1997, 1999-2000, 2003-2004, 2006, 2008-2016
+/* Copyright (C) 1991, 1993, 1996-1997, 1999-2000, 2003-2004, 2006, 2008-2017
    Free Software Foundation, Inc.
 
    Based on strlen implementation by Torbjorn Granlund (address@hidden),

Modified: trunk/gnulib/lib/mempcpy.c
===================================================================
--- trunk/gnulib/lib/mempcpy.c  2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/mempcpy.c  2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 /* Copy memory area and return pointer after last written byte.
-   Copyright (C) 2003, 2007, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2007, 2009-2017 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

Modified: trunk/gnulib/lib/memrchr.c
===================================================================
--- trunk/gnulib/lib/memrchr.c  2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/memrchr.c  2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,6 +1,6 @@
 /* memrchr -- find the last occurrence of a byte in a memory block
 
-   Copyright (C) 1991, 1993, 1996-1997, 1999-2000, 2003-2016 Free Software
+   Copyright (C) 1991, 1993, 1996-1997, 1999-2000, 2003-2017 Free Software
    Foundation, Inc.
 
    Based on strlen implementation by Torbjorn Granlund (address@hidden),

Modified: trunk/gnulib/lib/msvc-inval.c
===================================================================
--- trunk/gnulib/lib/msvc-inval.c       2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/msvc-inval.c       2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 /* Invalid parameter handler for MSVC runtime libraries.
-   Copyright (C) 2011-2016 Free Software Foundation, Inc.
+   Copyright (C) 2011-2017 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

Modified: trunk/gnulib/lib/msvc-inval.h
===================================================================
--- trunk/gnulib/lib/msvc-inval.h       2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/msvc-inval.h       2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 /* Invalid parameter handler for MSVC runtime libraries.
-   Copyright (C) 2011-2016 Free Software Foundation, Inc.
+   Copyright (C) 2011-2017 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

Modified: trunk/gnulib/lib/msvc-nothrow.c
===================================================================
--- trunk/gnulib/lib/msvc-nothrow.c     2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/msvc-nothrow.c     2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,6 +1,6 @@
 /* Wrappers that don't throw invalid parameter notifications
    with MSVC runtime libraries.
-   Copyright (C) 2011-2016 Free Software Foundation, Inc.
+   Copyright (C) 2011-2017 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

Modified: trunk/gnulib/lib/msvc-nothrow.h
===================================================================
--- trunk/gnulib/lib/msvc-nothrow.h     2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/msvc-nothrow.h     2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,6 +1,6 @@
 /* Wrappers that don't throw invalid parameter notifications
    with MSVC runtime libraries.
-   Copyright (C) 2011-2016 Free Software Foundation, Inc.
+   Copyright (C) 2011-2017 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

Modified: trunk/gnulib/lib/nl_langinfo.c
===================================================================
--- trunk/gnulib/lib/nl_langinfo.c      2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/nl_langinfo.c      2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,6 +1,6 @@
 /* nl_langinfo() replacement: query locale dependent information.
 
-   Copyright (C) 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007-2017 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
@@ -34,7 +34,6 @@
 ctype_codeset (void)
 {
   static char buf[2 + 10 + 1];
-  size_t buflen = 0;
   char const *locale = setlocale (LC_CTYPE, NULL);
   char *codeset = buf;
   size_t codesetlen;
@@ -99,7 +98,7 @@
 # endif
 # if GNULIB_defined_T_FMT_AMPM
     case T_FMT_AMPM:
-      return "%I:%M:%S %p";
+      return (char *) "%I:%M:%S %p";
 # endif
 # if GNULIB_defined_ERA
     case ERA:
@@ -106,7 +105,7 @@
       /* The format is not standardized.  In glibc it is a sequence of strings
          of the form "direction:offset:start_date:end_date:era_name:era_format"
          with an empty string at the end.  */
-      return "";
+      return (char *) "";
     case ERA_D_FMT:
       /* The %Ex conversion in strftime behaves like %x if the locale does not
          have an alternative time format.  */
@@ -125,13 +124,13 @@
     case ALT_DIGITS:
       /* The format is not standardized.  In glibc it is a sequence of 10
          strings, appended in memory.  */
-      return "\0\0\0\0\0\0\0\0\0\0";
+      return (char *) "\0\0\0\0\0\0\0\0\0\0";
 # endif
 # if GNULIB_defined_YESEXPR || !FUNC_NL_LANGINFO_YESEXPR_WORKS
     case YESEXPR:
-      return "^[yY]";
+      return (char *) "^[yY]";
     case NOEXPR:
-      return "^[nN]";
+      return (char *) "^[nN]";
 # endif
     default:
       break;
@@ -163,9 +162,9 @@
           return codeset;
       }
 # ifdef __BEOS__
-      return "UTF-8";
+      return (char *) "UTF-8";
 # else
-      return "ISO-8859-1";
+      return (char *) "ISO-8859-1";
 # endif
     /* nl_langinfo items of the LC_NUMERIC category */
     case RADIXCHAR:
@@ -178,23 +177,23 @@
        TODO: Really use the locale.  */
     case D_T_FMT:
     case ERA_D_T_FMT:
-      return "%a %b %e %H:%M:%S %Y";
+      return (char *) "%a %b %e %H:%M:%S %Y";
     case D_FMT:
     case ERA_D_FMT:
-      return "%m/%d/%y";
+      return (char *) "%m/%d/%y";
     case T_FMT:
     case ERA_T_FMT:
-      return "%H:%M:%S";
+      return (char *) "%H:%M:%S";
     case T_FMT_AMPM:
-      return "%I:%M:%S %p";
+      return (char *) "%I:%M:%S %p";
     case AM_STR:
       if (!strftime (nlbuf, sizeof nlbuf, "%p", &tmm))
-        return "AM";
+        return (char *) "AM";
       return nlbuf;
     case PM_STR:
       tmm.tm_hour = 12;
       if (!strftime (nlbuf, sizeof nlbuf, "%p", &tmm))
-        return "PM";
+        return (char *) "PM";
       return nlbuf;
     case DAY_1:
     case DAY_2:
@@ -274,9 +273,9 @@
         return nlbuf;
       }
     case ERA:
-      return "";
+      return (char *) "";
     case ALT_DIGITS:
-      return "\0\0\0\0\0\0\0\0\0\0";
+      return (char *) "\0\0\0\0\0\0\0\0\0\0";
     /* nl_langinfo items of the LC_MONETARY category.  */
     case CRNCYSTR:
       return localeconv () ->currency_symbol;
@@ -311,11 +310,11 @@
     /* nl_langinfo items of the LC_MESSAGES category
        TODO: Really use the locale. */
     case YESEXPR:
-      return "^[yY]";
+      return (char *) "^[yY]";
     case NOEXPR:
-      return "^[nN]";
+      return (char *) "^[nN]";
     default:
-      return "";
+      return (char *) "";
     }
 }
 

Modified: trunk/gnulib/lib/printf-args.c
===================================================================
--- trunk/gnulib/lib/printf-args.c      2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/printf-args.c      2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 /* Decomposed printf argument list.
-   Copyright (C) 1999, 2002-2003, 2005-2007, 2009-2016 Free Software
+   Copyright (C) 1999, 2002-2003, 2005-2007, 2009-2017 Free Software
    Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify

Modified: trunk/gnulib/lib/printf-args.h
===================================================================
--- trunk/gnulib/lib/printf-args.h      2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/printf-args.h      2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 /* Decomposed printf argument list.
-   Copyright (C) 1999, 2002-2003, 2006-2007, 2011-2016 Free Software
+   Copyright (C) 1999, 2002-2003, 2006-2007, 2011-2017 Free Software
    Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify

Modified: trunk/gnulib/lib/printf-parse.c
===================================================================
--- trunk/gnulib/lib/printf-parse.c     2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/printf-parse.c     2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 /* Formatted output to strings.
-   Copyright (C) 1999-2000, 2002-2003, 2006-2016 Free Software Foundation, Inc.
+   Copyright (C) 1999-2000, 2002-2003, 2006-2017 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

Modified: trunk/gnulib/lib/printf-parse.h
===================================================================
--- trunk/gnulib/lib/printf-parse.h     2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/printf-parse.h     2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 /* Parse printf format string.
-   Copyright (C) 1999, 2002-2003, 2005, 2007, 2010-2016 Free Software
+   Copyright (C) 1999, 2002-2003, 2005, 2007, 2010-2017 Free Software
    Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify

Modified: trunk/gnulib/lib/ref-add.sin
===================================================================
--- trunk/gnulib/lib/ref-add.sin        2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/ref-add.sin        2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,6 +1,6 @@
 # Add this package to a list of references stored in a text file.
 #
-#   Copyright (C) 2000, 2009-2016 Free Software Foundation, Inc.
+#   Copyright (C) 2000, 2009-2017 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

Modified: trunk/gnulib/lib/ref-del.sin
===================================================================
--- trunk/gnulib/lib/ref-del.sin        2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/ref-del.sin        2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,6 +1,6 @@
 # Remove this package from a list of references stored in a text file.
 #
-#   Copyright (C) 2000, 2009-2016 Free Software Foundation, Inc.
+#   Copyright (C) 2000, 2009-2017 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

Modified: trunk/gnulib/lib/regcomp.c
===================================================================
--- trunk/gnulib/lib/regcomp.c  2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/regcomp.c  2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 /* Extended regular expression matching and search library.
-   Copyright (C) 2002-2016 Free Software Foundation, Inc.
+   Copyright (C) 2002-2017 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Isamu Hasegawa <address@hidden>.
 

Modified: trunk/gnulib/lib/regex.c
===================================================================
--- trunk/gnulib/lib/regex.c    2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/regex.c    2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 /* Extended regular expression matching and search library.
-   Copyright (C) 2002-2016 Free Software Foundation, Inc.
+   Copyright (C) 2002-2017 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Isamu Hasegawa <address@hidden>.
 

Modified: trunk/gnulib/lib/regex.h
===================================================================
--- trunk/gnulib/lib/regex.h    2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/regex.h    2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,6 +1,6 @@
 /* Definitions for data structures and routines for the regular
    expression library.
-   Copyright (C) 1985, 1989-1993, 1995-1998, 2000-2003, 2005-2016 Free Software
+   Copyright (C) 1985, 1989-1993, 1995-1998, 2000-2003, 2005-2017 Free Software
    Foundation, Inc.
    This file is part of the GNU C Library.
 

Modified: trunk/gnulib/lib/regex_internal.c
===================================================================
--- trunk/gnulib/lib/regex_internal.c   2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/regex_internal.c   2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 /* Extended regular expression matching and search library.
-   Copyright (C) 2002-2016 Free Software Foundation, Inc.
+   Copyright (C) 2002-2017 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Isamu Hasegawa <address@hidden>.
 

Modified: trunk/gnulib/lib/regex_internal.h
===================================================================
--- trunk/gnulib/lib/regex_internal.h   2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/regex_internal.h   2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 /* Extended regular expression matching and search library.
-   Copyright (C) 2002-2016 Free Software Foundation, Inc.
+   Copyright (C) 2002-2017 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Isamu Hasegawa <address@hidden>.
 
@@ -33,6 +33,8 @@
 #include <stdbool.h>
 #include <stdint.h>
 
+#include "intprops.h"
+
 #ifdef _LIBC
 # include <libc-lock.h>
 # define lock_define(name) __libc_lock_define (, name)
@@ -113,11 +115,7 @@
 # define RE_ENABLE_I18N
 #endif
 
-#if __GNUC__ >= 3
-# define BE(expr, val) __builtin_expect (expr, val)
-#else
-# define BE(expr, val) (expr)
-#endif
+#define BE(expr, val) __builtin_expect (expr, val)
 
 /* Number of ASCII characters.  */
 #define ASCII_CHARS 0x80

Modified: trunk/gnulib/lib/regexec.c
===================================================================
--- trunk/gnulib/lib/regexec.c  2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/regexec.c  2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 /* Extended regular expression matching and search library.
-   Copyright (C) 2002-2016 Free Software Foundation, Inc.
+   Copyright (C) 2002-2017 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Isamu Hasegawa <address@hidden>.
 
@@ -354,10 +354,12 @@
 {
   const char *str;
   regoff_t rval;
-  Idx len = length1 + length2;
+  Idx len;
   char *s = NULL;
 
-  if (BE (length1 < 0 || length2 < 0 || stop < 0 || len < length1, 0))
+  if (BE ((length1 < 0 || length2 < 0 || stop < 0
+           || INT_ADD_WRAPV (length1, length2, &len)),
+          0))
     return -2;
 
   /* Concatenate the strings.  */

Modified: trunk/gnulib/lib/size_max.h
===================================================================
--- trunk/gnulib/lib/size_max.h 2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/size_max.h 2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 /* size_max.h -- declare SIZE_MAX through system headers
-   Copyright (C) 2005-2006, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2005-2006, 2009-2017 Free Software Foundation, Inc.
    Written by Simon Josefsson.
 
    This program is free software; you can redistribute it and/or modify

Modified: trunk/gnulib/lib/stdarg.in.h
===================================================================
--- trunk/gnulib/lib/stdarg.in.h        2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/stdarg.in.h        2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 /* Substitute for and wrapper around <stdarg.h>.
-   Copyright (C) 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 2008-2017 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

Modified: trunk/gnulib/lib/stdbool.in.h
===================================================================
--- trunk/gnulib/lib/stdbool.in.h       2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/stdbool.in.h       2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2003, 2006-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2003, 2006-2017 Free Software Foundation, Inc.
    Written by Bruno Haible <address@hidden>, 2001.
 
    This program is free software; you can redistribute it and/or modify

Modified: trunk/gnulib/lib/stddef.in.h
===================================================================
--- trunk/gnulib/lib/stddef.in.h        2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/stddef.in.h        2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,6 +1,6 @@
 /* A substitute for POSIX 2008 <stddef.h>, for platforms that have issues.
 
-   Copyright (C) 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2009-2017 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

Modified: trunk/gnulib/lib/stdint.in.h
===================================================================
--- trunk/gnulib/lib/stdint.in.h        2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/stdint.in.h        2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2002, 2004-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2002, 2004-2017 Free Software Foundation, Inc.
    Written by Paul Eggert, Bruno Haible, Sam Steingold, Peter Burwood.
    This file is part of gnulib.
 
@@ -79,6 +79,21 @@
 #if ! defined address@hidden@_STDINT_H && ! defined 
_GL_JUST_INCLUDE_SYSTEM_STDINT_H
 #define address@hidden@_STDINT_H
 
+/* Get SCHAR_MIN, SCHAR_MAX, UCHAR_MAX, INT_MIN, INT_MAX,
+   LONG_MIN, LONG_MAX, ULONG_MAX, _GL_INTEGER_WIDTH.  */
+#include <limits.h>
+
+/* Override WINT_MIN and WINT_MAX if gnulib's <wchar.h> or <wctype.h> overrides
+   wint_t.  */
+#if @GNULIB_OVERRIDES_WINT_T@
+# undef WINT_MIN
+# undef WINT_MAX
+# define WINT_MIN 0x0U
+# define WINT_MAX 0xffffffffU
+#endif
+
+#if ! @HAVE_C99_STDINT_H@
+
 /* <sys/types.h> defines some of the stdint.h types as well, on glibc,
    IRIX 6.5, and OpenBSD 3.8 (via <machine/types.h>).
    AIX 5.2 <sys/types.h> isn't needed and causes troubles.
@@ -85,43 +100,44 @@
    Mac OS X 10.4.6 <sys/types.h> includes <stdint.h> (which is us), but
    relies on the system <stdint.h> definitions, so include
    <sys/types.h> after @address@hidden  */
-#if @HAVE_SYS_TYPES_H@ && ! defined _AIX
-# include <sys/types.h>
-#endif
+# if @HAVE_SYS_TYPES_H@ && ! defined _AIX
+#  include <sys/types.h>
+# endif
 
-/* Get SCHAR_MIN, SCHAR_MAX, UCHAR_MAX, INT_MIN, INT_MAX,
-   LONG_MIN, LONG_MAX, ULONG_MAX.  */
-#include <limits.h>
-
-#if @HAVE_INTTYPES_H@
+# if @HAVE_INTTYPES_H@
   /* In OpenBSD 3.8, <inttypes.h> includes <machine/types.h>, which defines
      int{8,16,32,64}_t, uint{8,16,32,64}_t and __BIT_TYPES_DEFINED__.
      <inttypes.h> also defines intptr_t and uintptr_t.  */
-# include <inttypes.h>
-#elif @HAVE_SYS_INTTYPES_H@
+#  include <inttypes.h>
+# elif @HAVE_SYS_INTTYPES_H@
   /* Solaris 7 <sys/inttypes.h> has the types except the *_fast*_t types, and
      the macros except for *_FAST*_*, INTPTR_MIN, PTRDIFF_MIN, PTRDIFF_MAX.  */
-# include <sys/inttypes.h>
-#endif
+#  include <sys/inttypes.h>
+# endif
 
-#if @HAVE_SYS_BITYPES_H@ && ! defined __BIT_TYPES_DEFINED__
+# if @HAVE_SYS_BITYPES_H@ && ! defined __BIT_TYPES_DEFINED__
   /* Linux libc4 >= 4.6.7 and libc5 have a <sys/bitypes.h> that defines
      int{8,16,32,64}_t and __BIT_TYPES_DEFINED__.  In libc5 >= 5.2.2 it is
      included by <sys/types.h>.  */
-# include <sys/bitypes.h>
-#endif
+#  include <sys/bitypes.h>
+# endif
 
-#undef _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H
+# undef _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H
 
 /* Minimum and maximum values for an integer type under the usual assumption.
    Return an unspecified value if BITS == 0, adding a check to pacify
    picky compilers.  */
 
-#define _STDINT_MIN(signed, bits, zero) \
-  ((signed) ? ~ _STDINT_MAX (signed, bits, zero) : (zero))
+/* These are separate macros, because if you try to merge these macros into
+   a single one, HP-UX cc rejects the resulting expression in constant
+   expressions.  */
+# define _STDINT_UNSIGNED_MIN(bits, zero) \
+    (zero)
+# define _STDINT_SIGNED_MIN(bits, zero) \
+    (~ _STDINT_MAX (1, bits, zero))
 
-#define _STDINT_MAX(signed, bits, zero) \
-  (((((zero) + 1) << ((bits) ? (bits) - 1 - (signed) : 0)) - 1) * 2 + 1)
+# define _STDINT_MAX(signed, bits, zero) \
+    (((((zero) + 1) << ((bits) ? (bits) - 1 - (signed) : 0)) - 1) * 2 + 1)
 
 #if !GNULIB_defined_stdint_types
 
@@ -130,26 +146,26 @@
 /* Here we assume a standard architecture where the hardware integer
    types have 8, 16, 32, optionally 64 bits.  */
 
-#undef int8_t
-#undef uint8_t
+# undef int8_t
+# undef uint8_t
 typedef signed char gl_int8_t;
 typedef unsigned char gl_uint8_t;
-#define int8_t gl_int8_t
-#define uint8_t gl_uint8_t
+# define int8_t gl_int8_t
+# define uint8_t gl_uint8_t
 
-#undef int16_t
-#undef uint16_t
+# undef int16_t
+# undef uint16_t
 typedef short int gl_int16_t;
 typedef unsigned short int gl_uint16_t;
-#define int16_t gl_int16_t
-#define uint16_t gl_uint16_t
+# define int16_t gl_int16_t
+# define uint16_t gl_uint16_t
 
-#undef int32_t
-#undef uint32_t
+# undef int32_t
+# undef uint32_t
 typedef int gl_int32_t;
 typedef unsigned int gl_uint32_t;
-#define int32_t gl_int32_t
-#define uint32_t gl_uint32_t
+# define int32_t gl_int32_t
+# define uint32_t gl_uint32_t
 
 /* If the system defines INT64_MAX, assume int64_t works.  That way,
    if the underlying platform defines int64_t to be a 64-bit long long
@@ -157,54 +173,54 @@
    int, which would mess up C++ name mangling.  We must use #ifdef
    rather than #if, to avoid an error with HP-UX 10.20 cc.  */
 
-#ifdef INT64_MAX
-# define GL_INT64_T
-#else
+# ifdef INT64_MAX
+#  define GL_INT64_T
+# else
 /* Do not undefine int64_t if gnulib is not being used with 64-bit
    types, since otherwise it breaks platforms like Tandem/NSK.  */
-# if LONG_MAX >> 31 >> 31 == 1
-#  undef int64_t
+#  if LONG_MAX >> 31 >> 31 == 1
+#   undef int64_t
 typedef long int gl_int64_t;
-#  define int64_t gl_int64_t
-#  define GL_INT64_T
-# elif defined _MSC_VER
-#  undef int64_t
+#   define int64_t gl_int64_t
+#   define GL_INT64_T
+#  elif defined _MSC_VER
+#   undef int64_t
 typedef __int64 gl_int64_t;
-#  define int64_t gl_int64_t
-#  define GL_INT64_T
-# elif @HAVE_LONG_LONG_INT@
-#  undef int64_t
+#   define int64_t gl_int64_t
+#   define GL_INT64_T
+#  elif @HAVE_LONG_LONG_INT@
+#   undef int64_t
 typedef long long int gl_int64_t;
-#  define int64_t gl_int64_t
-#  define GL_INT64_T
+#   define int64_t gl_int64_t
+#   define GL_INT64_T
+#  endif
 # endif
-#endif
 
-#ifdef UINT64_MAX
-# define GL_UINT64_T
-#else
-# if ULONG_MAX >> 31 >> 31 >> 1 == 1
-#  undef uint64_t
+# ifdef UINT64_MAX
+#  define GL_UINT64_T
+# else
+#  if ULONG_MAX >> 31 >> 31 >> 1 == 1
+#   undef uint64_t
 typedef unsigned long int gl_uint64_t;
-#  define uint64_t gl_uint64_t
-#  define GL_UINT64_T
-# elif defined _MSC_VER
-#  undef uint64_t
+#   define uint64_t gl_uint64_t
+#   define GL_UINT64_T
+#  elif defined _MSC_VER
+#   undef uint64_t
 typedef unsigned __int64 gl_uint64_t;
-#  define uint64_t gl_uint64_t
-#  define GL_UINT64_T
-# elif @HAVE_UNSIGNED_LONG_LONG_INT@
-#  undef uint64_t
+#   define uint64_t gl_uint64_t
+#   define GL_UINT64_T
+#  elif @HAVE_UNSIGNED_LONG_LONG_INT@
+#   undef uint64_t
 typedef unsigned long long int gl_uint64_t;
-#  define uint64_t gl_uint64_t
-#  define GL_UINT64_T
+#   define uint64_t gl_uint64_t
+#   define GL_UINT64_T
+#  endif
 # endif
-#endif
 
 /* Avoid collision with Solaris 2.5.1 <pthread.h> etc.  */
-#define _UINT8_T
-#define _UINT32_T
-#define _UINT64_T
+# define _UINT8_T
+# define _UINT32_T
+# define _UINT64_T
 
 
 /* 7.18.1.2. Minimum-width integer types */
@@ -213,26 +229,26 @@
    types have 8, 16, 32, optionally 64 bits. Therefore the leastN_t types
    are the same as the corresponding N_t types.  */
 
-#undef int_least8_t
-#undef uint_least8_t
-#undef int_least16_t
-#undef uint_least16_t
-#undef int_least32_t
-#undef uint_least32_t
-#undef int_least64_t
-#undef uint_least64_t
-#define int_least8_t int8_t
-#define uint_least8_t uint8_t
-#define int_least16_t int16_t
-#define uint_least16_t uint16_t
-#define int_least32_t int32_t
-#define uint_least32_t uint32_t
-#ifdef GL_INT64_T
-# define int_least64_t int64_t
-#endif
-#ifdef GL_UINT64_T
-# define uint_least64_t uint64_t
-#endif
+# undef int_least8_t
+# undef uint_least8_t
+# undef int_least16_t
+# undef uint_least16_t
+# undef int_least32_t
+# undef uint_least32_t
+# undef int_least64_t
+# undef uint_least64_t
+# define int_least8_t int8_t
+# define uint_least8_t uint8_t
+# define int_least16_t int16_t
+# define uint_least16_t uint16_t
+# define int_least32_t int32_t
+# define uint_least32_t uint32_t
+# ifdef GL_INT64_T
+#  define int_least64_t int64_t
+# endif
+# ifdef GL_UINT64_T
+#  define uint_least64_t uint64_t
+# endif
 
 /* 7.18.1.3. Fastest minimum-width integer types */
 
@@ -245,41 +261,41 @@
    uses types consistent with glibc, as that lessens the chance of
    incompatibility with older GNU hosts.  */
 
-#undef int_fast8_t
-#undef uint_fast8_t
-#undef int_fast16_t
-#undef uint_fast16_t
-#undef int_fast32_t
-#undef uint_fast32_t
-#undef int_fast64_t
-#undef uint_fast64_t
+# undef int_fast8_t
+# undef uint_fast8_t
+# undef int_fast16_t
+# undef uint_fast16_t
+# undef int_fast32_t
+# undef uint_fast32_t
+# undef int_fast64_t
+# undef uint_fast64_t
 typedef signed char gl_int_fast8_t;
 typedef unsigned char gl_uint_fast8_t;
 
-#ifdef __sun
+# ifdef __sun
 /* Define types compatible with SunOS 5.10, so that code compiled under
    earlier SunOS versions works with code compiled under SunOS 5.10.  */
 typedef int gl_int_fast32_t;
 typedef unsigned int gl_uint_fast32_t;
-#else
+# else
 typedef long int gl_int_fast32_t;
 typedef unsigned long int gl_uint_fast32_t;
-#endif
+# endif
 typedef gl_int_fast32_t gl_int_fast16_t;
 typedef gl_uint_fast32_t gl_uint_fast16_t;
 
-#define int_fast8_t gl_int_fast8_t
-#define uint_fast8_t gl_uint_fast8_t
-#define int_fast16_t gl_int_fast16_t
-#define uint_fast16_t gl_uint_fast16_t
-#define int_fast32_t gl_int_fast32_t
-#define uint_fast32_t gl_uint_fast32_t
-#ifdef GL_INT64_T
-# define int_fast64_t int64_t
-#endif
-#ifdef GL_UINT64_T
-# define uint_fast64_t uint64_t
-#endif
+# define int_fast8_t gl_int_fast8_t
+# define uint_fast8_t gl_uint_fast8_t
+# define int_fast16_t gl_int_fast16_t
+# define uint_fast16_t gl_uint_fast16_t
+# define int_fast32_t gl_int_fast32_t
+# define uint_fast32_t gl_uint_fast32_t
+# ifdef GL_INT64_T
+#  define int_fast64_t int64_t
+# endif
+# ifdef GL_UINT64_T
+#  define uint_fast64_t uint64_t
+# endif
 
 /* 7.18.1.4. Integer types capable of holding object pointers */
 
@@ -286,14 +302,14 @@
 /* kLIBC's stdint.h defines _INTPTR_T_DECLARED and needs its own
    definitions of intptr_t and uintptr_t (which use int and unsigned)
    to avoid clashes with declarations of system functions like sbrk.  */
-#ifndef _INTPTR_T_DECLARED
-#undef intptr_t
-#undef uintptr_t
+# ifndef _INTPTR_T_DECLARED
+# undef intptr_t
+# undef uintptr_t
 typedef long int gl_intptr_t;
 typedef unsigned long int gl_uintptr_t;
-#define intptr_t gl_intptr_t
-#define uintptr_t gl_uintptr_t
-#endif
+# define intptr_t gl_intptr_t
+# define uintptr_t gl_uintptr_t
+# endif
 
 /* 7.18.1.5. Greatest-width integer types */
 
@@ -304,33 +320,33 @@
    similarly for UINTMAX_MAX and uintmax_t.  This avoids problems with
    assuming one type where another is used by the system.  */
 
-#ifndef INTMAX_MAX
-# undef INTMAX_C
-# undef intmax_t
-# if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1
+# ifndef INTMAX_MAX
+#  undef INTMAX_C
+#  undef intmax_t
+#  if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1
 typedef long long int gl_intmax_t;
-#  define intmax_t gl_intmax_t
-# elif defined GL_INT64_T
-#  define intmax_t int64_t
-# else
+#   define intmax_t gl_intmax_t
+#  elif defined GL_INT64_T
+#   define intmax_t int64_t
+#  else
 typedef long int gl_intmax_t;
-#  define intmax_t gl_intmax_t
+#   define intmax_t gl_intmax_t
+#  endif
 # endif
-#endif
 
-#ifndef UINTMAX_MAX
-# undef UINTMAX_C
-# undef uintmax_t
-# if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1
+# ifndef UINTMAX_MAX
+#  undef UINTMAX_C
+#  undef uintmax_t
+#  if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1
 typedef unsigned long long int gl_uintmax_t;
-#  define uintmax_t gl_uintmax_t
-# elif defined GL_UINT64_T
-#  define uintmax_t uint64_t
-# else
+#   define uintmax_t gl_uintmax_t
+#  elif defined GL_UINT64_T
+#   define uintmax_t uint64_t
+#  else
 typedef unsigned long int gl_uintmax_t;
-#  define uintmax_t gl_uintmax_t
+#   define uintmax_t gl_uintmax_t
+#  endif
 # endif
-#endif
 
 /* Verify that intmax_t and uintmax_t have the same size.  Too much code
    breaks if this is not the case.  If this check fails, the reason is likely
@@ -338,8 +354,8 @@
 typedef int _verify_intmax_size[sizeof (intmax_t) == sizeof (uintmax_t)
                                 ? 1 : -1];
 
-#define GNULIB_defined_stdint_types 1
-#endif /* !GNULIB_defined_stdint_types */
+# define GNULIB_defined_stdint_types 1
+# endif /* !GNULIB_defined_stdint_types */
 
 /* 7.18.2. Limits of specified-width integer types */
 
@@ -348,37 +364,37 @@
 /* Here we assume a standard architecture where the hardware integer
    types have 8, 16, 32, optionally 64 bits.  */
 
-#undef INT8_MIN
-#undef INT8_MAX
-#undef UINT8_MAX
-#define INT8_MIN  (~ INT8_MAX)
-#define INT8_MAX  127
-#define UINT8_MAX  255
+# undef INT8_MIN
+# undef INT8_MAX
+# undef UINT8_MAX
+# define INT8_MIN  (~ INT8_MAX)
+# define INT8_MAX  127
+# define UINT8_MAX  255
 
-#undef INT16_MIN
-#undef INT16_MAX
-#undef UINT16_MAX
-#define INT16_MIN  (~ INT16_MAX)
-#define INT16_MAX  32767
-#define UINT16_MAX  65535
+# undef INT16_MIN
+# undef INT16_MAX
+# undef UINT16_MAX
+# define INT16_MIN  (~ INT16_MAX)
+# define INT16_MAX  32767
+# define UINT16_MAX  65535
 
-#undef INT32_MIN
-#undef INT32_MAX
-#undef UINT32_MAX
-#define INT32_MIN  (~ INT32_MAX)
-#define INT32_MAX  2147483647
-#define UINT32_MAX  4294967295U
+# undef INT32_MIN
+# undef INT32_MAX
+# undef UINT32_MAX
+# define INT32_MIN  (~ INT32_MAX)
+# define INT32_MAX  2147483647
+# define UINT32_MAX  4294967295U
 
-#if defined GL_INT64_T && ! defined INT64_MAX
+# if defined GL_INT64_T && ! defined INT64_MAX
 /* Prefer (- INTMAX_C (1) << 63) over (~ INT64_MAX) because SunPRO C 5.0
    evaluates the latter incorrectly in preprocessor expressions.  */
-# define INT64_MIN  (- INTMAX_C (1) << 63)
-# define INT64_MAX  INTMAX_C (9223372036854775807)
-#endif
+#  define INT64_MIN  (- INTMAX_C (1) << 63)
+#  define INT64_MAX  INTMAX_C (9223372036854775807)
+# endif
 
-#if defined GL_UINT64_T && ! defined UINT64_MAX
-# define UINT64_MAX  UINTMAX_C (18446744073709551615)
-#endif
+# if defined GL_UINT64_T && ! defined UINT64_MAX
+#  define UINT64_MAX  UINTMAX_C (18446744073709551615)
+# endif
 
 /* 7.18.2.2. Limits of minimum-width integer types */
 
@@ -386,38 +402,38 @@
    types have 8, 16, 32, optionally 64 bits. Therefore the leastN_t types
    are the same as the corresponding N_t types.  */
 
-#undef INT_LEAST8_MIN
-#undef INT_LEAST8_MAX
-#undef UINT_LEAST8_MAX
-#define INT_LEAST8_MIN  INT8_MIN
-#define INT_LEAST8_MAX  INT8_MAX
-#define UINT_LEAST8_MAX  UINT8_MAX
+# undef INT_LEAST8_MIN
+# undef INT_LEAST8_MAX
+# undef UINT_LEAST8_MAX
+# define INT_LEAST8_MIN  INT8_MIN
+# define INT_LEAST8_MAX  INT8_MAX
+# define UINT_LEAST8_MAX  UINT8_MAX
 
-#undef INT_LEAST16_MIN
-#undef INT_LEAST16_MAX
-#undef UINT_LEAST16_MAX
-#define INT_LEAST16_MIN  INT16_MIN
-#define INT_LEAST16_MAX  INT16_MAX
-#define UINT_LEAST16_MAX  UINT16_MAX
+# undef INT_LEAST16_MIN
+# undef INT_LEAST16_MAX
+# undef UINT_LEAST16_MAX
+# define INT_LEAST16_MIN  INT16_MIN
+# define INT_LEAST16_MAX  INT16_MAX
+# define UINT_LEAST16_MAX  UINT16_MAX
 
-#undef INT_LEAST32_MIN
-#undef INT_LEAST32_MAX
-#undef UINT_LEAST32_MAX
-#define INT_LEAST32_MIN  INT32_MIN
-#define INT_LEAST32_MAX  INT32_MAX
-#define UINT_LEAST32_MAX  UINT32_MAX
+# undef INT_LEAST32_MIN
+# undef INT_LEAST32_MAX
+# undef UINT_LEAST32_MAX
+# define INT_LEAST32_MIN  INT32_MIN
+# define INT_LEAST32_MAX  INT32_MAX
+# define UINT_LEAST32_MAX  UINT32_MAX
 
-#undef INT_LEAST64_MIN
-#undef INT_LEAST64_MAX
-#ifdef GL_INT64_T
-# define INT_LEAST64_MIN  INT64_MIN
-# define INT_LEAST64_MAX  INT64_MAX
-#endif
+# undef INT_LEAST64_MIN
+# undef INT_LEAST64_MAX
+# ifdef GL_INT64_T
+#  define INT_LEAST64_MIN  INT64_MIN
+#  define INT_LEAST64_MAX  INT64_MAX
+# endif
 
-#undef UINT_LEAST64_MAX
-#ifdef GL_UINT64_T
-# define UINT_LEAST64_MAX  UINT64_MAX
-#endif
+# undef UINT_LEAST64_MAX
+# ifdef GL_UINT64_T
+#  define UINT_LEAST64_MAX  UINT64_MAX
+# endif
 
 /* 7.18.2.3. Limits of fastest minimum-width integer types */
 
@@ -425,117 +441,121 @@
    types have 8, 16, 32, optionally 64 bits. Therefore the fastN_t types
    are taken from the same list of types.  */
 
-#undef INT_FAST8_MIN
-#undef INT_FAST8_MAX
-#undef UINT_FAST8_MAX
-#define INT_FAST8_MIN  SCHAR_MIN
-#define INT_FAST8_MAX  SCHAR_MAX
-#define UINT_FAST8_MAX  UCHAR_MAX
+# undef INT_FAST8_MIN
+# undef INT_FAST8_MAX
+# undef UINT_FAST8_MAX
+# define INT_FAST8_MIN  SCHAR_MIN
+# define INT_FAST8_MAX  SCHAR_MAX
+# define UINT_FAST8_MAX  UCHAR_MAX
 
-#undef INT_FAST16_MIN
-#undef INT_FAST16_MAX
-#undef UINT_FAST16_MAX
-#define INT_FAST16_MIN  INT_FAST32_MIN
-#define INT_FAST16_MAX  INT_FAST32_MAX
-#define UINT_FAST16_MAX  UINT_FAST32_MAX
+# undef INT_FAST16_MIN
+# undef INT_FAST16_MAX
+# undef UINT_FAST16_MAX
+# define INT_FAST16_MIN  INT_FAST32_MIN
+# define INT_FAST16_MAX  INT_FAST32_MAX
+# define UINT_FAST16_MAX  UINT_FAST32_MAX
 
-#undef INT_FAST32_MIN
-#undef INT_FAST32_MAX
-#undef UINT_FAST32_MAX
-#ifdef __sun
-# define INT_FAST32_MIN  INT_MIN
-# define INT_FAST32_MAX  INT_MAX
-# define UINT_FAST32_MAX  UINT_MAX
-#else
-# define INT_FAST32_MIN  LONG_MIN
-# define INT_FAST32_MAX  LONG_MAX
-# define UINT_FAST32_MAX  ULONG_MAX
-#endif
+# undef INT_FAST32_MIN
+# undef INT_FAST32_MAX
+# undef UINT_FAST32_MAX
+# ifdef __sun
+#  define INT_FAST32_MIN  INT_MIN
+#  define INT_FAST32_MAX  INT_MAX
+#  define UINT_FAST32_MAX  UINT_MAX
+# else
+#  define INT_FAST32_MIN  LONG_MIN
+#  define INT_FAST32_MAX  LONG_MAX
+#  define UINT_FAST32_MAX  ULONG_MAX
+# endif
 
-#undef INT_FAST64_MIN
-#undef INT_FAST64_MAX
-#ifdef GL_INT64_T
-# define INT_FAST64_MIN  INT64_MIN
-# define INT_FAST64_MAX  INT64_MAX
-#endif
+# undef INT_FAST64_MIN
+# undef INT_FAST64_MAX
+# ifdef GL_INT64_T
+#  define INT_FAST64_MIN  INT64_MIN
+#  define INT_FAST64_MAX  INT64_MAX
+# endif
 
-#undef UINT_FAST64_MAX
-#ifdef GL_UINT64_T
-# define UINT_FAST64_MAX  UINT64_MAX
-#endif
+# undef UINT_FAST64_MAX
+# ifdef GL_UINT64_T
+#  define UINT_FAST64_MAX  UINT64_MAX
+# endif
 
 /* 7.18.2.4. Limits of integer types capable of holding object pointers */
 
-#undef INTPTR_MIN
-#undef INTPTR_MAX
-#undef UINTPTR_MAX
-#define INTPTR_MIN  LONG_MIN
-#define INTPTR_MAX  LONG_MAX
-#define UINTPTR_MAX  ULONG_MAX
+# undef INTPTR_MIN
+# undef INTPTR_MAX
+# undef UINTPTR_MAX
+# define INTPTR_MIN  LONG_MIN
+# define INTPTR_MAX  LONG_MAX
+# define UINTPTR_MAX  ULONG_MAX
 
 /* 7.18.2.5. Limits of greatest-width integer types */
 
-#ifndef INTMAX_MAX
-# undef INTMAX_MIN
-# ifdef INT64_MAX
-#  define INTMAX_MIN  INT64_MIN
-#  define INTMAX_MAX  INT64_MAX
-# else
-#  define INTMAX_MIN  INT32_MIN
-#  define INTMAX_MAX  INT32_MAX
+# ifndef INTMAX_MAX
+#  undef INTMAX_MIN
+#  ifdef INT64_MAX
+#   define INTMAX_MIN  INT64_MIN
+#   define INTMAX_MAX  INT64_MAX
+#  else
+#   define INTMAX_MIN  INT32_MIN
+#   define INTMAX_MAX  INT32_MAX
+#  endif
 # endif
-#endif
 
-#ifndef UINTMAX_MAX
-# ifdef UINT64_MAX
-#  define UINTMAX_MAX  UINT64_MAX
-# else
-#  define UINTMAX_MAX  UINT32_MAX
+# ifndef UINTMAX_MAX
+#  ifdef UINT64_MAX
+#   define UINTMAX_MAX  UINT64_MAX
+#  else
+#   define UINTMAX_MAX  UINT32_MAX
+#  endif
 # endif
-#endif
 
 /* 7.18.3. Limits of other integer types */
 
 /* ptrdiff_t limits */
-#undef PTRDIFF_MIN
-#undef PTRDIFF_MAX
-#if @APPLE_UNIVERSAL_BUILD@
-# ifdef _LP64
-#  define PTRDIFF_MIN  _STDINT_MIN (1, 64, 0l)
-#  define PTRDIFF_MAX  _STDINT_MAX (1, 64, 0l)
+# undef PTRDIFF_MIN
+# undef PTRDIFF_MAX
+# if @APPLE_UNIVERSAL_BUILD@
+#  ifdef _LP64
+#   define PTRDIFF_MIN  _STDINT_SIGNED_MIN (64, 0l)
+#   define PTRDIFF_MAX  _STDINT_MAX (1, 64, 0l)
+#  else
+#   define PTRDIFF_MIN  _STDINT_SIGNED_MIN (32, 0)
+#   define PTRDIFF_MAX  _STDINT_MAX (1, 32, 0)
+#  endif
 # else
-#  define PTRDIFF_MIN  _STDINT_MIN (1, 32, 0)
-#  define PTRDIFF_MAX  _STDINT_MAX (1, 32, 0)
+#  define PTRDIFF_MIN  \
+    _STDINT_SIGNED_MIN (@BITSIZEOF_PTRDIFF_T@, address@hidden@)
+#  define PTRDIFF_MAX  \
+    _STDINT_MAX (1, @BITSIZEOF_PTRDIFF_T@, address@hidden@)
 # endif
-#else
-# define PTRDIFF_MIN  \
-    _STDINT_MIN (1, @BITSIZEOF_PTRDIFF_T@, address@hidden@)
-# define PTRDIFF_MAX  \
-    _STDINT_MAX (1, @BITSIZEOF_PTRDIFF_T@, address@hidden@)
-#endif
 
 /* sig_atomic_t limits */
-#undef SIG_ATOMIC_MIN
-#undef SIG_ATOMIC_MAX
-#define SIG_ATOMIC_MIN  \
-   _STDINT_MIN (@HAVE_SIGNED_SIG_ATOMIC_T@, @BITSIZEOF_SIG_ATOMIC_T@, \
-                address@hidden@)
-#define SIG_ATOMIC_MAX  \
+# undef SIG_ATOMIC_MIN
+# undef SIG_ATOMIC_MAX
+# if @HAVE_SIGNED_SIG_ATOMIC_T@
+#  define SIG_ATOMIC_MIN  \
+    _STDINT_SIGNED_MIN (@BITSIZEOF_SIG_ATOMIC_T@, address@hidden@)
+# else
+#  define SIG_ATOMIC_MIN  \
+    _STDINT_UNSIGNED_MIN (@BITSIZEOF_SIG_ATOMIC_T@, address@hidden@)
+# endif
+# define SIG_ATOMIC_MAX  \
    _STDINT_MAX (@HAVE_SIGNED_SIG_ATOMIC_T@, @BITSIZEOF_SIG_ATOMIC_T@, \
                 address@hidden@)
 
 
 /* size_t limit */
-#undef SIZE_MAX
-#if @APPLE_UNIVERSAL_BUILD@
-# ifdef _LP64
-#  define SIZE_MAX  _STDINT_MAX (0, 64, 0ul)
+# undef SIZE_MAX
+# if @APPLE_UNIVERSAL_BUILD@
+#  ifdef _LP64
+#   define SIZE_MAX  _STDINT_MAX (0, 64, 0ul)
+#  else
+#   define SIZE_MAX  _STDINT_MAX (0, 32, 0ul)
+#  endif
 # else
-#  define SIZE_MAX  _STDINT_MAX (0, 32, 0ul)
+#  define SIZE_MAX  _STDINT_MAX (0, @BITSIZEOF_SIZE_T@, address@hidden@)
 # endif
-#else
-# define SIZE_MAX  _STDINT_MAX (0, @BITSIZEOF_SIZE_T@, address@hidden@)
-#endif
 
 /* wchar_t limits */
 /* Get WCHAR_MIN, WCHAR_MAX.
@@ -543,29 +563,39 @@
    sequence of nested includes
    <wchar.h> -> <stdio.h> -> <getopt.h> -> <stdlib.h>, and the latter includes
    <stdint.h> and assumes its types are already defined.  */
-#if @HAVE_WCHAR_H@ && ! (defined WCHAR_MIN && defined WCHAR_MAX)
+# if @HAVE_WCHAR_H@ && ! (defined WCHAR_MIN && defined WCHAR_MAX)
   /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
      included before <wchar.h>.  */
-# include <stddef.h>
-# include <stdio.h>
-# include <time.h>
-# define _GL_JUST_INCLUDE_SYSTEM_WCHAR_H
-# include <wchar.h>
-# undef _GL_JUST_INCLUDE_SYSTEM_WCHAR_H
-#endif
-#undef WCHAR_MIN
-#undef WCHAR_MAX
-#define WCHAR_MIN  \
-   _STDINT_MIN (@HAVE_SIGNED_WCHAR_T@, @BITSIZEOF_WCHAR_T@, address@hidden@)
-#define WCHAR_MAX  \
+#  include <stddef.h>
+#  include <stdio.h>
+#  include <time.h>
+#  define _GL_JUST_INCLUDE_SYSTEM_WCHAR_H
+#  include <wchar.h>
+#  undef _GL_JUST_INCLUDE_SYSTEM_WCHAR_H
+# endif
+# undef WCHAR_MIN
+# undef WCHAR_MAX
+# if @HAVE_SIGNED_WCHAR_T@
+#  define WCHAR_MIN  \
+    _STDINT_SIGNED_MIN (@BITSIZEOF_WCHAR_T@, address@hidden@)
+# else
+#  define WCHAR_MIN  \
+    _STDINT_UNSIGNED_MIN (@BITSIZEOF_WCHAR_T@, address@hidden@)
+# endif
+# define WCHAR_MAX  \
    _STDINT_MAX (@HAVE_SIGNED_WCHAR_T@, @BITSIZEOF_WCHAR_T@, address@hidden@)
 
 /* wint_t limits */
-#undef WINT_MIN
-#undef WINT_MAX
-#define WINT_MIN  \
-   _STDINT_MIN (@HAVE_SIGNED_WINT_T@, @BITSIZEOF_WINT_T@, address@hidden@)
-#define WINT_MAX  \
+# undef WINT_MIN
+# undef WINT_MAX
+# if @HAVE_SIGNED_WINT_T@
+#  define WINT_MIN  \
+    _STDINT_SIGNED_MIN (@BITSIZEOF_WINT_T@, address@hidden@)
+# else
+#  define WINT_MIN  \
+    _STDINT_UNSIGNED_MIN (@BITSIZEOF_WINT_T@, address@hidden@)
+# endif
+# define WINT_MAX  \
    _STDINT_MAX (@HAVE_SIGNED_WINT_T@, @BITSIZEOF_WINT_T@, address@hidden@)
 
 /* 7.18.4. Macros for integer constants */
@@ -576,60 +606,121 @@
 /* Here we assume a standard architecture where the hardware integer
    types have 8, 16, 32, optionally 64 bits, and int is 32 bits.  */
 
-#undef INT8_C
-#undef UINT8_C
-#define INT8_C(x) x
-#define UINT8_C(x) x
+# undef INT8_C
+# undef UINT8_C
+# define INT8_C(x) x
+# define UINT8_C(x) x
 
-#undef INT16_C
-#undef UINT16_C
-#define INT16_C(x) x
-#define UINT16_C(x) x
+# undef INT16_C
+# undef UINT16_C
+# define INT16_C(x) x
+# define UINT16_C(x) x
 
-#undef INT32_C
-#undef UINT32_C
-#define INT32_C(x) x
-#define UINT32_C(x) x ## U
+# undef INT32_C
+# undef UINT32_C
+# define INT32_C(x) x
+# define UINT32_C(x) x ## U
 
-#undef INT64_C
-#undef UINT64_C
-#if LONG_MAX >> 31 >> 31 == 1
-# define INT64_C(x) x##L
-#elif defined _MSC_VER
-# define INT64_C(x) x##i64
-#elif @HAVE_LONG_LONG_INT@
-# define INT64_C(x) x##LL
-#endif
-#if ULONG_MAX >> 31 >> 31 >> 1 == 1
-# define UINT64_C(x) x##UL
-#elif defined _MSC_VER
-# define UINT64_C(x) x##ui64
-#elif @HAVE_UNSIGNED_LONG_LONG_INT@
-# define UINT64_C(x) x##ULL
-#endif
+# undef INT64_C
+# undef UINT64_C
+# if LONG_MAX >> 31 >> 31 == 1
+#  define INT64_C(x) x##L
+# elif defined _MSC_VER
+#  define INT64_C(x) x##i64
+# elif @HAVE_LONG_LONG_INT@
+#  define INT64_C(x) x##LL
+# endif
+# if ULONG_MAX >> 31 >> 31 >> 1 == 1
+#  define UINT64_C(x) x##UL
+# elif defined _MSC_VER
+#  define UINT64_C(x) x##ui64
+# elif @HAVE_UNSIGNED_LONG_LONG_INT@
+#  define UINT64_C(x) x##ULL
+# endif
 
 /* 7.18.4.2. Macros for greatest-width integer constants */
 
-#ifndef INTMAX_C
-# if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1
-#  define INTMAX_C(x)   x##LL
-# elif defined GL_INT64_T
-#  define INTMAX_C(x)   INT64_C(x)
-# else
-#  define INTMAX_C(x)   x##L
+# ifndef INTMAX_C
+#  if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1
+#   define INTMAX_C(x)   x##LL
+#  elif defined GL_INT64_T
+#   define INTMAX_C(x)   INT64_C(x)
+#  else
+#   define INTMAX_C(x)   x##L
+#  endif
 # endif
-#endif
 
-#ifndef UINTMAX_C
-# if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1
-#  define UINTMAX_C(x)  x##ULL
-# elif defined GL_UINT64_T
-#  define UINTMAX_C(x)  UINT64_C(x)
-# else
-#  define UINTMAX_C(x)  x##UL
+# ifndef UINTMAX_C
+#  if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1
+#   define UINTMAX_C(x)  x##ULL
+#  elif defined GL_UINT64_T
+#   define UINTMAX_C(x)  UINT64_C(x)
+#  else
+#   define UINTMAX_C(x)  x##UL
+#  endif
 # endif
-#endif
 
+#endif /* address@hidden@ */
+
+/* Macros specified by ISO/IEC TS 18661-1:2014.  */
+
+#if (!defined UINTMAX_WIDTH \
+     && (defined _GNU_SOURCE || defined __STDC_WANT_IEC_60559_BFP_EXT__))
+# ifdef INT8_MAX
+#  define INT8_WIDTH _GL_INTEGER_WIDTH (INT8_MIN, INT8_MAX)
+# endif
+# ifdef UINT8_MAX
+#  define UINT8_WIDTH _GL_INTEGER_WIDTH (0, UINT8_MAX)
+# endif
+# ifdef INT16_MAX
+#  define INT16_WIDTH _GL_INTEGER_WIDTH (INT16_MIN, INT16_MAX)
+# endif
+# ifdef UINT16_MAX
+#  define UINT16_WIDTH _GL_INTEGER_WIDTH (0, UINT16_MAX)
+# endif
+# ifdef INT32_MAX
+#  define INT32_WIDTH _GL_INTEGER_WIDTH (INT32_MIN, INT32_MAX)
+# endif
+# ifdef UINT32_MAX
+#  define UINT32_WIDTH _GL_INTEGER_WIDTH (0, UINT32_MAX)
+# endif
+# ifdef INT64_MAX
+#  define INT64_WIDTH _GL_INTEGER_WIDTH (INT64_MIN, INT64_MAX)
+# endif
+# ifdef UINT64_MAX
+#  define UINT64_WIDTH _GL_INTEGER_WIDTH (0, UINT64_MAX)
+# endif
+# define INT_LEAST8_WIDTH _GL_INTEGER_WIDTH (INT_LEAST8_MIN, INT_LEAST8_MAX)
+# define UINT_LEAST8_WIDTH _GL_INTEGER_WIDTH (0, UINT_LEAST8_MAX)
+# define INT_LEAST16_WIDTH _GL_INTEGER_WIDTH (INT_LEAST16_MIN, INT_LEAST16_MAX)
+# define UINT_LEAST16_WIDTH _GL_INTEGER_WIDTH (0, UINT_LEAST16_MAX)
+# define INT_LEAST32_WIDTH _GL_INTEGER_WIDTH (INT_LEAST32_MIN, INT_LEAST32_MAX)
+# define UINT_LEAST32_WIDTH _GL_INTEGER_WIDTH (0, UINT_LEAST32_MAX)
+# define INT_LEAST64_WIDTH _GL_INTEGER_WIDTH (INT_LEAST64_MIN, INT_LEAST64_MAX)
+# define UINT_LEAST64_WIDTH _GL_INTEGER_WIDTH (0, UINT_LEAST64_MAX)
+# define INT_FAST8_WIDTH _GL_INTEGER_WIDTH (INT_FAST8_MIN, INT_FAST8_MAX)
+# define UINT_FAST8_WIDTH _GL_INTEGER_WIDTH (0, UINT_FAST8_MAX)
+# define INT_FAST16_WIDTH _GL_INTEGER_WIDTH (INT_FAST16_MIN, INT_FAST16_MAX)
+# define UINT_FAST16_WIDTH _GL_INTEGER_WIDTH (0, UINT_FAST16_MAX)
+# define INT_FAST32_WIDTH _GL_INTEGER_WIDTH (INT_FAST32_MIN, INT_FAST32_MAX)
+# define UINT_FAST32_WIDTH _GL_INTEGER_WIDTH (0, UINT_FAST32_MAX)
+# define INT_FAST64_WIDTH _GL_INTEGER_WIDTH (INT_FAST64_MIN, INT_FAST64_MAX)
+# define UINT_FAST64_WIDTH _GL_INTEGER_WIDTH (0, UINT_FAST64_MAX)
+# define INTPTR_WIDTH _GL_INTEGER_WIDTH (INTPTR_MIN, INTPTR_MAX)
+# define UINTPTR_WIDTH _GL_INTEGER_WIDTH (0, UINTPTR_MAX)
+# define INTMAX_WIDTH _GL_INTEGER_WIDTH (INTMAX_MIN, INTMAX_MAX)
+# define UINTMAX_WIDTH _GL_INTEGER_WIDTH (0, UINTMAX_MAX)
+# define PTRDIFF_WIDTH _GL_INTEGER_WIDTH (PTRDIFF_MIN, PTRDIFF_MAX)
+# define SIZE_WIDTH _GL_INTEGER_WIDTH (0, SIZE_MAX)
+# define WCHAR_WIDTH _GL_INTEGER_WIDTH (WCHAR_MIN, WCHAR_MAX)
+# ifdef WINT_MAX
+#  define WINT_WIDTH _GL_INTEGER_WIDTH (WINT_MIN, WINT_MAX)
+# endif
+# ifdef SIG_ATOMIC_MAX
+#  define SIG_ATOMIC_WIDTH _GL_INTEGER_WIDTH (SIG_ATOMIC_MIN, SIG_ATOMIC_MAX)
+# endif
+#endif /* !WINT_WIDTH && (_GNU_SOURCE || __STDC_WANT_IEC_60559_BFP_EXT__) */
+
 #endif /* address@hidden@_STDINT_H */
 #endif /* !(defined __ANDROID__ && ...) */
 #endif /* !defined address@hidden@_STDINT_H && !defined 
_GL_JUST_INCLUDE_SYSTEM_STDINT_H */

Modified: trunk/gnulib/lib/stdio.in.h
===================================================================
--- trunk/gnulib/lib/stdio.in.h 2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/stdio.in.h 2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,6 +1,6 @@
 /* A GNU-like <stdio.h>.
 
-   Copyright (C) 2004, 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2007-2017 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
@@ -118,7 +118,27 @@
 # include <unistd.h>
 #endif
 
+/* MSVC declares 'perror' in <stdlib.h>, not in <stdio.h>.  We must include
+   it before we  #define perror rpl_perror.  */
+/* But in any case avoid namespace pollution on glibc systems.  */
+#if (@GNULIB_PERROR@ || defined GNULIB_POSIXCHECK) \
+    && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) \
+    && ! defined __GLIBC__
+# include <stdlib.h>
+#endif
 
+/* MSVC declares 'remove' in <io.h>, not in <stdio.h>.  We must include
+   it before we  #define remove rpl_remove.  */
+/* MSVC declares 'rename' in <io.h>, not in <stdio.h>.  We must include
+   it before we  #define rename rpl_rename.  */
+/* But in any case avoid namespace pollution on glibc systems.  */
+#if (@GNULIB_REMOVE@ || @GNULIB_RENAME@ || defined GNULIB_POSIXCHECK) \
+    && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) \
+    && ! defined __GLIBC__
+# include <io.h>
+#endif
+
+
 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
 
 /* The definition of _GL_ARG_NONNULL is copied here.  */

Modified: trunk/gnulib/lib/stdlib.in.h
===================================================================
--- trunk/gnulib/lib/stdlib.in.h        2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/stdlib.in.h        2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,6 +1,6 @@
 /* A GNU-like <stdlib.h>.
 
-   Copyright (C) 1995, 2001-2004, 2006-2016 Free Software Foundation, Inc.
+   Copyright (C) 1995, 2001-2004, 2006-2017 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
@@ -521,6 +521,9 @@
 #endif
 
 #if @GNULIB_QSORT_R@
+/* Sort an array of NMEMB elements, starting at address BASE, each element
+   occupying SIZE bytes, in ascending order according to the comparison
+   function COMPARE.  */
 # if @REPLACE_QSORT_R@
 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #   undef qsort_r
@@ -535,6 +538,12 @@
                                                   void *),
                                   void *arg));
 # else
+#  if address@hidden@
+_GL_FUNCDECL_SYS (qsort_r, void, (void *base, size_t nmemb, size_t size,
+                                  int (*compare) (void const *, void const *,
+                                                  void *),
+                                  void *arg) _GL_ARG_NONNULL ((1, 4)));
+#  endif
 _GL_CXXALIAS_SYS (qsort_r, void, (void *base, size_t nmemb, size_t size,
                                   int (*compare) (void const *, void const *,
                                                   void *),
@@ -541,6 +550,12 @@
                                   void *arg));
 # endif
 _GL_CXXALIASWARN (qsort_r);
+#elif defined GNULIB_POSIXCHECK
+# undef qsort_r
+# if HAVE_RAW_DECL_QSORT_R
+_GL_WARN_ON_USE (qsort_r, "qsort_r is not portable - "
+                 "use gnulib module qsort_r for portability");
+# endif
 #endif
 
 

Modified: trunk/gnulib/lib/stpcpy.c
===================================================================
--- trunk/gnulib/lib/stpcpy.c   2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/stpcpy.c   2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 /* stpcpy.c -- copy a string and return pointer to end of new string
-   Copyright (C) 1992, 1995, 1997-1998, 2006, 2009-2016 Free Software
+   Copyright (C) 1992, 1995, 1997-1998, 2006, 2009-2017 Free Software
    Foundation, Inc.
 
    NOTE: The canonical source of this file is maintained with the GNU C 
Library.

Modified: trunk/gnulib/lib/str-kmp.h
===================================================================
--- trunk/gnulib/lib/str-kmp.h  2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/str-kmp.h  2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,6 +1,6 @@
 /* Substring search in a NUL terminated string of UNIT elements,
    using the Knuth-Morris-Pratt algorithm.
-   Copyright (C) 2005-2016 Free Software Foundation, Inc.
+   Copyright (C) 2005-2017 Free Software Foundation, Inc.
    Written by Bruno Haible <address@hidden>, 2005.
 
    This program is free software; you can redistribute it and/or modify

Modified: trunk/gnulib/lib/str-two-way.h
===================================================================
--- trunk/gnulib/lib/str-two-way.h      2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/str-two-way.h      2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 /* Byte-wise substring search, using the Two-Way algorithm.
-   Copyright (C) 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 2008-2017 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Written by Eric Blake <address@hidden>, 2008.
 

Modified: trunk/gnulib/lib/strcasecmp.c
===================================================================
--- trunk/gnulib/lib/strcasecmp.c       2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/strcasecmp.c       2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 /* Case-insensitive string comparison function.
-   Copyright (C) 1998-1999, 2005-2007, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 1998-1999, 2005-2007, 2009-2017 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

Modified: trunk/gnulib/lib/strcasestr.c
===================================================================
--- trunk/gnulib/lib/strcasestr.c       2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/strcasestr.c       2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 /* Case-insensitive searching in a string.
-   Copyright (C) 2005-2016 Free Software Foundation, Inc.
+   Copyright (C) 2005-2017 Free Software Foundation, Inc.
    Written by Bruno Haible <address@hidden>, 2005.
 
    This program is free software; you can redistribute it and/or modify

Modified: trunk/gnulib/lib/strdup.c
===================================================================
--- trunk/gnulib/lib/strdup.c   2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/strdup.c   2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1996-1998, 2002-2004, 2006-2007, 2009-2016 Free Software
+/* Copyright (C) 1991, 1996-1998, 2002-2004, 2006-2007, 2009-2017 Free Software
    Foundation, Inc.
 
    This file is part of the GNU C Library.

Modified: trunk/gnulib/lib/streq.h
===================================================================
--- trunk/gnulib/lib/streq.h    2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/streq.h    2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 /* Optimized string comparison.
-   Copyright (C) 2001-2002, 2007, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2001-2002, 2007, 2009-2017 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

Modified: trunk/gnulib/lib/strerror-override.c
===================================================================
--- trunk/gnulib/lib/strerror-override.c        2017-04-14 16:36:56 UTC (rev 
7725)
+++ trunk/gnulib/lib/strerror-override.c        2017-04-14 17:20:48 UTC (rev 
7726)
@@ -1,6 +1,6 @@
 /* strerror-override.c --- POSIX compatible system error routine
 
-   Copyright (C) 2010-2016 Free Software Foundation, Inc.
+   Copyright (C) 2010-2017 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

Modified: trunk/gnulib/lib/strerror-override.h
===================================================================
--- trunk/gnulib/lib/strerror-override.h        2017-04-14 16:36:56 UTC (rev 
7725)
+++ trunk/gnulib/lib/strerror-override.h        2017-04-14 17:20:48 UTC (rev 
7726)
@@ -1,6 +1,6 @@
 /* strerror-override.h --- POSIX compatible system error routine
 
-   Copyright (C) 2010-2016 Free Software Foundation, Inc.
+   Copyright (C) 2010-2017 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

Modified: trunk/gnulib/lib/strerror.c
===================================================================
--- trunk/gnulib/lib/strerror.c 2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/strerror.c 2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,6 +1,6 @@
 /* strerror.c --- POSIX compatible system error routine
 
-   Copyright (C) 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007-2017 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
@@ -66,5 +66,6 @@
   if (sizeof buf <= len)
     abort ();
 
-  return memcpy (buf, msg, len + 1);
+  memcpy (buf, msg, len + 1);
+  return buf;
 }

Modified: trunk/gnulib/lib/string.in.h
===================================================================
--- trunk/gnulib/lib/string.in.h        2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/string.in.h        2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,6 +1,6 @@
 /* A GNU-like <string.h>.
 
-   Copyright (C) 1995-1996, 2001-2016 Free Software Foundation, Inc.
+   Copyright (C) 1995-1996, 2001-2017 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

Modified: trunk/gnulib/lib/strings.in.h
===================================================================
--- trunk/gnulib/lib/strings.in.h       2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/strings.in.h       2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,6 +1,6 @@
 /* A substitute <strings.h>.
 
-   Copyright (C) 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007-2017 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

Added: trunk/gnulib/lib/stripslash.c
===================================================================
--- trunk/gnulib/lib/stripslash.c                               (rev 0)
+++ trunk/gnulib/lib/stripslash.c       2017-04-14 17:20:48 UTC (rev 7726)
@@ -0,0 +1,45 @@
+/* stripslash.c -- remove redundant trailing slashes from a file name
+
+   Copyright (C) 1990, 2001, 2003-2006, 2009-2017 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 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU 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/>.  */
+
+#include <config.h>
+
+#include "dirname.h"
+
+/* Remove trailing slashes from FILE.  Return true if a trailing slash
+   was removed.  This is useful when using file name completion from a
+   shell that adds a "/" after directory names (such as tcsh and
+   bash), because on symlinks to directories, several system calls
+   have different semantics according to whether a trailing slash is
+   present.  */
+
+bool
+strip_trailing_slashes (char *file)
+{
+  char *base = last_component (file);
+  char *base_lim;
+  bool had_slash;
+
+  /* last_component returns "" for file system roots, but we need to turn
+     "///" into "/".  */
+  if (! *base)
+    base = file;
+  base_lim = base + base_len (base);
+  had_slash = (*base_lim != '\0');
+  *base_lim = '\0';
+  return had_slash;
+}

Modified: trunk/gnulib/lib/strncasecmp.c
===================================================================
--- trunk/gnulib/lib/strncasecmp.c      2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/strncasecmp.c      2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 /* strncasecmp.c -- case insensitive string comparator
-   Copyright (C) 1998-1999, 2005-2007, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 1998-1999, 2005-2007, 2009-2017 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

Modified: trunk/gnulib/lib/strndup.c
===================================================================
--- trunk/gnulib/lib/strndup.c  2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/strndup.c  2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,6 +1,6 @@
 /* A replacement function, for systems that lack strndup.
 
-   Copyright (C) 1996-1998, 2001-2003, 2005-2007, 2009-2016 Free Software
+   Copyright (C) 1996-1998, 2001-2003, 2005-2007, 2009-2017 Free Software
    Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify it

Modified: trunk/gnulib/lib/strnlen.c
===================================================================
--- trunk/gnulib/lib/strnlen.c  2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/strnlen.c  2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 /* Find the length of STRING, but scan at most MAXLEN characters.
-   Copyright (C) 2005-2007, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2005-2007, 2009-2017 Free Software Foundation, Inc.
    Written by Simon Josefsson.
 
    This program is free software; you can redistribute it and/or modify

Modified: trunk/gnulib/lib/strnlen1.c
===================================================================
--- trunk/gnulib/lib/strnlen1.c 2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/strnlen1.c 2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 /* Find the length of STRING + 1, but scan at most MAXLEN bytes.
-   Copyright (C) 2005-2006, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2005-2006, 2009-2017 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

Modified: trunk/gnulib/lib/strnlen1.h
===================================================================
--- trunk/gnulib/lib/strnlen1.h 2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/strnlen1.h 2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 /* Find the length of STRING + 1, but scan at most MAXLEN bytes.
-   Copyright (C) 2005, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2005, 2009-2017 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

Modified: trunk/gnulib/lib/strstr.c
===================================================================
--- trunk/gnulib/lib/strstr.c   2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/strstr.c   2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-1994, 1996-1998, 2000, 2004, 2007-2016 Free Software
+/* Copyright (C) 1991-1994, 1996-1998, 2000, 2004, 2007-2017 Free Software
    Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -26,10 +26,6 @@
 
 #include <stdbool.h>
 
-#ifndef _LIBC
-# define __builtin_expect(expr, val)   (expr)
-#endif
-
 #define RETURN_TYPE char *
 #define AVAILABLE(h, h_l, j, n_l)                       \
   (!memchr ((h) + (h_l), '\0', (j) + (n_l) - (h_l))     \

Modified: trunk/gnulib/lib/sys_types.in.h
===================================================================
--- trunk/gnulib/lib/sys_types.in.h     2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/sys_types.in.h     2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,6 +1,6 @@
 /* Provide a more complete sys/types.h.
 
-   Copyright (C) 2011-2016 Free Software Foundation, Inc.
+   Copyright (C) 2011-2017 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

Modified: trunk/gnulib/lib/unistd.in.h
===================================================================
--- trunk/gnulib/lib/unistd.in.h        2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/unistd.in.h        2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 /* Substitute for and wrapper around <unistd.h>.
-   Copyright (C) 2003-2016 Free Software Foundation, Inc.
+   Copyright (C) 2003-2017 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
@@ -55,9 +55,13 @@
 #include <stddef.h>
 
 /* mingw doesn't define the SEEK_* or *_FILENO macros in <unistd.h>.  */
+/* MSVC declares 'unlink' in <stdio.h>, not in <unistd.h>.  We must include
+   it before we  #define unlink rpl_unlink.  */
 /* Cygwin 1.7.1 declares symlinkat in <stdio.h>, not in <unistd.h>.  */
 /* But avoid namespace pollution on glibc systems.  */
 #if (!(defined SEEK_CUR && defined SEEK_END && defined SEEK_SET) \
+     || ((@GNULIB_UNLINK@ || defined GNULIB_POSIXCHECK) \
+         && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)) \
      || ((@GNULIB_SYMLINKAT@ || defined GNULIB_POSIXCHECK) \
          && defined __CYGWIN__)) \
     && ! defined __GLIBC__
@@ -123,11 +127,18 @@
 # include <sys/types.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.  */
+
+
 /* Get getopt(), optarg, optind, opterr, optopt.
    But avoid namespace pollution on glibc systems.  */
 #if @GNULIB_UNISTD_H_GETOPT@ && !defined __GLIBC__ && !defined 
_GL_SYSTEM_GETOPT
-# define __need_getopt
-# include <getopt.h>
+# include <getopt-cdefs.h>
+# include <getopt-pfx-core.h>
 #endif
 
 #ifndef _GL_INLINE_HEADER_BEGIN
@@ -138,13 +149,6 @@
 # define _GL_UNISTD_INLINE _GL_INLINE
 #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.  */
-
-
 /* Hide some function declarations from <winsock2.h>.  */
 
 #if @GNULIB_GETHOSTNAME@ && @UNISTD_H_HAVE_WINSOCK2_H@
@@ -776,7 +780,7 @@
      ${LOGNAME-$USER}        on Unix platforms,
      $USERNAME               on native Windows platforms.
  */
-# if address@hidden@
+# if address@hidden@
 _GL_FUNCDECL_SYS (getlogin, char *, (void));
 # endif
 _GL_CXXALIAS_SYS (getlogin, char *, (void));

Modified: trunk/gnulib/lib/unitypes.in.h
===================================================================
--- trunk/gnulib/lib/unitypes.in.h      2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/unitypes.in.h      2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 /* Elementary types and macros for the GNU UniString library.
-   Copyright (C) 2002, 2005-2006, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2005-2006, 2009-2017 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

Modified: trunk/gnulib/lib/uniwidth/cjk.h
===================================================================
--- trunk/gnulib/lib/uniwidth/cjk.h     2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/uniwidth/cjk.h     2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 /* Test for CJK encoding.
-   Copyright (C) 2001-2002, 2005-2007, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2001-2002, 2005-2007, 2009-2017 Free Software Foundation, Inc.
    Written by Bruno Haible <address@hidden>, 2002.
 
    This program is free software: you can redistribute it and/or modify it

Modified: trunk/gnulib/lib/uniwidth/width.c
===================================================================
--- trunk/gnulib/lib/uniwidth/width.c   2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/uniwidth/width.c   2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 /* Determine display width of Unicode character.
-   Copyright (C) 2001-2002, 2006-2016 Free Software Foundation, Inc.
+   Copyright (C) 2001-2002, 2006-2017 Free Software Foundation, Inc.
    Written by Bruno Haible <address@hidden>, 2002.
 
    This program is free software: you can redistribute it and/or modify it

Modified: trunk/gnulib/lib/uniwidth.in.h
===================================================================
--- trunk/gnulib/lib/uniwidth.in.h      2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/uniwidth.in.h      2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 /* Display width functions.
-   Copyright (C) 2001-2002, 2005, 2007, 2009-2016 Free Software Foundation,
+   Copyright (C) 2001-2002, 2005, 2007, 2009-2017 Free Software Foundation,
    Inc.
 
    This program is free software: you can redistribute it and/or modify it

Modified: trunk/gnulib/lib/vasnprintf.c
===================================================================
--- trunk/gnulib/lib/vasnprintf.c       2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/vasnprintf.c       2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 /* vsprintf with automatic memory allocation.
-   Copyright (C) 1999, 2002-2016 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2002-2017 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
@@ -4832,9 +4832,9 @@
                     break;
 # else
                     *fbp++ = 'l';
-                    /*FALLTHROUGH*/
 # endif
 #endif
+                    /*FALLTHROUGH*/
                   case TYPE_LONGINT:
                   case TYPE_ULONGINT:
 #if HAVE_WINT_T

Modified: trunk/gnulib/lib/vasnprintf.h
===================================================================
--- trunk/gnulib/lib/vasnprintf.h       2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/vasnprintf.h       2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 /* vsprintf with automatic memory allocation.
-   Copyright (C) 2002-2004, 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2002-2004, 2007-2017 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

Modified: trunk/gnulib/lib/vasprintf.c
===================================================================
--- trunk/gnulib/lib/vasprintf.c        2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/vasprintf.c        2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 /* Formatted output to strings.
-   Copyright (C) 1999, 2002, 2006-2016 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2002, 2006-2017 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

Modified: trunk/gnulib/lib/verify.h
===================================================================
--- trunk/gnulib/lib/verify.h   2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/verify.h   2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,6 +1,6 @@
 /* Compile-time assert-like macros.
 
-   Copyright (C) 2005-2006, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2005-2006, 2009-2017 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
@@ -248,7 +248,12 @@
 /* Verify requirement R at compile-time, as a declaration without a
    trailing ';'.  */
 
-#define verify(R) _GL_VERIFY (R, "verify (" #R ")")
+#ifdef __GNUC__
+# define verify(R) _GL_VERIFY (R, "verify (" #R ")")
+#else
+/* PGI barfs if R is long.  Play it safe.  */
+# define verify(R) _GL_VERIFY (R, "verify (...)")
+#endif
 
 #ifndef __has_builtin
 # define __has_builtin(x) 0

Modified: trunk/gnulib/lib/wchar.in.h
===================================================================
--- trunk/gnulib/lib/wchar.in.h 2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/wchar.in.h 2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,6 +1,6 @@
 /* A substitute for ISO C99 <wchar.h>, for platforms that have issues.
 
-   Copyright (C) 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007-2017 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -35,6 +35,7 @@
      || (defined __hpux                                                 \
          && ((defined _INTTYPES_INCLUDED && !defined strtoimax)         \
              || defined _GL_JUST_INCLUDE_SYSTEM_WCHAR_H))               \
+     || (defined __MINGW32__ && defined __STRING_H_SOURCED__)           \
      || defined _GL_ALREADY_INCLUDING_WCHAR_H)
 /* Special invocation convention:
    - Inside glibc and uClibc header files, but not MinGW.
@@ -44,6 +45,8 @@
      and once directly.  In both situations 'wint_t' is not yet defined,
      therefore we cannot provide the function overrides; instead include only
      the system's <wchar.h>.
+   - With MinGW 3.22, when <string.h> includes <wchar.h>, only some part of
+     <wchar.h> is actually processed, and that doesn't include 'mbstate_t'.
    - On IRIX 6.5, similarly, we have an include <wchar.h> -> <wctype.h>, and
      the latter includes <wchar.h>.  But here, we have no way to detect whether
      <wctype.h> is completely included or is still being included.  */
@@ -110,10 +113,10 @@
 #  define WEOF -1
 # endif
 #else
-/* MSVC defines wint_t as 'unsigned short' in <crtdefs.h>.
+/* mingw and MSVC define wint_t as 'unsigned short' in <crtdefs.h>.
    This is too small: ISO C 99 section 7.24.1.(2) says that wint_t must be
    "unchanged by default argument promotions".  Override it.  */
-# if defined _MSC_VER
+# if @GNULIB_OVERRIDES_WINT_T@
 #  if !GNULIB_defined_wint_t
 #   include <crtdefs.h>
 typedef unsigned int rpl_wint_t;

Modified: trunk/gnulib/lib/wcrtomb.c
===================================================================
--- trunk/gnulib/lib/wcrtomb.c  2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/wcrtomb.c  2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 /* Convert wide character to multibyte character.
-   Copyright (C) 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 2008-2017 Free Software Foundation, Inc.
    Written by Bruno Haible <address@hidden>, 2008.
 
    This program is free software: you can redistribute it and/or modify

Modified: trunk/gnulib/lib/wctype.in.h
===================================================================
--- trunk/gnulib/lib/wctype.in.h        2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/wctype.in.h        2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,6 +1,6 @@
 /* A substitute for ISO C99 <wctype.h>, for platforms that lack it.
 
-   Copyright (C) 2006-2016 Free Software Foundation, Inc.
+   Copyright (C) 2006-2017 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
@@ -25,13 +25,25 @@
  * wctrans_t, and wctype_t are not yet implemented.
  */
 
-#ifndef address@hidden@_WCTYPE_H
-
 #if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
 #endif
 @PRAGMA_COLUMNS@
 
+#if (defined __MINGW32__ && defined __CTYPE_H_SOURCED__)
+
+/* Special invocation convention:
+   - With MinGW 3.22, when <ctype.h> includes <wctype.h>, only some part of
+     <wctype.h> is being processed, which doesn't include the idempotency
+     guard.   */
+
address@hidden@ @NEXT_WCTYPE_H@
+
+#else
+/* Normal invocation convention.  */
+
+#ifndef address@hidden@_WCTYPE_H
+
 #if @HAVE_WINT_T@
 /* Solaris 2.5 has a bug: <wchar.h> must be included before <wctype.h>.
    Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
@@ -93,10 +105,10 @@
 #  define WEOF -1
 # endif
 #else
-/* MSVC defines wint_t as 'unsigned short' in <crtdefs.h>.
+/* mingw and MSVC define wint_t as 'unsigned short' in <crtdefs.h>.
    This is too small: ISO C 99 section 7.24.1.(2) says that wint_t must be
    "unchanged by default argument promotions".  Override it.  */
-# if defined _MSC_VER
+# if @GNULIB_OVERRIDES_WINT_T@
 #  if !GNULIB_defined_wint_t
 #   include <crtdefs.h>
 typedef unsigned int rpl_wint_t;
@@ -512,3 +524,4 @@
 
 #endif /* address@hidden@_WCTYPE_H */
 #endif /* address@hidden@_WCTYPE_H */
+#endif

Modified: trunk/gnulib/lib/wcwidth.c
===================================================================
--- trunk/gnulib/lib/wcwidth.c  2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/wcwidth.c  2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 /* Determine the number of screen columns needed for a character.
-   Copyright (C) 2006-2007, 2010-2016 Free Software Foundation, Inc.
+   Copyright (C) 2006-2007, 2010-2017 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

Modified: trunk/gnulib/lib/xalloc-die.c
===================================================================
--- trunk/gnulib/lib/xalloc-die.c       2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/xalloc-die.c       2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,6 +1,6 @@
 /* Report a memory allocation failure and exit.
 
-   Copyright (C) 1997-2000, 2002-2004, 2006, 2009-2016 Free Software
+   Copyright (C) 1997-2000, 2002-2004, 2006, 2009-2017 Free Software
    Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify

Modified: trunk/gnulib/lib/xalloc-oversized.h
===================================================================
--- trunk/gnulib/lib/xalloc-oversized.h 2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/xalloc-oversized.h 2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,6 +1,6 @@
 /* xalloc-oversized.h -- memory allocation size checking
 
-   Copyright (C) 1990-2000, 2003-2004, 2006-2016 Free Software Foundation, Inc.
+   Copyright (C) 1990-2000, 2003-2004, 2006-2017 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -19,40 +19,37 @@
 #define XALLOC_OVERSIZED_H_
 
 #include <stddef.h>
+#include <stdint.h>
 
-/* Default for (non-Clang) compilers that lack __has_builtin.  */
-#ifndef __has_builtin
-# define __has_builtin(x) 0
-#endif
-
-/* True if N * S would overflow in a size calculation.
+/* True if N * S would overflow in a size_t calculation,
+   or would generate a value larger than PTRDIFF_MAX.
    This expands to a constant expression if N and S are both constants.
    By gnulib convention, SIZE_MAX represents overflow in size
-   calculations, so the conservative dividend to use here is
-   SIZE_MAX - 1, since SIZE_MAX might represent an overflowed value.
-   However, malloc (SIZE_MAX) fails on all known hosts where
-   sizeof (ptrdiff_t) <= sizeof (size_t), so do not bother to test for
-   exactly-SIZE_MAX allocations on such hosts; this avoids a test and
-   branch when S is known to be 1.  */
+   calculations, so the conservative size_t-based dividend to use here
+   is SIZE_MAX - 1.  */
 #define __xalloc_oversized(n, s) \
-    ((size_t) (sizeof (ptrdiff_t) <= sizeof (size_t) ? -1 : -2) / (s) < (n))
+  ((size_t) (PTRDIFF_MAX < SIZE_MAX ? PTRDIFF_MAX : SIZE_MAX - 1) / (s) < (n))
 
+#if PTRDIFF_MAX < SIZE_MAX
+typedef ptrdiff_t __xalloc_count_type;
+#else
+typedef size_t __xalloc_count_type;
+#endif
 
-/* Return 1 if an array of N objects, each of size S, cannot exist due
-   to size arithmetic overflow.  S must be positive and N must be
-   nonnegative.  This is a macro, not a function, so that it
-   works correctly even when SIZE_MAX < N.  */
+/* Return 1 if an array of N objects, each of size S, cannot exist
+   reliably due to size or ptrdiff_t arithmetic overflow.  S must be
+   positive and N must be nonnegative.  This is a macro, not a
+   function, so that it works correctly even when SIZE_MAX < N.  */
 
-#if 7 <= __GNUC__ || __has_builtin (__builtin_add_overflow_p)
-# define xalloc_oversized(n, s) __builtin_mul_overflow_p (n, s, (size_t) 1)
-#elif ((5 <= __GNUC__ \
-        || (__has_builtin (__builtin_mul_overflow) \
-            && __has_builtin (__builtin_constant_p))) \
-       && !__STRICT_ANSI__)
+#if 7 <= __GNUC__
 # define xalloc_oversized(n, s) \
+   __builtin_mul_overflow_p (n, s, (__xalloc_count_type) 1)
+#elif 5 <= __GNUC__ && !__STRICT_ANSI__
+# define xalloc_oversized(n, s) \
    (__builtin_constant_p (n) && __builtin_constant_p (s) \
     ? __xalloc_oversized (n, s) \
-    : ({ size_t __xalloc_size; __builtin_mul_overflow (n, s, &__xalloc_size); 
}))
+    : ({ __xalloc_count_type __xalloc_count; \
+         __builtin_mul_overflow (n, s, &__xalloc_count); }))
 
 /* Other compilers use integer division; this may be slower but is
    more portable.  */

Modified: trunk/gnulib/lib/xalloc.h
===================================================================
--- trunk/gnulib/lib/xalloc.h   2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/xalloc.h   2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,6 +1,6 @@
 /* xalloc.h -- malloc with out-of-memory checking
 
-   Copyright (C) 1990-2000, 2003-2004, 2006-2016 Free Software Foundation, Inc.
+   Copyright (C) 1990-2000, 2003-2004, 2006-2017 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -19,6 +19,7 @@
 #define XALLOC_H_
 
 #include <stddef.h>
+#include <stdint.h>
 
 #include "xalloc-oversized.h"
 
@@ -197,10 +198,11 @@
   else
     {
       /* 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 may be slightly conservative, but an exact check isn't
-         worth the trouble.  */
-      if ((size_t) -1 / 3 * 2 / s <= n)
+         Check for overflow, so that N * S stays in both ptrdiff_t and
+         size_t range.  The check may be slightly conservative, but an
+         exact check isn't worth the trouble.  */
+      if ((PTRDIFF_MAX < SIZE_MAX ? PTRDIFF_MAX : SIZE_MAX) / 3 * 2 / s
+          <= n)
         xalloc_die ();
       n += n / 2 + 1;
     }

Modified: trunk/gnulib/lib/xmalloc.c
===================================================================
--- trunk/gnulib/lib/xmalloc.c  2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/xmalloc.c  2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,6 +1,6 @@
 /* xmalloc.c -- malloc with out of memory checking
 
-   Copyright (C) 1990-2000, 2002-2006, 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 1990-2000, 2002-2006, 2008-2017 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
@@ -93,11 +93,11 @@
 xcalloc (size_t n, size_t s)
 {
   void *p;
-  /* Test for overflow, since some calloc implementations don't have
-     proper overflow checks.  But omit overflow and size-zero tests if
-     HAVE_GNU_CALLOC, since GNU calloc catches overflow and never
-     returns NULL if successful.  */
-  if ((! HAVE_GNU_CALLOC && xalloc_oversized (n, s))
+  /* Test for overflow, since objects with size greater than
+     PTRDIFF_MAX cause pointer subtraction to go awry.  Omit size-zero
+     tests if HAVE_GNU_CALLOC, since GNU calloc never returns NULL if
+     successful.  */
+  if (xalloc_oversized (n, s)
       || (! (p = calloc (n, s)) && (HAVE_GNU_CALLOC || n != 0)))
     xalloc_die ();
   return p;

Modified: trunk/gnulib/lib/xsize.h
===================================================================
--- trunk/gnulib/lib/xsize.h    2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/lib/xsize.h    2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,6 +1,6 @@
 /* xsize.h -- Checked size_t computations.
 
-   Copyright (C) 2003, 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2008-2017 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

Modified: trunk/gnulib/m4/00gnulib.m4
===================================================================
--- trunk/gnulib/m4/00gnulib.m4 2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/00gnulib.m4 2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 # 00gnulib.m4 serial 3
-dnl Copyright (C) 2009-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2009-2017 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.

Modified: trunk/gnulib/m4/absolute-header.m4
===================================================================
--- trunk/gnulib/m4/absolute-header.m4  2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/absolute-header.m4  2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 # absolute-header.m4 serial 16
-dnl Copyright (C) 2006-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2006-2017 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.

Modified: trunk/gnulib/m4/alloca.m4
===================================================================
--- trunk/gnulib/m4/alloca.m4   2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/alloca.m4   2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 # alloca.m4 serial 14
-dnl Copyright (C) 2002-2004, 2006-2007, 2009-2016 Free Software Foundation,
+dnl Copyright (C) 2002-2004, 2006-2007, 2009-2017 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,

Modified: trunk/gnulib/m4/argz.m4
===================================================================
--- trunk/gnulib/m4/argz.m4     2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/argz.m4     2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,6 +1,6 @@
 # Portability macros for glibc argz.                    -*- Autoconf -*-
 #
-#   Copyright (C) 2004-2016 Free Software Foundation, Inc.
+#   Copyright (C) 2004-2017 Free Software Foundation, Inc.
 #   Written by Gary V. Vaughan <address@hidden>
 #
 # This file is free software; the Free Software Foundation gives

Modified: trunk/gnulib/m4/btowc.m4
===================================================================
--- trunk/gnulib/m4/btowc.m4    2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/btowc.m4    2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 # btowc.m4 serial 10
-dnl Copyright (C) 2008-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2008-2017 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.

Added: trunk/gnulib/m4/builtin-expect.m4
===================================================================
--- trunk/gnulib/m4/builtin-expect.m4                           (rev 0)
+++ trunk/gnulib/m4/builtin-expect.m4   2017-04-14 17:20:48 UTC (rev 7726)
@@ -0,0 +1,49 @@
+dnl Check for __builtin_expect.
+
+dnl Copyright 2016-2017 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl Written by Paul Eggert.
+
+AC_DEFUN([gl___BUILTIN_EXPECT],
+[
+  AC_CACHE_CHECK([for __builtin_expect],
+    [gl_cv___builtin_expect],
+    [AC_LINK_IFELSE(
+       [AC_LANG_SOURCE([[
+         int
+         main (int argc, char **argv)
+         {
+           argc = __builtin_expect (argc, 100);
+           return argv[argc != 100][0];
+         }]])],
+       [gl_cv___builtin_expect=yes],
+       [AC_LINK_IFELSE(
+          [AC_LANG_SOURCE([[
+             #include <builtins.h>
+             int
+             main (int argc, char **argv)
+             {
+               argc = __builtin_expect (argc, 100);
+               return argv[argc != 100][0];
+             }]])],
+          [gl_cv___builtin_expect="in <builtins.h>"],
+          [gl_cv___builtin_expect=no])])])
+  if test "$gl_cv___builtin_expect" = yes; then
+    AC_DEFINE([HAVE___BUILTIN_EXPECT], [1])
+  elif test "$gl_cv___builtin_expect" = "in <builtins.h>"; then
+    AC_DEFINE([HAVE___BUILTIN_EXPECT], [2])
+  fi
+  AH_VERBATIM([HAVE___BUILTIN_EXPECT],
+    [/* Define to 1 if the compiler supports __builtin_expect,
+   and to 2 if <builtins.h> does.  */
+#undef HAVE___BUILTIN_EXPECT
+#ifndef HAVE___BUILTIN_EXPECT
+# define __builtin_expect(e, c) (e)
+#elif HAVE___BUILTIN_EXPECT == 2
+# include <builtins.h>
+#endif
+    ])
+])

Modified: trunk/gnulib/m4/configmake.m4
===================================================================
--- trunk/gnulib/m4/configmake.m4       2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/configmake.m4       2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 # configmake.m4 serial 2
-dnl Copyright (C) 2010-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2010-2017 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.

Added: trunk/gnulib/m4/dirname.m4
===================================================================
--- trunk/gnulib/m4/dirname.m4                          (rev 0)
+++ trunk/gnulib/m4/dirname.m4  2017-04-14 17:20:48 UTC (rev 7726)
@@ -0,0 +1,19 @@
+#serial 10   -*- autoconf -*-
+dnl Copyright (C) 2002-2006, 2009-2017 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_DIRNAME],
+[
+  AC_REQUIRE([gl_DIRNAME_LGPL])
+])
+
+AC_DEFUN([gl_DIRNAME_LGPL],
+[
+  dnl Prerequisites of lib/dirname.h.
+  AC_REQUIRE([gl_DOUBLE_SLASH_ROOT])
+
+  dnl No prerequisites of lib/basename-lgpl.c, lib/dirname-lgpl.c,
+  dnl lib/stripslash.c.
+])

Added: trunk/gnulib/m4/double-slash-root.m4
===================================================================
--- trunk/gnulib/m4/double-slash-root.m4                                (rev 0)
+++ trunk/gnulib/m4/double-slash-root.m4        2017-04-14 17:20:48 UTC (rev 
7726)
@@ -0,0 +1,38 @@
+# double-slash-root.m4 serial 4   -*- Autoconf -*-
+dnl Copyright (C) 2006, 2008-2017 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_DOUBLE_SLASH_ROOT],
+[
+  AC_REQUIRE([AC_CANONICAL_HOST])
+  AC_CACHE_CHECK([whether // is distinct from /], [gl_cv_double_slash_root],
+    [ if test x"$cross_compiling" = xyes ; then
+        # When cross-compiling, there is no way to tell whether // is special
+        # short of a list of hosts.  However, the only known hosts to date
+        # that have a distinct // are Apollo DomainOS (too old to port to),
+        # Cygwin, and z/OS.  If anyone knows of another system for which // has
+        # special semantics and is distinct from /, please report it to
+        # <address@hidden>.
+        case $host in
+          *-cygwin | i370-ibm-openedition)
+            gl_cv_double_slash_root=yes ;;
+          *)
+            # Be optimistic and assume that / and // are the same when we
+            # don't know.
+            gl_cv_double_slash_root='unknown, assuming no' ;;
+        esac
+      else
+        set x `ls -di / // 2>/dev/null`
+        if test "$[2]" = "$[4]" && wc //dev/null >/dev/null 2>&1; then
+          gl_cv_double_slash_root=no
+        else
+          gl_cv_double_slash_root=yes
+        fi
+      fi])
+  if test "$gl_cv_double_slash_root" = yes; then
+    AC_DEFINE([DOUBLE_SLASH_IS_DISTINCT_ROOT], [1],
+      [Define to 1 if // is a file system root distinct from /.])
+  fi
+])

Modified: trunk/gnulib/m4/eealloc.m4
===================================================================
--- trunk/gnulib/m4/eealloc.m4  2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/eealloc.m4  2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 # eealloc.m4 serial 3
-dnl Copyright (C) 2003, 2009-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2003, 2009-2017 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.

Modified: trunk/gnulib/m4/errno_h.m4
===================================================================
--- trunk/gnulib/m4/errno_h.m4  2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/errno_h.m4  2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 # errno_h.m4 serial 12
-dnl Copyright (C) 2004, 2006, 2008-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2004, 2006, 2008-2017 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.

Modified: trunk/gnulib/m4/error.m4
===================================================================
--- trunk/gnulib/m4/error.m4    2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/error.m4    2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,6 +1,6 @@
 #serial 14
 
-# Copyright (C) 1996-1998, 2001-2004, 2009-2016 Free Software Foundation, Inc.
+# Copyright (C) 1996-1998, 2001-2004, 2009-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,

Modified: trunk/gnulib/m4/exponentd.m4
===================================================================
--- trunk/gnulib/m4/exponentd.m4        2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/exponentd.m4        2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 # exponentd.m4 serial 3
-dnl Copyright (C) 2007-2008, 2010-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2007-2008, 2010-2017 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.

Modified: trunk/gnulib/m4/extensions.m4
===================================================================
--- trunk/gnulib/m4/extensions.m4       2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/extensions.m4       2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,7 +1,7 @@
-# serial 13  -*- Autoconf -*-
+# serial 15  -*- Autoconf -*-
 # Enable extensions on systems that normally disable them.
 
-# Copyright (C) 2003, 2006-2016 Free Software Foundation, Inc.
+# Copyright (C) 2003, 2006-2017 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.
@@ -60,7 +60,7 @@
 #ifndef _ALL_SOURCE
 # undef _ALL_SOURCE
 #endif
-/* Enable general extensions on OS X.  */
+/* Enable general extensions on macOS.  */
 #ifndef _DARWIN_C_SOURCE
 # undef _DARWIN_C_SOURCE
 #endif
@@ -68,14 +68,38 @@
 #ifndef _GNU_SOURCE
 # undef _GNU_SOURCE
 #endif
-/* Use GNU style printf and scanf.  */
-#ifndef __USE_MINGW_ANSI_STDIO
-# undef __USE_MINGW_ANSI_STDIO
-#endif
 /* Enable threading extensions on Solaris.  */
 #ifndef _POSIX_PTHREAD_SEMANTICS
 # undef _POSIX_PTHREAD_SEMANTICS
 #endif
+/* Enable extensions specified by ISO/IEC TS 18661-5:2014.  */
+#ifndef __STDC_WANT_IEC_60559_ATTRIBS_EXT__
+# undef __STDC_WANT_IEC_60559_ATTRIBS_EXT__
+#endif
+/* Enable extensions specified by ISO/IEC TS 18661-1:2014.  */
+#ifndef __STDC_WANT_IEC_60559_BFP_EXT__
+# undef __STDC_WANT_IEC_60559_BFP_EXT__
+#endif
+/* Enable extensions specified by ISO/IEC TS 18661-2:2015.  */
+#ifndef __STDC_WANT_IEC_60559_DFP_EXT__
+# undef __STDC_WANT_IEC_60559_DFP_EXT__
+#endif
+/* Enable extensions specified by ISO/IEC TS 18661-4:2015.  */
+#ifndef __STDC_WANT_IEC_60559_FUNCS_EXT__
+# undef __STDC_WANT_IEC_60559_FUNCS_EXT__
+#endif
+/* Enable extensions specified by ISO/IEC TS 18661-3:2015.  */
+#ifndef __STDC_WANT_IEC_60559_TYPES_EXT__
+# undef __STDC_WANT_IEC_60559_TYPES_EXT__
+#endif
+/* Enable extensions specified by ISO/IEC TR 24731-2:2010.  */
+#ifndef __STDC_WANT_LIB_EXT2__
+# undef __STDC_WANT_LIB_EXT2__
+#endif
+/* Enable extensions specified by ISO/IEC 24747:2009.  */
+#ifndef __STDC_WANT_MATH_SPEC_FUNCS__
+# undef __STDC_WANT_MATH_SPEC_FUNCS__
+#endif
 /* Enable extensions on HP NonStop.  */
 #ifndef _TANDEM_SOURCE
 # undef _TANDEM_SOURCE
@@ -104,8 +128,14 @@
   AC_DEFINE([_ALL_SOURCE])
   AC_DEFINE([_DARWIN_C_SOURCE])
   AC_DEFINE([_GNU_SOURCE])
-  AC_DEFINE([__USE_MINGW_ANSI_STDIO])
   AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
+  AC_DEFINE([__STDC_WANT_IEC_60559_ATTRIBS_EXT__])
+  AC_DEFINE([__STDC_WANT_IEC_60559_BFP_EXT__])
+  AC_DEFINE([__STDC_WANT_IEC_60559_DFP_EXT__])
+  AC_DEFINE([__STDC_WANT_IEC_60559_FUNCS_EXT__])
+  AC_DEFINE([__STDC_WANT_IEC_60559_TYPES_EXT__])
+  AC_DEFINE([__STDC_WANT_LIB_EXT2__])
+  AC_DEFINE([__STDC_WANT_MATH_SPEC_FUNCS__])
   AC_DEFINE([_TANDEM_SOURCE])
   AC_CACHE_CHECK([whether _XOPEN_SOURCE should be defined],
     [ac_cv_should_define__xopen_source],

Modified: trunk/gnulib/m4/extern-inline.m4
===================================================================
--- trunk/gnulib/m4/extern-inline.m4    2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/extern-inline.m4    2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,6 +1,6 @@
 dnl 'extern inline' a la ISO C99.
 
-dnl Copyright 2012-2016 Free Software Foundation, Inc.
+dnl Copyright 2012-2017 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.

Modified: trunk/gnulib/m4/fcntl-o.m4
===================================================================
--- trunk/gnulib/m4/fcntl-o.m4  2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/fcntl-o.m4  2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 # fcntl-o.m4 serial 4
-dnl Copyright (C) 2006, 2009-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2006, 2009-2017 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.

Modified: trunk/gnulib/m4/float_h.m4
===================================================================
--- trunk/gnulib/m4/float_h.m4  2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/float_h.m4  2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 # float_h.m4 serial 9
-dnl Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2007, 2009-2017 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.

Modified: trunk/gnulib/m4/getopt.m4
===================================================================
--- trunk/gnulib/m4/getopt.m4   2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/getopt.m4   2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
-# getopt.m4 serial 44
-dnl Copyright (C) 2002-2006, 2008-2016 Free Software Foundation, Inc.
+# getopt.m4 serial 46
+dnl Copyright (C) 2002-2006, 2008-2017 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.
@@ -33,8 +33,6 @@
 AC_DEFUN([gl_FUNC_GETOPT_GNU],
 [
   m4_divert_text([INIT_PREPARE], [gl_getopt_required=GNU])
-
-  AC_REQUIRE([gl_FUNC_GETOPT_POSIX])
 ])
 
 # Determine whether to replace the entire getopt facility.
@@ -354,15 +352,19 @@
 
 AC_DEFUN([gl_GETOPT_SUBSTITUTE_HEADER],
 [
-  GETOPT_H=getopt.h
+  AC_CHECK_HEADERS_ONCE([sys/cdefs.h])
+  if test $ac_cv_header_sys_cdefs_h = yes; then
+    HAVE_SYS_CDEFS_H=1
+  else
+    HAVE_SYS_CDEFS_H=0
+  fi
+  AC_SUBST([HAVE_SYS_CDEFS_H])
+
   AC_DEFINE([__GETOPT_PREFIX], [[rpl_]],
     [Define to rpl_ if the getopt replacement functions and variables
      should be used.])
+  GETOPT_H=getopt.h
+  GETOPT_CDEFS_H=getopt-cdefs.h
   AC_SUBST([GETOPT_H])
+  AC_SUBST([GETOPT_CDEFS_H])
 ])
-
-# Prerequisites of lib/getopt*.
-AC_DEFUN([gl_PREREQ_GETOPT],
-[
-  AC_CHECK_DECLS_ONCE([getenv])
-])

Added: trunk/gnulib/m4/getprogname.m4
===================================================================
--- trunk/gnulib/m4/getprogname.m4                              (rev 0)
+++ trunk/gnulib/m4/getprogname.m4      2017-04-14 17:20:48 UTC (rev 7726)
@@ -0,0 +1,43 @@
+# getprogname.m4 - check for getprogname or replacements for it
+
+# Copyright (C) 2016-2017 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.
+
+# serial 4
+
+AC_DEFUN([gl_FUNC_GETPROGNAME],
+[
+  AC_CHECK_FUNCS_ONCE([getprogname getexecname])
+  AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+  ac_found=0
+  AC_CHECK_DECLS([program_invocation_name], [ac_found=1], [],
+    [#include <errno.h>])
+  AC_CHECK_DECLS([program_invocation_short_name], [ac_found=1], [],
+    [#include <errno.h>])
+  AC_CHECK_DECLS([__argv], [ac_found=1], [], [#include <stdlib.h>])
+
+  # Incur the cost of this test only if none of the above worked.
+  if test $ac_found = 0; then
+    # On OpenBSD 5.1, using the global __progname variable appears to be
+    # the only way to implement getprogname.
+    AC_CACHE_CHECK([whether __progname is defined in default libraries],
+      [gl_cv_var___progname],
+      [
+        gl_cv_var___progname=
+        AC_LINK_IFELSE(
+          [AC_LANG_PROGRAM(
+            [[extern char *__progname;]],
+            [[return *__progname;]]
+          )],
+          [gl_cv_var___progname=yes]
+        )
+      ]
+    )
+    if test "$gl_cv_var___progname" = yes; then
+      AC_DEFINE([HAVE_VAR___PROGNAME], 1,
+        [Define if you have a global __progname variable])
+    fi
+  fi
+])

Modified: trunk/gnulib/m4/glibc2.m4
===================================================================
--- trunk/gnulib/m4/glibc2.m4   2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/glibc2.m4   2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 # glibc2.m4 serial 3
-dnl Copyright (C) 2000-2002, 2004, 2008, 2010-2016 Free Software Foundation,
+dnl Copyright (C) 2000-2002, 2004, 2008, 2010-2017 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,

Modified: trunk/gnulib/m4/glibc21.m4
===================================================================
--- trunk/gnulib/m4/glibc21.m4  2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/glibc21.m4  2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 # glibc21.m4 serial 5
-dnl Copyright (C) 2000-2002, 2004, 2008, 2010-2016 Free Software Foundation,
+dnl Copyright (C) 2000-2002, 2004, 2008, 2010-2017 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,

Modified: trunk/gnulib/m4/gnulib-cache.m4
===================================================================
--- trunk/gnulib/m4/gnulib-cache.m4     2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/gnulib-cache.m4     2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2016 Free Software Foundation, Inc.
+# Copyright (C) 2002-2017 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

Modified: trunk/gnulib/m4/gnulib-common.m4
===================================================================
--- trunk/gnulib/m4/gnulib-common.m4    2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/gnulib-common.m4    2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
-# gnulib-common.m4 serial 36
-dnl Copyright (C) 2007-2016 Free Software Foundation, Inc.
+# gnulib-common.m4 serial 38
+dnl Copyright (C) 2007-2017 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.
@@ -256,7 +256,8 @@
   dnl library formats. In particular, the GNU binutils programs ar and ranlib
   dnl produce libraries that work only with gcc, not with cc.
   AC_REQUIRE([AC_PROG_CC])
-  AC_BEFORE([$0], [AM_PROG_AR])
+  dnl The '][' hides this use from 'aclocal'.
+  AC_BEFORE([$0], [A][M_PROG_AR])
   AC_CACHE_CHECK([for Minix Amsterdam compiler], [gl_cv_c_amsterdam_compiler],
     [
       AC_EGREP_CPP([Amsterdam],
@@ -288,7 +289,9 @@
     dnl __ACK__.  It may seem like its easier to avoid calling the macro here,
     dnl but we need to AC_SUBST both AR/ARFLAGS (thus those must have some good
     dnl default value and automake should usually know them).
-    m4_ifdef([AM_PROG_AR], [AM_PROG_AR], [:])
+    dnl
+    dnl The '][' hides this use from 'aclocal'.
+    m4_ifdef([A][M_PROG_AR], [A][M_PROG_AR], [:])
   fi
 
   dnl In case the code above has not helped with setting AR/ARFLAGS, use
@@ -456,7 +459,9 @@
      else
        ac_cv_path_SED=$SED
      fi
+    ])
  SED="$ac_cv_path_SED"
  AC_SUBST([SED])dnl
  rm -f conftest.sed
-])])])
+])
+])

Modified: trunk/gnulib/m4/gnulib-comp.m4
===================================================================
--- trunk/gnulib/m4/gnulib-comp.m4      2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/gnulib-comp.m4      2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 # DO NOT EDIT! GENERATED AUTOMATICALLY!
-# Copyright (C) 2002-2016 Free Software Foundation, Inc.
+# Copyright (C) 2002-2017 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
@@ -47,7 +47,11 @@
   # Code from module alloca-opt:
   # Code from module argz:
   # Code from module btowc:
+  # Code from module builtin-expect:
   # Code from module configmake:
+  # Code from module dirname-lgpl:
+  # Code from module dosname:
+  # Code from module double-slash-root:
   # Code from module errno:
   # Code from module error:
   # Code from module exitfail:
@@ -56,6 +60,7 @@
   # Code from module float:
   # Code from module getopt-gnu:
   # Code from module getopt-posix:
+  # Code from module getprogname:
   # Code from module gettext:
   # Code from module gettext-h:
   # Code from module hard-locale:
@@ -65,6 +70,7 @@
   # Code from module intprops:
   # Code from module iswblank:
   # Code from module langinfo:
+  # Code from module limits-h:
   # Code from module localcharset:
   # Code from module locale:
   # Code from module localeconv:
@@ -165,6 +171,8 @@
   if test -n "$ARGZ_H"; then
     AC_LIBOBJ([argz])
   fi
+  gl_DIRNAME_LGPL
+  gl_DOUBLE_SLASH_ROOT
   gl_HEADER_ERRNO_H
   gl_ERROR
   if test $ac_cv_lib_error_at_line = no; then
@@ -183,24 +191,15 @@
     AC_LIBOBJ([itold])
   fi
   gl_FUNC_GETOPT_GNU
-  if test $REPLACE_GETOPT = 1; then
-    AC_LIBOBJ([getopt])
-    AC_LIBOBJ([getopt1])
-    gl_PREREQ_GETOPT
-    dnl Arrange for unistd.h to include getopt.h.
-    GNULIB_GL_UNISTD_H_GETOPT=1
-  fi
-  AC_SUBST([GNULIB_GL_UNISTD_H_GETOPT])
-  gl_MODULE_INDICATOR_FOR_TESTS([getopt-gnu])
   gl_FUNC_GETOPT_POSIX
   if test $REPLACE_GETOPT = 1; then
     AC_LIBOBJ([getopt])
     AC_LIBOBJ([getopt1])
-    gl_PREREQ_GETOPT
     dnl Arrange for unistd.h to include getopt.h.
     GNULIB_GL_UNISTD_H_GETOPT=1
   fi
   AC_SUBST([GNULIB_GL_UNISTD_H_GETOPT])
+  gl_FUNC_GETPROGNAME
   dnl you must add AM_GNU_GETTEXT([external]) or similar to configure.ac.
   AM_GNU_GETTEXT_VERSION([0.18.1])
   AC_SUBST([LIBINTL])
@@ -217,6 +216,12 @@
     fi
   fi
   gl_WCTYPE_MODULE_INDICATOR([iswblank])
+  gl_LIMITS_H
+  gl_FUNC_MALLOC_POSIX
+  if test $REPLACE_MALLOC = 1; then
+    AC_LIBOBJ([malloc])
+  fi
+  gl_STDLIB_MODULE_INDICATOR([malloc-posix])
   gl_MALLOCA
   gl_MBCHAR
   gl_MBITER
@@ -325,6 +330,7 @@
   gl_WCHAR_MODULE_INDICATOR([wcwidth])
   gl_XALLOC
   gl_gnulib_enabled_btowc=false
+  gl_gnulib_enabled_37f71b604aa9c54446783d80f42fe547=false
   gl_gnulib_enabled_configmake=false
   gl_gnulib_enabled_30838f5439487421042f2225bed3af76=false
   gl_gnulib_enabled_intprops=false
@@ -333,7 +339,6 @@
   gl_gnulib_enabled_locale=false
   gl_gnulib_enabled_localeconv=false
   gl_gnulib_enabled_lock=false
-  gl_gnulib_enabled_ef455225c00f5049c808c2eda3e76866=false
   gl_gnulib_enabled_mbtowc=false
   gl_gnulib_enabled_mempcpy=false
   gl_gnulib_enabled_f691f076f650964c9f5598c3ee487616=false
@@ -364,6 +369,13 @@
       fi
     fi
   }
+  func_gl_gnulib_m4code_37f71b604aa9c54446783d80f42fe547 ()
+  {
+    if ! $gl_gnulib_enabled_37f71b604aa9c54446783d80f42fe547; then
+      gl___BUILTIN_EXPECT
+      gl_gnulib_enabled_37f71b604aa9c54446783d80f42fe547=true
+    fi
+  }
   func_gl_gnulib_m4code_configmake ()
   {
     if ! $gl_gnulib_enabled_configmake; then
@@ -430,17 +442,6 @@
       func_gl_gnulib_m4code_threadlib
     fi
   }
-  func_gl_gnulib_m4code_ef455225c00f5049c808c2eda3e76866 ()
-  {
-    if ! $gl_gnulib_enabled_ef455225c00f5049c808c2eda3e76866; then
-      gl_FUNC_MALLOC_POSIX
-      if test $REPLACE_MALLOC = 1; then
-        AC_LIBOBJ([malloc])
-      fi
-      gl_STDLIB_MODULE_INDICATOR([malloc-posix])
-      gl_gnulib_enabled_ef455225c00f5049c808c2eda3e76866=true
-    fi
-  }
   func_gl_gnulib_m4code_mbtowc ()
   {
     if ! $gl_gnulib_enabled_mbtowc; then
@@ -563,6 +564,9 @@
       fi
       gl_STRING_MODULE_INDICATOR([strstr])
       gl_gnulib_enabled_f84f170cca5f5b09d22686d5b833aa41=true
+      if test $REPLACE_STRSTR = 1; then
+        func_gl_gnulib_m4code_37f71b604aa9c54446783d80f42fe547
+      fi
     fi
   }
   func_gl_gnulib_m4code_threadlib ()
@@ -624,6 +628,12 @@
   if test $ac_use_included_regex = yes; then
     func_gl_gnulib_m4code_btowc
   fi
+  if test $ac_use_included_regex = yes; then
+    func_gl_gnulib_m4code_37f71b604aa9c54446783d80f42fe547
+  fi
+  if test $ac_use_included_regex = yes; then
+    func_gl_gnulib_m4code_intprops
+  fi
   if test "$ac_cv_gnu_library_2_1:$ac_use_included_regex" = no:yes; then
     func_gl_gnulib_m4code_lock
   fi
@@ -633,9 +643,6 @@
   if test $ac_use_included_regex = yes; then
     func_gl_gnulib_m4code_wcrtomb
   fi
-  if test $ac_cv_func_strdup = no || test $REPLACE_STRDUP = 1; then
-    func_gl_gnulib_m4code_ef455225c00f5049c808c2eda3e76866
-  fi
   if test $REPLACE_STRERROR = 1; then
     func_gl_gnulib_m4code_intprops
   fi
@@ -650,6 +657,7 @@
   fi
   m4_pattern_allow([^gl_GNULIB_ENABLED_])
   AM_CONDITIONAL([gl_GNULIB_ENABLED_btowc], [$gl_gnulib_enabled_btowc])
+  AM_CONDITIONAL([gl_GNULIB_ENABLED_37f71b604aa9c54446783d80f42fe547], 
[$gl_gnulib_enabled_37f71b604aa9c54446783d80f42fe547])
   AM_CONDITIONAL([gl_GNULIB_ENABLED_configmake], 
[$gl_gnulib_enabled_configmake])
   AM_CONDITIONAL([gl_GNULIB_ENABLED_30838f5439487421042f2225bed3af76], 
[$gl_gnulib_enabled_30838f5439487421042f2225bed3af76])
   AM_CONDITIONAL([gl_GNULIB_ENABLED_intprops], [$gl_gnulib_enabled_intprops])
@@ -658,7 +666,6 @@
   AM_CONDITIONAL([gl_GNULIB_ENABLED_locale], [$gl_gnulib_enabled_locale])
   AM_CONDITIONAL([gl_GNULIB_ENABLED_localeconv], 
[$gl_gnulib_enabled_localeconv])
   AM_CONDITIONAL([gl_GNULIB_ENABLED_lock], [$gl_gnulib_enabled_lock])
-  AM_CONDITIONAL([gl_GNULIB_ENABLED_ef455225c00f5049c808c2eda3e76866], 
[$gl_gnulib_enabled_ef455225c00f5049c808c2eda3e76866])
   AM_CONDITIONAL([gl_GNULIB_ENABLED_mbtowc], [$gl_gnulib_enabled_mbtowc])
   AM_CONDITIONAL([gl_GNULIB_ENABLED_mempcpy], [$gl_gnulib_enabled_mempcpy])
   AM_CONDITIONAL([gl_GNULIB_ENABLED_f691f076f650964c9f5598c3ee487616], 
[$gl_gnulib_enabled_f691f076f650964c9f5598c3ee487616])
@@ -816,17 +823,20 @@
 # gnulib-tool and may be removed by future gnulib-tool invocations.
 AC_DEFUN([gl_FILE_LIST], [
   build-aux/config.rpath
-  build-aux/snippet/_Noreturn.h
-  build-aux/snippet/arg-nonnull.h
-  build-aux/snippet/c++defs.h
-  build-aux/snippet/warn-on-use.h
+  lib/_Noreturn.h
   lib/alloca.in.h
+  lib/arg-nonnull.h
   lib/argz.c
   lib/argz.in.h
   lib/asnprintf.c
   lib/asprintf.c
+  lib/basename-lgpl.c
   lib/btowc.c
+  lib/c++defs.h
   lib/config.charset
+  lib/dirname-lgpl.c
+  lib/dirname.h
+  lib/dosname.h
   lib/errno.in.h
   lib/error.c
   lib/error.h
@@ -835,10 +845,17 @@
   lib/float+.h
   lib/float.c
   lib/float.in.h
+  lib/getopt-cdefs.in.h
+  lib/getopt-core.h
+  lib/getopt-ext.h
+  lib/getopt-pfx-core.h
+  lib/getopt-pfx-ext.h
   lib/getopt.c
   lib/getopt.in.h
   lib/getopt1.c
   lib/getopt_int.h
+  lib/getprogname.c
+  lib/getprogname.h
   lib/gettext.h
   lib/glthread/lock.c
   lib/glthread/lock.h
@@ -849,6 +866,7 @@
   lib/iswblank.c
   lib/itold.c
   lib/langinfo.in.h
+  lib/limits.in.h
   lib/localcharset.c
   lib/localcharset.h
   lib/locale.in.h
@@ -914,6 +932,7 @@
   lib/strerror.c
   lib/string.in.h
   lib/strings.in.h
+  lib/stripslash.c
   lib/strncasecmp.c
   lib/strndup.c
   lib/strnlen.c
@@ -931,6 +950,7 @@
   lib/vasnprintf.h
   lib/vasprintf.c
   lib/verify.h
+  lib/warn-on-use.h
   lib/wchar.in.h
   lib/wcrtomb.c
   lib/wctype-h.c
@@ -947,8 +967,11 @@
   m4/alloca.m4
   m4/argz.m4
   m4/btowc.m4
+  m4/builtin-expect.m4
   m4/codeset.m4
   m4/configmake.m4
+  m4/dirname.m4
+  m4/double-slash-root.m4
   m4/eealloc.m4
   m4/errno_h.m4
   m4/error.m4
@@ -958,6 +981,7 @@
   m4/fcntl-o.m4
   m4/float_h.m4
   m4/getopt.m4
+  m4/getprogname.m4
   m4/gettext.m4
   m4/glibc2.m4
   m4/glibc21.m4
@@ -980,6 +1004,7 @@
   m4/lib-link.m4
   m4/lib-prefix.m4
   m4/libunistring-base.m4
+  m4/limits-h.m4
   m4/localcharset.m4
   m4/locale-fr.m4
   m4/locale-ja.m4
@@ -1015,6 +1040,7 @@
   m4/printf-posix.m4
   m4/printf.m4
   m4/progtest.m4
+  m4/pthread_rwlock_rdlock.m4
   m4/regex.m4
   m4/size_max.m4
   m4/ssize_t.m4

Modified: trunk/gnulib/m4/gnulib-tool.m4
===================================================================
--- trunk/gnulib/m4/gnulib-tool.m4      2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/gnulib-tool.m4      2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 # gnulib-tool.m4 serial 2
-dnl Copyright (C) 2004-2005, 2009-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2004-2005, 2009-2017 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.

Modified: trunk/gnulib/m4/hard-locale.m4
===================================================================
--- trunk/gnulib/m4/hard-locale.m4      2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/hard-locale.m4      2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 # hard-locale.m4 serial 8
-dnl Copyright (C) 2002-2006, 2009-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2006, 2009-2017 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.

Modified: trunk/gnulib/m4/iconv.m4
===================================================================
--- trunk/gnulib/m4/iconv.m4    2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/iconv.m4    2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,4 +1,4 @@
-# iconv.m4 serial 19 (gettext-0.18.2)
+# iconv.m4 serial 20
 dnl Copyright (C) 2000-2002, 2007-2014, 2016 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -258,14 +258,18 @@
     am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( 
/(/'`
     AC_MSG_RESULT([
          $am_cv_proto_iconv])
-    AC_DEFINE_UNQUOTED([ICONV_CONST], [$am_cv_proto_iconv_arg1],
-      [Define as const if the declaration of iconv() needs const.])
-    dnl Also substitute ICONV_CONST in the gnulib generated <iconv.h>.
-    m4_ifdef([gl_ICONV_H_DEFAULTS],
-      [AC_REQUIRE([gl_ICONV_H_DEFAULTS])
-       if test -n "$am_cv_proto_iconv_arg1"; then
-         ICONV_CONST="const"
-       fi
-      ])
+  else
+    dnl When compiling GNU libiconv on a system that does not have iconv yet,
+    dnl pick the POSIX compliant declaration without 'const'.
+    am_cv_proto_iconv_arg1=""
   fi
+  AC_DEFINE_UNQUOTED([ICONV_CONST], [$am_cv_proto_iconv_arg1],
+    [Define as const if the declaration of iconv() needs const.])
+  dnl Also substitute ICONV_CONST in the gnulib generated <iconv.h>.
+  m4_ifdef([gl_ICONV_H_DEFAULTS],
+    [AC_REQUIRE([gl_ICONV_H_DEFAULTS])
+     if test -n "$am_cv_proto_iconv_arg1"; then
+       ICONV_CONST="const"
+     fi
+    ])
 ])

Modified: trunk/gnulib/m4/include_next.m4
===================================================================
--- trunk/gnulib/m4/include_next.m4     2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/include_next.m4     2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 # include_next.m4 serial 23
-dnl Copyright (C) 2006-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2006-2017 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.

Modified: trunk/gnulib/m4/intdiv0.m4
===================================================================
--- trunk/gnulib/m4/intdiv0.m4  2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/intdiv0.m4  2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 # intdiv0.m4 serial 6 (gettext-0.18.2)
-dnl Copyright (C) 2002, 2007-2008, 2010-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2002, 2007-2008, 2010-2017 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.

Modified: trunk/gnulib/m4/intmax.m4
===================================================================
--- trunk/gnulib/m4/intmax.m4   2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/intmax.m4   2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 # intmax.m4 serial 6 (gettext-0.18.2)
-dnl Copyright (C) 2002-2005, 2008-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2005, 2008-2017 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.

Modified: trunk/gnulib/m4/intmax_t.m4
===================================================================
--- trunk/gnulib/m4/intmax_t.m4 2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/intmax_t.m4 2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 # intmax_t.m4 serial 8
-dnl Copyright (C) 1997-2004, 2006-2007, 2009-2016 Free Software Foundation,
+dnl Copyright (C) 1997-2004, 2006-2007, 2009-2017 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,

Modified: trunk/gnulib/m4/inttypes-pri.m4
===================================================================
--- trunk/gnulib/m4/inttypes-pri.m4     2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/inttypes-pri.m4     2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 # inttypes-pri.m4 serial 7 (gettext-0.18.2)
-dnl Copyright (C) 1997-2002, 2006, 2008-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 1997-2002, 2006, 2008-2017 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.

Modified: trunk/gnulib/m4/inttypes_h.m4
===================================================================
--- trunk/gnulib/m4/inttypes_h.m4       2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/inttypes_h.m4       2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 # inttypes_h.m4 serial 10
-dnl Copyright (C) 1997-2004, 2006, 2008-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 1997-2004, 2006, 2008-2017 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.

Modified: trunk/gnulib/m4/iswblank.m4
===================================================================
--- trunk/gnulib/m4/iswblank.m4 2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/iswblank.m4 2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 # iswblank.m4 serial 4
-dnl Copyright (C) 2011-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2011-2017 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.

Modified: trunk/gnulib/m4/langinfo_h.m4
===================================================================
--- trunk/gnulib/m4/langinfo_h.m4       2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/langinfo_h.m4       2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 # langinfo_h.m4 serial 7
-dnl Copyright (C) 2009-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2009-2017 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.

Modified: trunk/gnulib/m4/lib-ld.m4
===================================================================
--- trunk/gnulib/m4/lib-ld.m4   2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/lib-ld.m4   2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
-# lib-ld.m4 serial 6
-dnl Copyright (C) 1996-2003, 2009-2016 Free Software Foundation, Inc.
+# lib-ld.m4 serial 7
+dnl Copyright (C) 1996-2003, 2009-2017 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.
@@ -47,73 +47,101 @@
        }
 fi
 
-ac_prog=ld
-if test "$GCC" = yes; then
-  # Check if gcc -print-prog-name=ld gives a path.
+if test -n "$LD"; then
+  AC_MSG_CHECKING([for ld])
+elif test "$GCC" = yes; then
   AC_MSG_CHECKING([for ld used by $CC])
-  case $host in
-  *-*-mingw*)
-    # gcc leaves a trailing carriage return which upsets mingw
-    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
-  *)
-    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
-  esac
-  case $ac_prog in
-    # Accept absolute paths.
-    [[\\/]]* | ?:[[\\/]]*)
-      re_direlt='/[[^/]][[^/]]*/\.\./'
-      # Canonicalize the pathname of ld
-      ac_prog=`echo "$ac_prog"| sed 's%\\\\%/%g'`
-      while echo "$ac_prog" | grep "$re_direlt" > /dev/null 2>&1; do
-        ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
-      done
-      test -z "$LD" && LD="$ac_prog"
-      ;;
-  "")
-    # If it fails, then pretend we aren't using GCC.
-    ac_prog=ld
-    ;;
-  *)
-    # If it is relative, then search for the first ld in PATH.
-    with_gnu_ld=unknown
-    ;;
-  esac
 elif test "$with_gnu_ld" = yes; then
   AC_MSG_CHECKING([for GNU ld])
 else
   AC_MSG_CHECKING([for non-GNU ld])
 fi
-AC_CACHE_VAL([acl_cv_path_LD],
-[if test -z "$LD"; then
-  acl_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-  for ac_dir in $PATH; do
-    IFS="$acl_save_ifs"
-    test -z "$ac_dir" && ac_dir=.
-    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
-      acl_cv_path_LD="$ac_dir/$ac_prog"
-      # Check to see if the program is GNU ld.  I'd rather use --version,
-      # but apparently some variants of GNU ld only accept -v.
-      # Break only if it was the GNU/non-GNU ld that we prefer.
-      case `"$acl_cv_path_LD" -v 2>&1 </dev/null` in
-      *GNU* | *'with BFD'*)
-        test "$with_gnu_ld" != no && break
-        ;;
-      *)
-        test "$with_gnu_ld" != yes && break
-        ;;
+if test -n "$LD"; then
+  # Let the user override the test with a path.
+  :
+else
+  AC_CACHE_VAL([acl_cv_path_LD],
+  [
+    acl_cv_path_LD= # Final result of this test
+    ac_prog=ld # Program to search in $PATH
+    if test "$GCC" = yes; then
+      # Check if gcc -print-prog-name=ld gives a path.
+      case $host in
+        *-*-mingw*)
+          # gcc leaves a trailing carriage return which upsets mingw
+          acl_output=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+        *)
+          acl_output=`($CC -print-prog-name=ld) 2>&5` ;;
       esac
+      case $acl_output in
+        # Accept absolute paths.
+        [[\\/]]* | ?:[[\\/]]*)
+          re_direlt='/[[^/]][[^/]]*/\.\./'
+          # Canonicalize the pathname of ld
+          acl_output=`echo "$acl_output" | sed 's%\\\\%/%g'`
+          while echo "$acl_output" | grep "$re_direlt" > /dev/null 2>&1; do
+            acl_output=`echo $acl_output | sed "s%$re_direlt%/%"`
+          done
+          # Got the pathname. No search in PATH is needed.
+          acl_cv_path_LD="$acl_output"
+          ac_prog=
+          ;;
+        "")
+          # If it fails, then pretend we aren't using GCC.
+          ;;
+        *)
+          # If it is relative, then search for the first ld in PATH.
+          with_gnu_ld=unknown
+          ;;
+      esac
     fi
-  done
-  IFS="$acl_save_ifs"
-else
-  acl_cv_path_LD="$LD" # Let the user override the test with a path.
-fi])
-LD="$acl_cv_path_LD"
+    if test -n "$ac_prog"; then
+      # Search for $ac_prog in $PATH.
+      acl_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+      for ac_dir in $PATH; do
+        IFS="$acl_save_ifs"
+        test -z "$ac_dir" && ac_dir=.
+        if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; 
then
+          acl_cv_path_LD="$ac_dir/$ac_prog"
+          # Check to see if the program is GNU ld.  I'd rather use --version,
+          # but apparently some variants of GNU ld only accept -v.
+          # Break only if it was the GNU/non-GNU ld that we prefer.
+          case `"$acl_cv_path_LD" -v 2>&1 </dev/null` in
+            *GNU* | *'with BFD'*)
+              test "$with_gnu_ld" != no && break
+              ;;
+            *)
+              test "$with_gnu_ld" != yes && break
+              ;;
+          esac
+        fi
+      done
+      IFS="$acl_save_ifs"
+    fi
+    case $host in
+      *-*-aix*)
+        AC_EGREP_CPP([yes],
+          [#if defined __powerpc64__ || defined _ARCH_PPC64
+           yes
+           #endif
+          ],
+          [# The compiler produces 64-bit code. Add option '-b64' so that the
+           # linker groks 64-bit object files.
+           case "$acl_cv_path_LD " in
+             *" -b64 "*) ;;
+             *) acl_cv_path_LD="$acl_cv_path_LD -b64" ;;
+           esac
+          ], [])
+        ;;
+    esac
+  ])
+  LD="$acl_cv_path_LD"
+fi
 if test -n "$LD"; then
   AC_MSG_RESULT([$LD])
 else
   AC_MSG_RESULT([no])
+  AC_MSG_ERROR([no acceptable ld found in \$PATH])
 fi
-test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
 AC_LIB_PROG_LD_GNU
 ])

Modified: trunk/gnulib/m4/lib-link.m4
===================================================================
--- trunk/gnulib/m4/lib-link.m4 2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/lib-link.m4 2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 # lib-link.m4 serial 26 (gettext-0.18.2)
-dnl Copyright (C) 2001-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2001-2017 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.

Modified: trunk/gnulib/m4/lib-prefix.m4
===================================================================
--- trunk/gnulib/m4/lib-prefix.m4       2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/lib-prefix.m4       2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
-# lib-prefix.m4 serial 7 (gettext-0.18)
-dnl Copyright (C) 2001-2005, 2008-2016 Free Software Foundation, Inc.
+# lib-prefix.m4 serial 8
+dnl Copyright (C) 2001-2005, 2008-2017 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.
@@ -174,51 +174,68 @@
   dnl $prefix/lib/64 (which is a symlink to either $prefix/lib/sparcv9 or
   dnl $prefix/lib/amd64) and 32-bit libraries go under $prefix/lib.
   AC_REQUIRE([AC_CANONICAL_HOST])
-  acl_libdirstem=lib
-  acl_libdirstem2=
-  case "$host_os" in
-    solaris*)
-      dnl See Solaris 10 Software Developer Collection > Solaris 64-bit 
Developer's Guide > The Development Environment
-      dnl <http://docs.sun.com/app/docs/doc/816-5138/dev-env?l=en&a=view>.
-      dnl "Portable Makefiles should refer to any library directories using 
the 64 symbolic link."
-      dnl But we want to recognize the sparcv9 or amd64 subdirectory also if 
the
-      dnl symlink is missing, so we set acl_libdirstem2 too.
-      AC_CACHE_CHECK([for 64-bit host], [gl_cv_solaris_64bit],
-        [AC_EGREP_CPP([sixtyfour bits], [
+  dnl Allow the user to override the result by setting acl_cv_libdirstems.
+  AC_CACHE_CHECK([for the common suffixes of directories in the library search 
path],
+    [acl_cv_libdirstems],
+    [acl_libdirstem=lib
+     acl_libdirstem2=
+     case "$host_os" in
+       solaris*)
+         dnl See Solaris 10 Software Developer Collection > Solaris 64-bit 
Developer's Guide > The Development Environment
+         dnl <http://docs.sun.com/app/docs/doc/816-5138/dev-env?l=en&a=view>.
+         dnl "Portable Makefiles should refer to any library directories using 
the 64 symbolic link."
+         dnl But we want to recognize the sparcv9 or amd64 subdirectory also 
if the
+         dnl symlink is missing, so we set acl_libdirstem2 too.
+         AC_CACHE_CHECK([for 64-bit host], [gl_cv_solaris_64bit],
+           [AC_EGREP_CPP([sixtyfour bits], [
 #ifdef _LP64
 sixtyfour bits
 #endif
-           ], [gl_cv_solaris_64bit=yes], [gl_cv_solaris_64bit=no])
-        ])
-      if test $gl_cv_solaris_64bit = yes; then
-        acl_libdirstem=lib/64
-        case "$host_cpu" in
-          sparc*)        acl_libdirstem2=lib/sparcv9 ;;
-          i*86 | x86_64) acl_libdirstem2=lib/amd64 ;;
-        esac
-      fi
-      ;;
-    *)
-      searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 
's,^libraries: ,,p' | sed -e 's,^=,,'`
-      if test -n "$searchpath"; then
-        acl_save_IFS="${IFS=   }"; IFS=":"
-        for searchdir in $searchpath; do
-          if test -d "$searchdir"; then
-            case "$searchdir" in
-              */lib64/ | */lib64 ) acl_libdirstem=lib64 ;;
-              */../ | */.. )
-                # Better ignore directories of this form. They are misleading.
-                ;;
-              *) searchdir=`cd "$searchdir" && pwd`
-                 case "$searchdir" in
-                   */lib64 ) acl_libdirstem=lib64 ;;
-                 esac ;;
-            esac
-          fi
-        done
-        IFS="$acl_save_IFS"
-      fi
-      ;;
-  esac
-  test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem"
+              ], [gl_cv_solaris_64bit=yes], [gl_cv_solaris_64bit=no])
+           ])
+         if test $gl_cv_solaris_64bit = yes; then
+           acl_libdirstem=lib/64
+           case "$host_cpu" in
+             sparc*)        acl_libdirstem2=lib/sparcv9 ;;
+             i*86 | x86_64) acl_libdirstem2=lib/amd64 ;;
+           esac
+         fi
+         ;;
+       *)
+         dnl The result is a property of the system. However, non-system
+         dnl compilers sometimes have odd library search paths. Therefore
+         dnl prefer asking /usr/bin/gcc, if available, rather than $CC.
+         searchpath=`(if test -f /usr/bin/gcc \
+                         && LC_ALL=C /usr/bin/gcc -print-search-dirs 
>/dev/null 2>/dev/null; then \
+                        LC_ALL=C /usr/bin/gcc -print-search-dirs; \
+                      else \
+                        LC_ALL=C $CC -print-search-dirs; \
+                      fi) 2>/dev/null \
+                     | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
+         if test -n "$searchpath"; then
+           acl_save_IFS="${IFS=        }"; IFS=":"
+           for searchdir in $searchpath; do
+             if test -d "$searchdir"; then
+               case "$searchdir" in
+                 */lib64/ | */lib64 ) acl_libdirstem=lib64 ;;
+                 */../ | */.. )
+                   # Better ignore directories of this form. They are 
misleading.
+                   ;;
+                 *) searchdir=`cd "$searchdir" && pwd`
+                    case "$searchdir" in
+                      */lib64 ) acl_libdirstem=lib64 ;;
+                    esac ;;
+               esac
+             fi
+           done
+           IFS="$acl_save_IFS"
+         fi
+         ;;
+     esac
+     test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem"
+     acl_cv_libdirstems="$acl_libdirstem,$acl_libdirstem2"
+    ])
+  # Decompose acl_cv_libdirstems into acl_libdirstem and acl_libdirstem2.
+  acl_libdirstem=`echo "$acl_cv_libdirstems" | sed -e 's/,.*//'`
+  acl_libdirstem2=`echo "$acl_cv_libdirstems" | sed -e '/,/s/.*,//'`
 ])

Modified: trunk/gnulib/m4/libunistring-base.m4
===================================================================
--- trunk/gnulib/m4/libunistring-base.m4        2017-04-14 16:36:56 UTC (rev 
7725)
+++ trunk/gnulib/m4/libunistring-base.m4        2017-04-14 17:20:48 UTC (rev 
7726)
@@ -1,5 +1,5 @@
 # libunistring-base.m4 serial 5
-dnl Copyright (C) 2010-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2010-2017 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.

Added: trunk/gnulib/m4/limits-h.m4
===================================================================
--- trunk/gnulib/m4/limits-h.m4                         (rev 0)
+++ trunk/gnulib/m4/limits-h.m4 2017-04-14 17:20:48 UTC (rev 7726)
@@ -0,0 +1,31 @@
+dnl Check whether limits.h has needed features.
+
+dnl Copyright 2016-2017 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Paul Eggert.
+
+AC_DEFUN_ONCE([gl_LIMITS_H],
+[
+  gl_CHECK_NEXT_HEADERS([limits.h])
+
+  AC_CACHE_CHECK([whether limits.h has ULLONG_WIDTH etc.],
+    [gl_cv_header_limits_width],
+    [AC_COMPILE_IFELSE(
+       [AC_LANG_PROGRAM([[#ifndef __STDC_WANT_IEC_60559_BFP_EXT__
+                           #define __STDC_WANT_IEC_60559_BFP_EXT__ 1
+                          #endif
+                          #include <limits.h>
+                          int ullw = ULLONG_WIDTH;]])],
+       [gl_cv_header_limits_width=yes],
+       [gl_cv_header_limits_width=no])])
+  if test "$gl_cv_header_limits_width" = yes; then
+    LIMITS_H=
+  else
+    LIMITS_H=limits.h
+  fi
+  AC_SUBST([LIMITS_H])
+  AM_CONDITIONAL([GL_GENERATE_LIMITS_H], [test -n "$LIMITS_H"])
+])

Modified: trunk/gnulib/m4/localcharset.m4
===================================================================
--- trunk/gnulib/m4/localcharset.m4     2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/localcharset.m4     2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 # localcharset.m4 serial 7
-dnl Copyright (C) 2002, 2004, 2006, 2009-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2002, 2004, 2006, 2009-2017 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.

Modified: trunk/gnulib/m4/locale-fr.m4
===================================================================
--- trunk/gnulib/m4/locale-fr.m4        2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/locale-fr.m4        2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 # locale-fr.m4 serial 17
-dnl Copyright (C) 2003, 2005-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2003, 2005-2017 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.

Modified: trunk/gnulib/m4/locale-ja.m4
===================================================================
--- trunk/gnulib/m4/locale-ja.m4        2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/locale-ja.m4        2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 # locale-ja.m4 serial 12
-dnl Copyright (C) 2003, 2005-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2003, 2005-2017 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.

Modified: trunk/gnulib/m4/locale-zh.m4
===================================================================
--- trunk/gnulib/m4/locale-zh.m4        2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/locale-zh.m4        2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 # locale-zh.m4 serial 12
-dnl Copyright (C) 2003, 2005-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2003, 2005-2017 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.

Modified: trunk/gnulib/m4/locale_h.m4
===================================================================
--- trunk/gnulib/m4/locale_h.m4 2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/locale_h.m4 2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 # locale_h.m4 serial 19
-dnl Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2007, 2009-2017 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.

Modified: trunk/gnulib/m4/localeconv.m4
===================================================================
--- trunk/gnulib/m4/localeconv.m4       2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/localeconv.m4       2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 # localeconv.m4 serial 1
-dnl Copyright (C) 2012-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2012-2017 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.

Modified: trunk/gnulib/m4/lock.m4
===================================================================
--- trunk/gnulib/m4/lock.m4     2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/lock.m4     2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
-# lock.m4 serial 13 (gettext-0.18.2)
-dnl Copyright (C) 2005-2016 Free Software Foundation, Inc.
+# lock.m4 serial 14
+dnl Copyright (C) 2005-2017 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -12,11 +12,16 @@
   if test "$gl_threads_api" = posix; then
     # OSF/1 4.0 and Mac OS X 10.1 lack the pthread_rwlock_t type and the
     # pthread_rwlock_* functions.
+    has_rwlock=false
     AC_CHECK_TYPE([pthread_rwlock_t],
-      [AC_DEFINE([HAVE_PTHREAD_RWLOCK], [1],
+      [has_rwlock=true
+       AC_DEFINE([HAVE_PTHREAD_RWLOCK], [1],
          [Define if the POSIX multithreading library has read/write locks.])],
       [],
       [#include <pthread.h>])
+    if $has_rwlock; then
+      gl_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER
+    fi
     # glibc defines PTHREAD_MUTEX_RECURSIVE as enum, not as a macro.
     AC_COMPILE_IFELSE([
       AC_LANG_PROGRAM(

Modified: trunk/gnulib/m4/longlong.m4
===================================================================
--- trunk/gnulib/m4/longlong.m4 2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/longlong.m4 2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 # longlong.m4 serial 17
-dnl Copyright (C) 1999-2007, 2009-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 1999-2007, 2009-2017 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.

Modified: trunk/gnulib/m4/malloc.m4
===================================================================
--- trunk/gnulib/m4/malloc.m4   2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/malloc.m4   2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 # malloc.m4 serial 15
-dnl Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2007, 2009-2017 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.

Modified: trunk/gnulib/m4/malloca.m4
===================================================================
--- trunk/gnulib/m4/malloca.m4  2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/malloca.m4  2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 # malloca.m4 serial 1
-dnl Copyright (C) 2003-2004, 2006-2007, 2009-2016 Free Software Foundation,
+dnl Copyright (C) 2003-2004, 2006-2007, 2009-2017 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,

Modified: trunk/gnulib/m4/math_h.m4
===================================================================
--- trunk/gnulib/m4/math_h.m4   2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/math_h.m4   2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
-# math_h.m4 serial 114
-dnl Copyright (C) 2007-2016 Free Software Foundation, Inc.
+# math_h.m4 serial 115
+dnl Copyright (C) 2007-2017 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.
@@ -256,11 +256,18 @@
   HAVE_DECL_TRUNC=1;           AC_SUBST([HAVE_DECL_TRUNC])
   HAVE_DECL_TRUNCF=1;          AC_SUBST([HAVE_DECL_TRUNCF])
   HAVE_DECL_TRUNCL=1;          AC_SUBST([HAVE_DECL_TRUNCL])
+  REPLACE_ACOSF=0;             AC_SUBST([REPLACE_ACOSF])
+  REPLACE_ASINF=0;             AC_SUBST([REPLACE_ASINF])
+  REPLACE_ATANF=0;             AC_SUBST([REPLACE_ATANF])
+  REPLACE_ATAN2F=0;            AC_SUBST([REPLACE_ATAN2F])
   REPLACE_CBRTF=0;             AC_SUBST([REPLACE_CBRTF])
   REPLACE_CBRTL=0;             AC_SUBST([REPLACE_CBRTL])
   REPLACE_CEIL=0;              AC_SUBST([REPLACE_CEIL])
   REPLACE_CEILF=0;             AC_SUBST([REPLACE_CEILF])
   REPLACE_CEILL=0;             AC_SUBST([REPLACE_CEILL])
+  REPLACE_COSF=0;              AC_SUBST([REPLACE_COSF])
+  REPLACE_COSHF=0;             AC_SUBST([REPLACE_COSHF])
+  REPLACE_EXPF=0;              AC_SUBST([REPLACE_EXPF])
   REPLACE_EXPM1=0;             AC_SUBST([REPLACE_EXPM1])
   REPLACE_EXPM1F=0;            AC_SUBST([REPLACE_EXPM1F])
   REPLACE_EXP2=0;              AC_SUBST([REPLACE_EXP2])
@@ -315,7 +322,12 @@
   REPLACE_ROUNDL=0;            AC_SUBST([REPLACE_ROUNDL])
   REPLACE_SIGNBIT=0;           AC_SUBST([REPLACE_SIGNBIT])
   REPLACE_SIGNBIT_USING_GCC=0; AC_SUBST([REPLACE_SIGNBIT_USING_GCC])
+  REPLACE_SINF=0;              AC_SUBST([REPLACE_SINF])
+  REPLACE_SINHF=0;             AC_SUBST([REPLACE_SINHF])
+  REPLACE_SQRTF=0;             AC_SUBST([REPLACE_SQRTF])
   REPLACE_SQRTL=0;             AC_SUBST([REPLACE_SQRTL])
+  REPLACE_TANF=0;              AC_SUBST([REPLACE_TANF])
+  REPLACE_TANHF=0;             AC_SUBST([REPLACE_TANHF])
   REPLACE_TRUNC=0;             AC_SUBST([REPLACE_TRUNC])
   REPLACE_TRUNCF=0;            AC_SUBST([REPLACE_TRUNCF])
   REPLACE_TRUNCL=0;            AC_SUBST([REPLACE_TRUNCL])

Modified: trunk/gnulib/m4/mbchar.m4
===================================================================
--- trunk/gnulib/m4/mbchar.m4   2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/mbchar.m4   2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 # mbchar.m4 serial 9
-dnl Copyright (C) 2005-2007, 2009-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2005-2007, 2009-2017 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.

Modified: trunk/gnulib/m4/mbiter.m4
===================================================================
--- trunk/gnulib/m4/mbiter.m4   2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/mbiter.m4   2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 # mbiter.m4 serial 7
-dnl Copyright (C) 2005, 2008-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2005, 2008-2017 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.

Modified: trunk/gnulib/m4/mbrtowc.m4
===================================================================
--- trunk/gnulib/m4/mbrtowc.m4  2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/mbrtowc.m4  2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 # mbrtowc.m4 serial 27  -*- coding: utf-8 -*-
-dnl Copyright (C) 2001-2002, 2004-2005, 2008-2016 Free Software Foundation,
+dnl Copyright (C) 2001-2002, 2004-2005, 2008-2017 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,
@@ -164,7 +164,7 @@
       memset (&state, '\0', sizeof (mbstate_t));
       if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
         if (mbsinit (&state))
-          return 1;
+          return 2;
     }
   return 0;
 }]])],
@@ -224,7 +224,7 @@
       memset (&state, '\0', sizeof (mbstate_t));
       if (mbrtowc (&wc, input + 3, 6, &state) != 4
           && mbtowc (&wc, input + 3, 6) == 4)
-        return 1;
+        return 2;
     }
   return 0;
 }]])],
@@ -352,7 +352,7 @@
       mbrtowc (&wc, NULL, 5, &state);
       /* Check that wc was not modified.  */
       if (wc != (wchar_t) 0xBADFACE)
-        return 1;
+        return 2;
     }
   return 0;
 }]])],
@@ -539,7 +539,7 @@
 
       memset (&state, '\0', sizeof (mbstate_t));
       if (mbrtowc (&wc, "", 1, &state) != 0)
-        return 1;
+        return 2;
     }
   return 0;
 }]])],
@@ -608,7 +608,7 @@
             int i;
             char *locale = setlocale (LC_ALL, "C");
             if (! locale)
-              return 1;
+              return 2;
             for (i = CHAR_MIN; i <= CHAR_MAX; i++)
               {
                 char c = i;
@@ -616,7 +616,7 @@
                 mbstate_t mbs = { 0, };
                 size_t ss = mbrtowc (&wc, &c, 1, &mbs);
                 if (1 < ss)
-                  return 1;
+                  return 3;
               }
             return 0;
           ]])],

Modified: trunk/gnulib/m4/mbsinit.m4
===================================================================
--- trunk/gnulib/m4/mbsinit.m4  2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/mbsinit.m4  2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 # mbsinit.m4 serial 8
-dnl Copyright (C) 2008, 2010-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2008, 2010-2017 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.

Modified: trunk/gnulib/m4/mbslen.m4
===================================================================
--- trunk/gnulib/m4/mbslen.m4   2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/mbslen.m4   2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 # mbslen.m4 serial 2
-dnl Copyright (C) 2010-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2010-2017 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.

Modified: trunk/gnulib/m4/mbstate_t.m4
===================================================================
--- trunk/gnulib/m4/mbstate_t.m4        2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/mbstate_t.m4        2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 # mbstate_t.m4 serial 13
-dnl Copyright (C) 2000-2002, 2008-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2000-2002, 2008-2017 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.

Modified: trunk/gnulib/m4/mbswidth.m4
===================================================================
--- trunk/gnulib/m4/mbswidth.m4 2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/mbswidth.m4 2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 # mbswidth.m4 serial 18
-dnl Copyright (C) 2000-2002, 2004, 2006-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2000-2002, 2004, 2006-2017 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.

Modified: trunk/gnulib/m4/mbtowc.m4
===================================================================
--- trunk/gnulib/m4/mbtowc.m4   2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/mbtowc.m4   2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 # mbtowc.m4 serial 2
-dnl Copyright (C) 2011-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2011-2017 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.

Modified: trunk/gnulib/m4/memchr.m4
===================================================================
--- trunk/gnulib/m4/memchr.m4   2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/memchr.m4   2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 # memchr.m4 serial 12
-dnl Copyright (C) 2002-2004, 2009-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2004, 2009-2017 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.

Modified: trunk/gnulib/m4/mempcpy.m4
===================================================================
--- trunk/gnulib/m4/mempcpy.m4  2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/mempcpy.m4  2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 # mempcpy.m4 serial 11
-dnl Copyright (C) 2003-2004, 2006-2007, 2009-2016 Free Software Foundation,
+dnl Copyright (C) 2003-2004, 2006-2007, 2009-2017 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,

Modified: trunk/gnulib/m4/memrchr.m4
===================================================================
--- trunk/gnulib/m4/memrchr.m4  2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/memrchr.m4  2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 # memrchr.m4 serial 10
-dnl Copyright (C) 2002-2003, 2005-2007, 2009-2016 Free Software Foundation,
+dnl Copyright (C) 2002-2003, 2005-2007, 2009-2017 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,

Modified: trunk/gnulib/m4/mmap-anon.m4
===================================================================
--- trunk/gnulib/m4/mmap-anon.m4        2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/mmap-anon.m4        2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 # mmap-anon.m4 serial 10
-dnl Copyright (C) 2005, 2007, 2009-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2005, 2007, 2009-2017 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.

Modified: trunk/gnulib/m4/msvc-inval.m4
===================================================================
--- trunk/gnulib/m4/msvc-inval.m4       2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/msvc-inval.m4       2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 # msvc-inval.m4 serial 1
-dnl Copyright (C) 2011-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2011-2017 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.

Modified: trunk/gnulib/m4/msvc-nothrow.m4
===================================================================
--- trunk/gnulib/m4/msvc-nothrow.m4     2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/msvc-nothrow.m4     2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 # msvc-nothrow.m4 serial 1
-dnl Copyright (C) 2011-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2011-2017 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.

Modified: trunk/gnulib/m4/multiarch.m4
===================================================================
--- trunk/gnulib/m4/multiarch.m4        2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/multiarch.m4        2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 # multiarch.m4 serial 7
-dnl Copyright (C) 2008-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2008-2017 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.

Modified: trunk/gnulib/m4/nl_langinfo.m4
===================================================================
--- trunk/gnulib/m4/nl_langinfo.m4      2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/nl_langinfo.m4      2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 # nl_langinfo.m4 serial 5
-dnl Copyright (C) 2009-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2009-2017 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.

Modified: trunk/gnulib/m4/nocrash.m4
===================================================================
--- trunk/gnulib/m4/nocrash.m4  2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/nocrash.m4  2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 # nocrash.m4 serial 4
-dnl Copyright (C) 2005, 2009-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2005, 2009-2017 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.

Modified: trunk/gnulib/m4/off_t.m4
===================================================================
--- trunk/gnulib/m4/off_t.m4    2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/off_t.m4    2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 # off_t.m4 serial 1
-dnl Copyright (C) 2012-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2012-2017 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.

Modified: trunk/gnulib/m4/onceonly.m4
===================================================================
--- trunk/gnulib/m4/onceonly.m4 2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/onceonly.m4 2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 # onceonly.m4 serial 9
-dnl Copyright (C) 2002-2003, 2005-2006, 2008-2016 Free Software Foundation,
+dnl Copyright (C) 2002-2003, 2005-2006, 2008-2017 Free Software Foundation,
 dnl Inc.
 dnl
 dnl This file is free software; you can redistribute it and/or modify

Modified: trunk/gnulib/m4/printf-posix.m4
===================================================================
--- trunk/gnulib/m4/printf-posix.m4     2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/printf-posix.m4     2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 # printf-posix.m4 serial 6 (gettext-0.18.2)
-dnl Copyright (C) 2003, 2007, 2009-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2003, 2007, 2009-2017 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.

Modified: trunk/gnulib/m4/printf.m4
===================================================================
--- trunk/gnulib/m4/printf.m4   2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/printf.m4   2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 # printf.m4 serial 52
-dnl Copyright (C) 2003, 2007-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2003, 2007-2017 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.
@@ -38,6 +38,8 @@
   if (sprintf (buf, "%ju %d", (uintmax_t) 12345671, 33, 44, 55) < 0
       || strcmp (buf, "12345671 33") != 0)
     result |= 1;
+#else
+  result |= 1;
 #endif
   buf[0] = '\0';
   if (sprintf (buf, "%zu %d", (size_t) 12345672, 33, 44, 55) < 0

Modified: trunk/gnulib/m4/progtest.m4
===================================================================
--- trunk/gnulib/m4/progtest.m4 2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/progtest.m4 2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,16 +1,16 @@
 # progtest.m4 serial 7 (gettext-0.18.2)
-dnl Copyright (C) 1996-2003, 2005, 2008-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 1996-2003, 2005, 2008-2017 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
-dnl This file can be used in projects which are not available under
+dnl This file can can be used in projects which are not available under
 dnl the GNU General Public License or the GNU Library General Public
 dnl License but which still want to provide support for the GNU gettext
 dnl functionality.
 dnl Please note that the actual code of the GNU gettext library is covered
 dnl by the GNU Library General Public License, and the rest of the GNU
-dnl gettext package is covered by the GNU General Public License.
+dnl gettext package package is covered by the GNU General Public License.
 dnl They are *not* in the public domain.
 
 dnl Authors:

Added: trunk/gnulib/m4/pthread_rwlock_rdlock.m4
===================================================================
--- trunk/gnulib/m4/pthread_rwlock_rdlock.m4                            (rev 0)
+++ trunk/gnulib/m4/pthread_rwlock_rdlock.m4    2017-04-14 17:20:48 UTC (rev 
7726)
@@ -0,0 +1,163 @@
+# pthread_rwlock_rdlock.m4 serial 1
+dnl Copyright (C) 2017 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible.
+dnl Inspired by
+dnl 
https://github.com/linux-test-project/ltp/blob/master/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_rdlock/2-2.c
+dnl by Intel Corporation.
+
+dnl Test whether in a situation where
+dnl   - an rwlock is taken by a reader and has a writer waiting,
+dnl   - an additional reader requests the lock,
+dnl   - the waiting writer and the requesting reader threads have the same
+dnl     priority,
+dnl the requesting reader thread gets blocked, so that at some point the
+dnl waiting writer can acquire the lock.
+dnl Without such a guarantee, when there a N readers and each of the readers
+dnl spends more than 1/Nth of the time with the lock held, there is a high
+dnl probability that the waiting writer will not get the lock in a given finite
+dnl time, a phenomenon called "writer starvation".
+dnl Without such a guarantee, applications have a hard time avoiding writer
+dnl starvation.
+dnl
+dnl POSIX:2008 makes this requirement only for implementations that support TPS
+dnl (Thread Priority Scheduling) and only for the scheduling policies 
SCHED_FIFO
+dnl and SCHED_RR, see
+dnl 
http://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_rwlock_rdlock.html
+dnl but test verifies the guarantee regardless of TPS and regardless of
+dnl scheduling policy.
+AC_DEFUN([gl_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER],
+[
+  AC_REQUIRE([gl_THREADLIB_EARLY])
+  AC_CACHE_CHECK([whether pthread_rwlock_rdlock prefers a writer to a reader],
+    [gl_cv_pthread_rwlock_rdlock_prefer_writer],
+    [save_LIBS="$LIBS"
+     LIBS="$LIBS $LIBMULTITHREAD"
+     AC_RUN_IFELSE(
+       [AC_LANG_SOURCE([[
+#include <errno.h>
+#include <pthread.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+#define SUCCEED() exit (0)
+#define FAILURE() exit (1)
+#define UNEXPECTED(n) (exit (10 + (n)))
+
+/* The main thread creates the waiting writer and the requesting reader threads
+   in the default way; this guarantees that they have the same priority.
+   We can reuse the main thread as first reader thread.  */
+
+static pthread_rwlock_t lock;
+static pthread_t reader1;
+static pthread_t writer;
+static pthread_t reader2;
+static pthread_t timer;
+/* Used to pass control from writer to reader2 and from reader2 to timer,
+   as in a relay race.
+   Passing control from one running thread to another running thread
+   is most likely faster than to create the second thread.  */
+static pthread_mutex_t baton;
+
+static void *
+timer_func (void *ignored)
+{
+  /* Step 13 (can be before or after step 12):
+     The timer thread takes the baton, then waits a moment to make sure
+     it can tell whether the second reader thread is blocked at step 12.  */
+  if (pthread_mutex_lock (&baton))
+    UNEXPECTED (13);
+  usleep (100000);
+  /* By the time we get here, it's clear that the second reader thread is
+     blocked at step 12.  This is the desired behaviour.  */
+  SUCCEED ();
+}
+
+static void *
+reader2_func (void *ignored)
+{
+  int err;
+
+  /* Step 8 (can be before or after step 7):
+     The second reader thread takes the baton, then waits a moment to make sure
+     the writer thread has reached step 7.  */
+  if (pthread_mutex_lock (&baton))
+    UNEXPECTED (8);
+  usleep (100000);
+  /* Step 9: The second reader thread requests the lock.  */
+  err = pthread_rwlock_tryrdlock (&lock);
+  if (err == 0)
+    FAILURE ();
+  else if (err != EBUSY)
+    UNEXPECTED (9);
+  /* Step 10: Launch a timer, to test whether the next call blocks.  */
+  if (pthread_create (&timer, NULL, timer_func, NULL))
+    UNEXPECTED (10);
+  /* Step 11: Release the baton.  */
+  if (pthread_mutex_unlock (&baton))
+    UNEXPECTED (11);
+  /* Step 12: The second reader thread requests the lock.  */
+  err = pthread_rwlock_rdlock (&lock);
+  if (err == 0)
+    FAILURE ();
+  else
+    UNEXPECTED (12);
+}
+
+static void *
+writer_func (void *ignored)
+{
+  /* Step 4: Take the baton, so that the second reader thread does not go ahead
+     too early.  */
+  if (pthread_mutex_lock (&baton))
+    UNEXPECTED (4);
+  /* Step 5: Create the second reader thread.  */
+  if (pthread_create (&reader2, NULL, reader2_func, NULL))
+    UNEXPECTED (5);
+  /* Step 6: Release the baton.  */
+  if (pthread_mutex_unlock (&baton))
+    UNEXPECTED (6);
+  /* Step 7: The writer thread requests the lock.  */
+  if (pthread_rwlock_wrlock (&lock))
+    UNEXPECTED (7);
+  return NULL;
+}
+
+int
+main ()
+{
+  reader1 = pthread_self ();
+
+  /* Step 1: The main thread initializes the lock and the baton.  */
+  if (pthread_rwlock_init (&lock, NULL))
+    UNEXPECTED (1);
+  if (pthread_mutex_init (&baton, NULL))
+    UNEXPECTED (1);
+  /* Step 2: The main thread acquires the lock as a reader.  */
+  if (pthread_rwlock_rdlock (&lock))
+    UNEXPECTED (2);
+  /* Step 3: Create the writer thread.  */
+  if (pthread_create (&writer, NULL, writer_func, NULL))
+    UNEXPECTED (3);
+  /* Job done.  Go to sleep.  */
+  for (;;)
+    {
+      sleep (1);
+    }
+}
+]])],
+       [gl_cv_pthread_rwlock_rdlock_prefer_writer=yes],
+       [gl_cv_pthread_rwlock_rdlock_prefer_writer=no],
+       [gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing yes"])
+     LIBS="$save_LIBS"
+    ])
+  case "$gl_cv_pthread_rwlock_rdlock_prefer_writer" in
+    *yes)
+      AC_DEFINE([HAVE_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER], [1],
+        [Define if the 'pthread_rwlock_rdlock' function prefers a writer to a 
reader.])
+      ;;
+  esac
+])

Modified: trunk/gnulib/m4/regex.m4
===================================================================
--- trunk/gnulib/m4/regex.m4    2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/regex.m4    2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,6 +1,6 @@
 # serial 66
 
-# Copyright (C) 1996-2001, 2003-2016 Free Software Foundation, Inc.
+# Copyright (C) 1996-2001, 2003-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,

Modified: trunk/gnulib/m4/size_max.m4
===================================================================
--- trunk/gnulib/m4/size_max.m4 2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/size_max.m4 2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 # size_max.m4 serial 10
-dnl Copyright (C) 2003, 2005-2006, 2008-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2003, 2005-2006, 2008-2017 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.

Modified: trunk/gnulib/m4/ssize_t.m4
===================================================================
--- trunk/gnulib/m4/ssize_t.m4  2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/ssize_t.m4  2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 # ssize_t.m4 serial 5 (gettext-0.18.2)
-dnl Copyright (C) 2001-2003, 2006, 2010-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2001-2003, 2006, 2010-2017 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.

Modified: trunk/gnulib/m4/stdarg.m4
===================================================================
--- trunk/gnulib/m4/stdarg.m4   2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/stdarg.m4   2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 # stdarg.m4 serial 6
-dnl Copyright (C) 2006, 2008-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2006, 2008-2017 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.

Modified: trunk/gnulib/m4/stdbool.m4
===================================================================
--- trunk/gnulib/m4/stdbool.m4  2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/stdbool.m4  2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,6 +1,6 @@
 # Check for stdbool.h that conforms to C99.
 
-dnl Copyright (C) 2002-2006, 2009-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2006, 2009-2017 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.

Modified: trunk/gnulib/m4/stddef_h.m4
===================================================================
--- trunk/gnulib/m4/stddef_h.m4 2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/stddef_h.m4 2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,6 +1,6 @@
 dnl A placeholder for <stddef.h>, for platforms that have issues.
 # stddef_h.m4 serial 5
-dnl Copyright (C) 2009-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2009-2017 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.

Modified: trunk/gnulib/m4/stdint.m4
===================================================================
--- trunk/gnulib/m4/stdint.m4   2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/stdint.m4   2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
-# stdint.m4 serial 44
-dnl Copyright (C) 2001-2016 Free Software Foundation, Inc.
+# stdint.m4 serial 50
+dnl Copyright (C) 2001-2017 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -11,6 +11,9 @@
 [
   AC_PREREQ([2.59])dnl
 
+  AC_REQUIRE([gl_LIMITS_H])
+  AC_REQUIRE([gt_TYPE_WINT_T])
+
   dnl Check for long long int and unsigned long long int.
   AC_REQUIRE([AC_TYPE_LONG_LONG_INT])
   if test $ac_cv_type_long_long_int = yes; then
@@ -152,6 +155,15 @@
 intmax_t i = INTMAX_MAX;
 uintmax_t j = UINTMAX_MAX;
 
+/* Check that SIZE_MAX has the correct type, if possible.  */
+#if 201112 <= __STDC_VERSION__
+int k = _Generic (SIZE_MAX, size_t: 0);
+#elif (2 <= __GNUC__ || defined __IBM__TYPEOF__ \
+       || (0x5110 <= __SUNPRO_C && !__STDC__))
+extern size_t k;
+extern __typeof__ (SIZE_MAX) k;
+#endif
+
 #include <limits.h> /* for CHAR_BIT */
 #define TYPE_MINIMUM(t) \
   ((t) ((t) 0 < (t) -1 ? (t) 0 : ~ TYPE_MAXIMUM (t)))
@@ -282,7 +294,13 @@
          ])
       ])
   fi
+
+  HAVE_C99_STDINT_H=0
+  HAVE_SYS_BITYPES_H=0
+  HAVE_SYS_INTTYPES_H=0
+  STDINT_H=stdint.h
   if test "$gl_cv_header_working_stdint_h" = yes; then
+    HAVE_C99_STDINT_H=1
     dnl Now see whether the system <stdint.h> works without
     dnl __STDC_CONSTANT_MACROS/__STDC_LIMIT_MACROS defined.
     AC_CACHE_CHECK([whether stdint.h predates C++11],
@@ -289,7 +307,7 @@
       [gl_cv_header_stdint_predates_cxx11_h],
       [gl_cv_header_stdint_predates_cxx11_h=yes
        AC_COMPILE_IFELSE([
-        AC_LANG_PROGRAM([[
+         AC_LANG_PROGRAM([[
 #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */
 #include <stdint.h>
 ]
@@ -306,7 +324,24 @@
       AC_DEFINE([__STDC_LIMIT_MACROS], [1],
                 [Define to 1 if the system <stdint.h> predates C++11.])
     fi
-    STDINT_H=
+    AC_CACHE_CHECK([whether stdint.h has UINTMAX_WIDTH etc.],
+      [gl_cv_header_stdint_width],
+      [gl_cv_header_stdint_width=no
+       AC_COMPILE_IFELSE(
+         [AC_LANG_PROGRAM([[
+            /* Work if build is not clean.  */
+            #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1
+            #ifndef __STDC_WANT_IEC_60559_BFP_EXT__
+             #define __STDC_WANT_IEC_60559_BFP_EXT__ 1
+            #endif
+            #include <stdint.h>
+            ]gl_STDINT_INCLUDES[
+            int iw = UINTMAX_WIDTH;
+            ]])],
+         [gl_cv_header_stdint_width=yes])])
+    if test "$gl_cv_header_stdint_width" = yes; then
+      STDINT_H=
+    fi
   else
     dnl Check for <sys/inttypes.h>, and for
     dnl <sys/bitypes.h> (used in Linux libc4 >= 4.6.7 and libc5).
@@ -313,20 +348,20 @@
     AC_CHECK_HEADERS([sys/inttypes.h sys/bitypes.h])
     if test $ac_cv_header_sys_inttypes_h = yes; then
       HAVE_SYS_INTTYPES_H=1
-    else
-      HAVE_SYS_INTTYPES_H=0
     fi
-    AC_SUBST([HAVE_SYS_INTTYPES_H])
     if test $ac_cv_header_sys_bitypes_h = yes; then
       HAVE_SYS_BITYPES_H=1
-    else
-      HAVE_SYS_BITYPES_H=0
     fi
-    AC_SUBST([HAVE_SYS_BITYPES_H])
-
     gl_STDINT_TYPE_PROPERTIES
-    STDINT_H=stdint.h
   fi
+
+  dnl The substitute stdint.h needs the substitute limit.h's _GL_INTEGER_WIDTH.
+  LIMITS_H=limits.h
+  AM_CONDITIONAL([GL_GENERATE_LIMITS_H], [test -n "$LIMITS_H"])
+
+  AC_SUBST([HAVE_C99_STDINT_H])
+  AC_SUBST([HAVE_SYS_BITYPES_H])
+  AC_SUBST([HAVE_SYS_INTTYPES_H])
   AC_SUBST([STDINT_H])
   AM_CONDITIONAL([GL_GENERATE_STDINT_H], [test -n "$STDINT_H"])
 ])
@@ -494,7 +529,7 @@
   dnl requirement that wint_t is "unchanged by default argument promotions".
   dnl In this case gnulib's <wchar.h> and <wctype.h> override wint_t.
   dnl Set the variable BITSIZEOF_WINT_T accordingly.
-  if test $BITSIZEOF_WINT_T -lt 32; then
+  if test $GNULIB_OVERRIDES_WINT_T = 1; then
     BITSIZEOF_WINT_T=32
   fi
 ])
@@ -504,8 +539,3 @@
 m4_ifdef([AC_COMPUTE_INT], [], [
   AC_DEFUN([AC_COMPUTE_INT], [_AC_COMPUTE_INT([$2],[$1],[$3],[$4])])
 ])
-
-# Hey Emacs!
-# Local Variables:
-# indent-tabs-mode: nil
-# End:

Modified: trunk/gnulib/m4/stdint_h.m4
===================================================================
--- trunk/gnulib/m4/stdint_h.m4 2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/stdint_h.m4 2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 # stdint_h.m4 serial 9
-dnl Copyright (C) 1997-2004, 2006, 2008-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 1997-2004, 2006, 2008-2017 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.

Modified: trunk/gnulib/m4/stdio_h.m4
===================================================================
--- trunk/gnulib/m4/stdio_h.m4  2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/stdio_h.m4  2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
-# stdio_h.m4 serial 46
-dnl Copyright (C) 2007-2016 Free Software Foundation, Inc.
+# stdio_h.m4 serial 48
+dnl Copyright (C) 2007-2017 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.
@@ -6,9 +6,13 @@
 
 AC_DEFUN([gl_STDIO_H],
 [
-  dnl For __USE_MINGW_ANSI_STDIO
-  AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
-
+  AH_VERBATIM([MINGW_ANSI_STDIO],
+[/* Use GNU style printf and scanf.  */
+#ifndef __USE_MINGW_ANSI_STDIO
+# undef __USE_MINGW_ANSI_STDIO
+#endif
+])
+  AC_DEFINE([__USE_MINGW_ANSI_STDIO])
   AC_REQUIRE([gl_STDIO_H_DEFAULTS])
   gl_NEXT_HEADERS([stdio.h])
 

Modified: trunk/gnulib/m4/stdlib_h.m4
===================================================================
--- trunk/gnulib/m4/stdlib_h.m4 2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/stdlib_h.m4 2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
-# stdlib_h.m4 serial 42
-dnl Copyright (C) 2007-2016 Free Software Foundation, Inc.
+# stdlib_h.m4 serial 43
+dnl Copyright (C) 2007-2017 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.
@@ -21,7 +21,7 @@
 #endif
     ]], [_Exit atoll canonicalize_file_name getloadavg getsubopt grantpt
     initstate initstate_r mkdtemp mkostemp mkostemps mkstemp mkstemps
-    posix_openpt ptsname ptsname_r random random_r realpath rpmatch
+    posix_openpt ptsname ptsname_r qsort_r random random_r realpath rpmatch
     secure_getenv setenv setstate setstate_r srandom srandom_r
     strtod strtoll strtoull unlockpt unsetenv])
 ])
@@ -85,6 +85,7 @@
   HAVE_POSIX_OPENPT=1;       AC_SUBST([HAVE_POSIX_OPENPT])
   HAVE_PTSNAME=1;            AC_SUBST([HAVE_PTSNAME])
   HAVE_PTSNAME_R=1;          AC_SUBST([HAVE_PTSNAME_R])
+  HAVE_QSORT_R=1;            AC_SUBST([HAVE_QSORT_R])
   HAVE_RANDOM=1;             AC_SUBST([HAVE_RANDOM])
   HAVE_RANDOM_H=1;           AC_SUBST([HAVE_RANDOM_H])
   HAVE_RANDOM_R=1;           AC_SUBST([HAVE_RANDOM_R])

Modified: trunk/gnulib/m4/stpcpy.m4
===================================================================
--- trunk/gnulib/m4/stpcpy.m4   2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/stpcpy.m4   2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 # stpcpy.m4 serial 8
-dnl Copyright (C) 2002, 2007, 2009-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2002, 2007, 2009-2017 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.

Modified: trunk/gnulib/m4/strcase.m4
===================================================================
--- trunk/gnulib/m4/strcase.m4  2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/strcase.m4  2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 # strcase.m4 serial 11
-dnl Copyright (C) 2002, 2005-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2002, 2005-2017 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.

Modified: trunk/gnulib/m4/strcasestr.m4
===================================================================
--- trunk/gnulib/m4/strcasestr.m4       2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/strcasestr.m4       2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 # strcasestr.m4 serial 21
-dnl Copyright (C) 2005, 2007-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2005, 2007-2017 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.

Modified: trunk/gnulib/m4/strdup.m4
===================================================================
--- trunk/gnulib/m4/strdup.m4   2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/strdup.m4   2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,6 +1,6 @@
 # strdup.m4 serial 13
 
-dnl Copyright (C) 2002-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2017 Free Software Foundation, Inc.
 
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,

Modified: trunk/gnulib/m4/strerror.m4
===================================================================
--- trunk/gnulib/m4/strerror.m4 2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/strerror.m4 2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 # strerror.m4 serial 17
-dnl Copyright (C) 2002, 2007-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2002, 2007-2017 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.

Modified: trunk/gnulib/m4/string_h.m4
===================================================================
--- trunk/gnulib/m4/string_h.m4 2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/string_h.m4 2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,6 +1,6 @@
 # Configure a GNU-like replacement for <string.h>.
 
-# Copyright (C) 2007-2016 Free Software Foundation, Inc.
+# Copyright (C) 2007-2017 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.

Modified: trunk/gnulib/m4/strings_h.m4
===================================================================
--- trunk/gnulib/m4/strings_h.m4        2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/strings_h.m4        2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,7 +1,7 @@
 # Configure a replacement for <strings.h>.
 # serial 6
 
-# Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc.
+# Copyright (C) 2007, 2009-2017 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.

Modified: trunk/gnulib/m4/strndup.m4
===================================================================
--- trunk/gnulib/m4/strndup.m4  2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/strndup.m4  2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 # strndup.m4 serial 22
-dnl Copyright (C) 2002-2003, 2005-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2003, 2005-2017 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.

Modified: trunk/gnulib/m4/strnlen.m4
===================================================================
--- trunk/gnulib/m4/strnlen.m4  2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/strnlen.m4  2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 # strnlen.m4 serial 13
-dnl Copyright (C) 2002-2003, 2005-2007, 2009-2016 Free Software Foundation,
+dnl Copyright (C) 2002-2003, 2005-2007, 2009-2017 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,

Modified: trunk/gnulib/m4/strstr.m4
===================================================================
--- trunk/gnulib/m4/strstr.m4   2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/strstr.m4   2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 # strstr.m4 serial 17
-dnl Copyright (C) 2008-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2008-2017 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.

Modified: trunk/gnulib/m4/sys_socket_h.m4
===================================================================
--- trunk/gnulib/m4/sys_socket_h.m4     2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/sys_socket_h.m4     2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 # sys_socket_h.m4 serial 23
-dnl Copyright (C) 2005-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2005-2017 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.

Modified: trunk/gnulib/m4/sys_types_h.m4
===================================================================
--- trunk/gnulib/m4/sys_types_h.m4      2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/sys_types_h.m4      2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
-# sys_types_h.m4 serial 5
-dnl Copyright (C) 2011-2016 Free Software Foundation, Inc.
+# sys_types_h.m4 serial 6
+dnl Copyright (C) 2011-2017 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.
@@ -22,3 +22,28 @@
 AC_DEFUN([gl_SYS_TYPES_H_DEFAULTS],
 [
 ])
+
+# This works around a buggy version in autoconf <= 2.69.
+# See <https://lists.gnu.org/archive/html/autoconf/2016-08/msg00014.html>
+
+m4_version_prereq([2.70], [], [
+
+# This is taken from the following Autoconf patch:
+# http://git.sv.gnu.org/cgit/autoconf.git/commit/?id=e17a30e98
+
+m4_undefine([AC_HEADER_MAJOR])
+AC_DEFUN([AC_HEADER_MAJOR],
+[AC_CHECK_HEADERS_ONCE([sys/types.h])
+AC_CHECK_HEADER([sys/mkdev.h],
+  [AC_DEFINE([MAJOR_IN_MKDEV], [1],
+    [Define to 1 if `major', `minor', and `makedev' are declared in
+     <mkdev.h>.])])
+if test $ac_cv_header_sys_mkdev_h = no; then
+  AC_CHECK_HEADER([sys/sysmacros.h],
+    [AC_DEFINE([MAJOR_IN_SYSMACROS], [1],
+      [Define to 1 if `major', `minor', and `makedev' are declared in
+       <sysmacros.h>.])])
+fi
+])
+
+])

Modified: trunk/gnulib/m4/threadlib.m4
===================================================================
--- trunk/gnulib/m4/threadlib.m4        2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/threadlib.m4        2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
-# threadlib.m4 serial 11 (gettext-0.18.2)
-dnl Copyright (C) 2005-2016 Free Software Foundation, Inc.
+# threadlib.m4 serial 12
+dnl Copyright (C) 2005-2017 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.
@@ -195,8 +195,10 @@
              # Therefore pthread_in_use() needs to actually try to create a
              # thread: pthread_create from libc will fail, whereas
              # pthread_create will actually create a thread.
+             # On Solaris 10 or newer, this test is no longer needed, because
+             # libc contains the fully functional pthread functions.
              case "$host_os" in
-               solaris* | hpux*)
+               solaris | solaris2.[1-9] | solaris2.[1-9].* | hpux*)
                  AC_DEFINE([PTHREAD_IN_USE_DETECTION_HARD], [1],
                    [Define if the pthread_in_use() detection is hard.])
              esac

Modified: trunk/gnulib/m4/uintmax_t.m4
===================================================================
--- trunk/gnulib/m4/uintmax_t.m4        2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/uintmax_t.m4        2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 # uintmax_t.m4 serial 12
-dnl Copyright (C) 1997-2004, 2007-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 1997-2004, 2007-2017 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.

Modified: trunk/gnulib/m4/unistd_h.m4
===================================================================
--- trunk/gnulib/m4/unistd_h.m4 2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/unistd_h.m4 2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
-# unistd_h.m4 serial 68
-dnl Copyright (C) 2006-2016 Free Software Foundation, Inc.
+# unistd_h.m4 serial 69
+dnl Copyright (C) 2006-2017 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.
@@ -145,6 +145,7 @@
   HAVE_DECL_FCHDIR=1;     AC_SUBST([HAVE_DECL_FCHDIR])
   HAVE_DECL_FDATASYNC=1;  AC_SUBST([HAVE_DECL_FDATASYNC])
   HAVE_DECL_GETDOMAINNAME=1; AC_SUBST([HAVE_DECL_GETDOMAINNAME])
+  HAVE_DECL_GETLOGIN=1;   AC_SUBST([HAVE_DECL_GETLOGIN])
   HAVE_DECL_GETLOGIN_R=1; AC_SUBST([HAVE_DECL_GETLOGIN_R])
   HAVE_DECL_GETPAGESIZE=1; AC_SUBST([HAVE_DECL_GETPAGESIZE])
   HAVE_DECL_GETUSERSHELL=1; AC_SUBST([HAVE_DECL_GETUSERSHELL])

Modified: trunk/gnulib/m4/vasnprintf.m4
===================================================================
--- trunk/gnulib/m4/vasnprintf.m4       2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/vasnprintf.m4       2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 # vasnprintf.m4 serial 36
-dnl Copyright (C) 2002-2004, 2006-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2004, 2006-2017 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.

Modified: trunk/gnulib/m4/vasprintf.m4
===================================================================
--- trunk/gnulib/m4/vasprintf.m4        2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/vasprintf.m4        2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 # vasprintf.m4 serial 6
-dnl Copyright (C) 2002-2003, 2006-2007, 2009-2016 Free Software Foundation,
+dnl Copyright (C) 2002-2003, 2006-2007, 2009-2017 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,

Modified: trunk/gnulib/m4/visibility.m4
===================================================================
--- trunk/gnulib/m4/visibility.m4       2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/visibility.m4       2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 # visibility.m4 serial 5 (gettext-0.18.2)
-dnl Copyright (C) 2005, 2008, 2010-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2005, 2008, 2010-2017 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.

Modified: trunk/gnulib/m4/warn-on-use.m4
===================================================================
--- trunk/gnulib/m4/warn-on-use.m4      2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/warn-on-use.m4      2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 # warn-on-use.m4 serial 5
-dnl Copyright (C) 2010-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2010-2017 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.

Modified: trunk/gnulib/m4/wchar_h.m4
===================================================================
--- trunk/gnulib/m4/wchar_h.m4  2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/wchar_h.m4  2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,6 +1,6 @@
 dnl A placeholder for ISO C99 <wchar.h>, for platforms that have issues.
 
-dnl Copyright (C) 2007-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2007-2017 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.

Modified: trunk/gnulib/m4/wchar_t.m4
===================================================================
--- trunk/gnulib/m4/wchar_t.m4  2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/wchar_t.m4  2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 # wchar_t.m4 serial 4 (gettext-0.18.2)
-dnl Copyright (C) 2002-2003, 2008-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2003, 2008-2017 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.

Modified: trunk/gnulib/m4/wcrtomb.m4
===================================================================
--- trunk/gnulib/m4/wcrtomb.m4  2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/wcrtomb.m4  2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 # wcrtomb.m4 serial 11
-dnl Copyright (C) 2008-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2008-2017 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.

Modified: trunk/gnulib/m4/wctype_h.m4
===================================================================
--- trunk/gnulib/m4/wctype_h.m4 2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/wctype_h.m4 2017-04-14 17:20:48 UTC (rev 7726)
@@ -2,7 +2,7 @@
 
 dnl A placeholder for ISO C99 <wctype.h>, for platforms that lack it.
 
-dnl Copyright (C) 2006-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2006-2017 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.

Modified: trunk/gnulib/m4/wcwidth.m4
===================================================================
--- trunk/gnulib/m4/wcwidth.m4  2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/wcwidth.m4  2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 # wcwidth.m4 serial 23
-dnl Copyright (C) 2006-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2006-2017 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.

Modified: trunk/gnulib/m4/wint_t.m4
===================================================================
--- trunk/gnulib/m4/wint_t.m4   2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/wint_t.m4   2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,11 +1,12 @@
-# wint_t.m4 serial 5 (gettext-0.18.2)
-dnl Copyright (C) 2003, 2007-2016 Free Software Foundation, Inc.
+# wint_t.m4 serial 6
+dnl Copyright (C) 2003, 2007-2017 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
 
 dnl From Bruno Haible.
-dnl Test whether <wchar.h> has the 'wint_t' type.
+dnl Test whether <wchar.h> has the 'wint_t' type and whether gnulib's
+dnl <wchar.h> or <wctype.h> would, if present, override 'wint_t'.
 dnl Prerequisite: AC_PROG_CC
 
 AC_DEFUN([gt_TYPE_WINT_T],
@@ -28,5 +29,34 @@
        [gt_cv_c_wint_t=no])])
   if test $gt_cv_c_wint_t = yes; then
     AC_DEFINE([HAVE_WINT_T], [1], [Define if you have the 'wint_t' type.])
+
+    dnl Determine whether gnulib's <wchar.h> or <wctype.h> would, if present,
+    dnl override 'wint_t'.
+    AC_CACHE_CHECK([whether wint_t is too small],
+      [gl_cv_type_wint_t_too_small],
+      [AC_COMPILE_IFELSE(
+           [AC_LANG_PROGRAM([[
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+   <wchar.h>.
+   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+   included before <wchar.h>.  */
+#if !(defined __GLIBC__ && !defined __UCLIBC__)
+# include <stddef.h>
+# include <stdio.h>
+# include <time.h>
+#endif
+#include <wchar.h>
+              int verify[sizeof (wint_t) < sizeof (int) ? -1 : 1];
+              ]])],
+           [gl_cv_type_wint_t_too_small=no],
+           [gl_cv_type_wint_t_too_small=yes])])
+    if test $gl_cv_type_wint_t_too_small = yes; then
+      GNULIB_OVERRIDES_WINT_T=1
+    else
+      GNULIB_OVERRIDES_WINT_T=0
+    fi
+  else
+    GNULIB_OVERRIDES_WINT_T=0
   fi
+  AC_SUBST([GNULIB_OVERRIDES_WINT_T])
 ])

Modified: trunk/gnulib/m4/xalloc.m4
===================================================================
--- trunk/gnulib/m4/xalloc.m4   2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/xalloc.m4   2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 # xalloc.m4 serial 18
-dnl Copyright (C) 2002-2006, 2009-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2006, 2009-2017 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.

Modified: trunk/gnulib/m4/xsize.m4
===================================================================
--- trunk/gnulib/m4/xsize.m4    2017-04-14 16:36:56 UTC (rev 7725)
+++ trunk/gnulib/m4/xsize.m4    2017-04-14 17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 # xsize.m4 serial 5
-dnl Copyright (C) 2003-2004, 2008-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2003-2004, 2008-2017 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.

Modified: trunk/tp/Texinfo/Convert/XSParagraph/lib/Makefile.am
===================================================================
--- trunk/tp/Texinfo/Convert/XSParagraph/lib/Makefile.am        2017-04-14 
16:36:56 UTC (rev 7725)
+++ trunk/tp/Texinfo/Convert/XSParagraph/lib/Makefile.am        2017-04-14 
17:20:48 UTC (rev 7726)
@@ -1,6 +1,6 @@
 ## DO NOT EDIT! GENERATED AUTOMATICALLY!
 ## Process this file with automake to produce Makefile.in.
-# Copyright (C) 2002-2016 Free Software Foundation, Inc.
+# Copyright (C) 2002-2017 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
@@ -37,6 +37,7 @@
 CLEANFILES =
 DISTCLEANFILES =
 MAINTAINERCLEANFILES =
+# No GNU Make output.
 
 AM_CPPFLAGS =
 AM_CFLAGS =
@@ -165,6 +166,34 @@
 
 ## end   gnulib module getline
 
+## begin gnulib module limits-h
+
+BUILT_SOURCES += $(LIMITS_H)
+
+# We need the following in order to create <limits.h> when the system
+# doesn't have one that is compatible with GNU.
+if GL_GENERATE_LIMITS_H
+limits.h: limits.in.h $(top_builddir)/config.status
+       $(AM_V_GEN)rm -f address@hidden $@ && \
+       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
+         sed -e 's|@''GUARD_PREFIX''@|GL|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_LIMITS_H''@|$(NEXT_LIMITS_H)|g' \
+             < $(srcdir)/limits.in.h; \
+       } > address@hidden && \
+       mv address@hidden $@
+else
+limits.h: $(top_builddir)/config.status
+       rm -f $@
+endif
+MOSTLYCLEANFILES += limits.h limits.h-t
+
+EXTRA_DIST += limits.in.h
+
+## end   gnulib module limits-h
+
 ## begin gnulib module memchr
 
 
@@ -182,70 +211,37 @@
 
 ## begin gnulib module snippet/arg-nonnull
 
-# The BUILT_SOURCES created by this Makefile snippet are not used via #include
-# statements but through direct file reference. Therefore this snippet must be
-# present in all Makefile.am that need it. This is ensured by the applicability
-# 'all' defined above.
+# Because this Makefile snippet defines a variable used by other
+# gnulib Makefile snippets, it must be present in all makefiles that
+# need it. This is ensured by the applicability 'all' defined above.
 
-BUILT_SOURCES += arg-nonnull.h
-# The arg-nonnull.h that gets inserted into generated .h files is the same as
-# build-aux/snippet/arg-nonnull.h, except that it has the copyright header cut
-# off.
-arg-nonnull.h: $(top_srcdir)/./snippet/arg-nonnull.h
-       $(AM_V_GEN)rm -f address@hidden $@ && \
-       sed -n -e '/GL_ARG_NONNULL/,$$p' \
-         < $(top_srcdir)/./snippet/arg-nonnull.h \
-         > address@hidden && \
-       mv address@hidden $@
-MOSTLYCLEANFILES += arg-nonnull.h arg-nonnull.h-t
+ARG_NONNULL_H=$(srcdir)/arg-nonnull.h
 
-ARG_NONNULL_H=arg-nonnull.h
+EXTRA_DIST += arg-nonnull.h
 
-EXTRA_DIST += $(top_srcdir)/./snippet/arg-nonnull.h
-
 ## end   gnulib module snippet/arg-nonnull
 
 ## begin gnulib module snippet/c++defs
 
-# The BUILT_SOURCES created by this Makefile snippet are not used via #include
-# statements but through direct file reference. Therefore this snippet must be
-# present in all Makefile.am that need it. This is ensured by the applicability
-# 'all' defined above.
+# Because this Makefile snippet defines a variable used by other
+# gnulib Makefile snippets, it must be present in all makefiles that
+# need it. This is ensured by the applicability 'all' defined above.
 
-BUILT_SOURCES += c++defs.h
-# The c++defs.h that gets inserted into generated .h files is the same as
-# build-aux/snippet/c++defs.h, except that it has the copyright header cut off.
-c++defs.h: $(top_srcdir)/./snippet/c++defs.h
-       $(AM_V_GEN)rm -f address@hidden $@ && \
-       sed -n -e '/_GL_CXXDEFS/,$$p' \
-         < $(top_srcdir)/./snippet/c++defs.h \
-         > address@hidden && \
-       mv address@hidden $@
-MOSTLYCLEANFILES += c++defs.h c++defs.h-t
+CXXDEFS_H=$(srcdir)/c++defs.h
 
-CXXDEFS_H=c++defs.h
+EXTRA_DIST += c++defs.h
 
-EXTRA_DIST += $(top_srcdir)/./snippet/c++defs.h
-
 ## end   gnulib module snippet/c++defs
 
 ## begin gnulib module snippet/warn-on-use
 
-BUILT_SOURCES += warn-on-use.h
-# The warn-on-use.h that gets inserted into generated .h files is the same as
-# build-aux/snippet/warn-on-use.h, except that it has the copyright header cut
-# off.
-warn-on-use.h: $(top_srcdir)/./snippet/warn-on-use.h
-       $(AM_V_GEN)rm -f address@hidden $@ && \
-       sed -n -e '/^.ifndef/,$$p' \
-         < $(top_srcdir)/./snippet/warn-on-use.h \
-         > address@hidden && \
-       mv address@hidden $@
-MOSTLYCLEANFILES += warn-on-use.h warn-on-use.h-t
+# Because this Makefile snippet defines a variable used by other
+# gnulib Makefile snippets, it must be present in all makefiles that
+# need it. This is ensured by the applicability 'all' defined above.
 
-WARN_ON_USE_H=warn-on-use.h
+WARN_ON_USE_H=$(srcdir)/warn-on-use.h
 
-EXTRA_DIST += $(top_srcdir)/./snippet/warn-on-use.h
+EXTRA_DIST += warn-on-use.h
 
 ## end   gnulib module snippet/warn-on-use
 
@@ -296,6 +292,7 @@
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
              -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
              -e 's|@''NEXT_STDINT_H''@|$(NEXT_STDINT_H)|g' \
+             -e 's/@''HAVE_C99_STDINT_H''@/$(HAVE_C99_STDINT_H)/g' \
              -e 's/@''HAVE_SYS_TYPES_H''@/$(HAVE_SYS_TYPES_H)/g' \
              -e 's/@''HAVE_INTTYPES_H''@/$(HAVE_INTTYPES_H)/g' \
              -e 's/@''HAVE_SYS_INTTYPES_H''@/$(HAVE_SYS_INTTYPES_H)/g' \
@@ -317,6 +314,7 @@
              -e 's/@''BITSIZEOF_WINT_T''@/$(BITSIZEOF_WINT_T)/g' \
              -e 's/@''HAVE_SIGNED_WINT_T''@/$(HAVE_SIGNED_WINT_T)/g' \
              -e 's/@''WINT_T_SUFFIX''@/$(WINT_T_SUFFIX)/g' \
+             -e 's/@''GNULIB_OVERRIDES_WINT_T''@/$(GNULIB_OVERRIDES_WINT_T)/g' 
\
              < $(srcdir)/stdint.in.h; \
        } > address@hidden && \
        mv address@hidden $@
@@ -624,6 +622,7 @@
              -e 's|@''HAVE_FEATURES_H''@|$(HAVE_FEATURES_H)|g' \
              -e 's|@''NEXT_WCHAR_H''@|$(NEXT_WCHAR_H)|g' \
              -e 's|@''HAVE_WCHAR_H''@|$(HAVE_WCHAR_H)|g' \
+             -e 's/@''GNULIB_OVERRIDES_WINT_T''@/$(GNULIB_OVERRIDES_WINT_T)/g' 
\
              -e 's/@''GNULIB_BTOWC''@/$(GNULIB_BTOWC)/g' \
              -e 's/@''GNULIB_WCTOB''@/$(GNULIB_WCTOB)/g' \
              -e 's/@''GNULIB_MBSINIT''@/$(GNULIB_MBSINIT)/g' \

Modified: trunk/tp/Texinfo/Convert/XSParagraph/lib/alloca.in.h
===================================================================
--- trunk/tp/Texinfo/Convert/XSParagraph/lib/alloca.in.h        2017-04-14 
16:36:56 UTC (rev 7725)
+++ trunk/tp/Texinfo/Convert/XSParagraph/lib/alloca.in.h        2017-04-14 
17:20:48 UTC (rev 7726)
@@ -1,6 +1,6 @@
 /* Memory allocation on the stack.
 
-   Copyright (C) 1995, 1999, 2001-2004, 2006-2016 Free Software Foundation,
+   Copyright (C) 1995, 1999, 2001-2004, 2006-2017 Free Software Foundation,
    Inc.
 
    This program is free software; you can redistribute it and/or modify it

Modified: trunk/tp/Texinfo/Convert/XSParagraph/lib/asnprintf.c
===================================================================
--- trunk/tp/Texinfo/Convert/XSParagraph/lib/asnprintf.c        2017-04-14 
16:36:56 UTC (rev 7725)
+++ trunk/tp/Texinfo/Convert/XSParagraph/lib/asnprintf.c        2017-04-14 
17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 /* Formatted output to strings.
-   Copyright (C) 1999, 2002, 2006, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2002, 2006, 2009-2017 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

Modified: trunk/tp/Texinfo/Convert/XSParagraph/lib/asprintf.c
===================================================================
--- trunk/tp/Texinfo/Convert/XSParagraph/lib/asprintf.c 2017-04-14 16:36:56 UTC 
(rev 7725)
+++ trunk/tp/Texinfo/Convert/XSParagraph/lib/asprintf.c 2017-04-14 17:20:48 UTC 
(rev 7726)
@@ -1,5 +1,5 @@
 /* Formatted output to strings.
-   Copyright (C) 1999, 2002, 2006-2007, 2009-2016 Free Software Foundation,
+   Copyright (C) 1999, 2002, 2006-2007, 2009-2017 Free Software Foundation,
    Inc.
 
    This program is free software; you can redistribute it and/or modify

Modified: trunk/tp/Texinfo/Convert/XSParagraph/lib/errno.in.h
===================================================================
--- trunk/tp/Texinfo/Convert/XSParagraph/lib/errno.in.h 2017-04-14 16:36:56 UTC 
(rev 7725)
+++ trunk/tp/Texinfo/Convert/XSParagraph/lib/errno.in.h 2017-04-14 17:20:48 UTC 
(rev 7726)
@@ -1,6 +1,6 @@
 /* A POSIX-like <errno.h>.
 
-   Copyright (C) 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 2008-2017 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

Modified: trunk/tp/Texinfo/Convert/XSParagraph/lib/float+.h
===================================================================
--- trunk/tp/Texinfo/Convert/XSParagraph/lib/float+.h   2017-04-14 16:36:56 UTC 
(rev 7725)
+++ trunk/tp/Texinfo/Convert/XSParagraph/lib/float+.h   2017-04-14 17:20:48 UTC 
(rev 7726)
@@ -1,5 +1,5 @@
 /* Supplemental information about the floating-point formats.
-   Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009-2017 Free Software Foundation, Inc.
    Written by Bruno Haible <address@hidden>, 2007.
 
    This program is free software; you can redistribute it and/or modify

Modified: trunk/tp/Texinfo/Convert/XSParagraph/lib/float.c
===================================================================
--- trunk/tp/Texinfo/Convert/XSParagraph/lib/float.c    2017-04-14 16:36:56 UTC 
(rev 7725)
+++ trunk/tp/Texinfo/Convert/XSParagraph/lib/float.c    2017-04-14 17:20:48 UTC 
(rev 7726)
@@ -1,5 +1,5 @@
 /* Auxiliary definitions for <float.h>.
-   Copyright (C) 2011-2016 Free Software Foundation, Inc.
+   Copyright (C) 2011-2017 Free Software Foundation, Inc.
    Written by Bruno Haible <address@hidden>, 2011.
 
    This program is free software: you can redistribute it and/or modify

Modified: trunk/tp/Texinfo/Convert/XSParagraph/lib/float.in.h
===================================================================
--- trunk/tp/Texinfo/Convert/XSParagraph/lib/float.in.h 2017-04-14 16:36:56 UTC 
(rev 7725)
+++ trunk/tp/Texinfo/Convert/XSParagraph/lib/float.in.h 2017-04-14 17:20:48 UTC 
(rev 7726)
@@ -1,6 +1,6 @@
 /* A correct <float.h>.
 
-   Copyright (C) 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007-2017 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

Modified: trunk/tp/Texinfo/Convert/XSParagraph/lib/getdelim.c
===================================================================
--- trunk/tp/Texinfo/Convert/XSParagraph/lib/getdelim.c 2017-04-14 16:36:56 UTC 
(rev 7725)
+++ trunk/tp/Texinfo/Convert/XSParagraph/lib/getdelim.c 2017-04-14 17:20:48 UTC 
(rev 7726)
@@ -1,5 +1,5 @@
 /* getdelim.c --- Implementation of replacement getdelim function.
-   Copyright (C) 1994, 1996-1998, 2001, 2003, 2005-2016 Free Software
+   Copyright (C) 1994, 1996-1998, 2001, 2003, 2005-2017 Free Software
    Foundation, Inc.
 
    This program is free software; you can redistribute it and/or

Modified: trunk/tp/Texinfo/Convert/XSParagraph/lib/getline.c
===================================================================
--- trunk/tp/Texinfo/Convert/XSParagraph/lib/getline.c  2017-04-14 16:36:56 UTC 
(rev 7725)
+++ trunk/tp/Texinfo/Convert/XSParagraph/lib/getline.c  2017-04-14 17:20:48 UTC 
(rev 7726)
@@ -1,5 +1,5 @@
 /* getline.c --- Implementation of replacement getline function.
-   Copyright (C) 2005-2007, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2005-2007, 2009-2017 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

Modified: trunk/tp/Texinfo/Convert/XSParagraph/lib/itold.c
===================================================================
--- trunk/tp/Texinfo/Convert/XSParagraph/lib/itold.c    2017-04-14 16:36:56 UTC 
(rev 7725)
+++ trunk/tp/Texinfo/Convert/XSParagraph/lib/itold.c    2017-04-14 17:20:48 UTC 
(rev 7726)
@@ -1,5 +1,5 @@
 /* Replacement for 'int' to 'long double' conversion routine.
-   Copyright (C) 2011-2016 Free Software Foundation, Inc.
+   Copyright (C) 2011-2017 Free Software Foundation, Inc.
    Written by Bruno Haible <address@hidden>, 2011.
 
    This program is free software: you can redistribute it and/or modify

Added: trunk/tp/Texinfo/Convert/XSParagraph/lib/limits.in.h
===================================================================
--- trunk/tp/Texinfo/Convert/XSParagraph/lib/limits.in.h                        
        (rev 0)
+++ trunk/tp/Texinfo/Convert/XSParagraph/lib/limits.in.h        2017-04-14 
17:20:48 UTC (rev 7726)
@@ -0,0 +1,74 @@
+/* A GNU-like <limits.h>.
+
+   Copyright 2016-2017 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/>.  */
+
+#ifndef address@hidden@_LIMITS_H
+
+#if __GNUC__ >= 3
address@hidden@
+#endif
address@hidden@
+
+/* The include_next requires a split double-inclusion guard.  */
address@hidden@ @NEXT_LIMITS_H@
+
+#ifndef address@hidden@_LIMITS_H
+#define address@hidden@_LIMITS_H
+
+/* For HP-UX 11.31.  */
+#if defined LONG_LONG_MIN && !defined LLONG_MIN
+# define LLONG_MIN LONG_LONG_MIN
+#endif
+#if defined LONG_LONG_MAX && !defined LLONG_MAX
+# define LLONG_MAX LONG_LONG_MAX
+#endif
+#if defined ULONG_LONG_MAX && !defined ULLONG_MAX
+# define ULLONG_MAX ULONG_LONG_MAX
+#endif
+
+/* The number of usable bits in an unsigned or signed integer type
+   with minimum value MIN and maximum value MAX, as an int expression
+   suitable in #if.  Cover all known practical hosts.  This
+   implementation exploits the fact that MAX is 1 less than a power of
+   2, and merely counts the number of 1 bits in MAX; "COBn" means
+   "count the number of 1 bits in the low-order n bits").  */
+#define _GL_INTEGER_WIDTH(min, max) (((min) < 0) + _GL_COB128 (max))
+#define _GL_COB128(n) (_GL_COB64 ((n) >> 31 >> 31 >> 2) + _GL_COB64 (n))
+#define _GL_COB64(n) (_GL_COB32 ((n) >> 31 >> 1) + _GL_COB32 (n))
+#define _GL_COB32(n) (_GL_COB16 ((n) >> 16) + _GL_COB16 (n))
+#define _GL_COB16(n) (_GL_COB8 ((n) >> 8) + _GL_COB8 (n))
+#define _GL_COB8(n) (_GL_COB4 ((n) >> 4) + _GL_COB4 (n))
+#define _GL_COB4(n) (!!((n) & 8) + !!((n) & 4) + !!((n) & 2) + !!((n) & 1))
+
+/* Macros specified by ISO/IEC TS 18661-1:2014.  */
+
+#if (! defined ULLONG_WIDTH                                             \
+     && (defined _GNU_SOURCE || defined __STDC_WANT_IEC_60559_BFP_EXT__))
+# define CHAR_WIDTH _GL_INTEGER_WIDTH (CHAR_MIN, CHAR_MAX)
+# define SCHAR_WIDTH _GL_INTEGER_WIDTH (SCHAR_MIN, SCHAR_MAX)
+# define UCHAR_WIDTH _GL_INTEGER_WIDTH (0, UCHAR_MAX)
+# define SHRT_WIDTH _GL_INTEGER_WIDTH (SHRT_MIN, SHRT_MAX)
+# define USHRT_WIDTH _GL_INTEGER_WIDTH (0, USHRT_MAX)
+# define INT_WIDTH _GL_INTEGER_WIDTH (INT_MIN, INT_MAX)
+# define UINT_WIDTH _GL_INTEGER_WIDTH (0, UINT_MAX)
+# define LONG_WIDTH _GL_INTEGER_WIDTH (LONG_MIN, LONG_MAX)
+# define ULONG_WIDTH _GL_INTEGER_WIDTH (0, ULONG_MAX)
+# define LLONG_WIDTH _GL_INTEGER_WIDTH (LLONG_MIN, LLONG_MAX)
+# define ULLONG_WIDTH _GL_INTEGER_WIDTH (0, ULLONG_MAX)
+#endif /* !ULLONG_WIDTH && (_GNU_SOURCE || __STDC_WANT_IEC_60559_BFP_EXT__) */
+
+#endif /* address@hidden@_LIMITS_H */
+#endif /* address@hidden@_LIMITS_H */

Modified: trunk/tp/Texinfo/Convert/XSParagraph/lib/memchr.c
===================================================================
--- trunk/tp/Texinfo/Convert/XSParagraph/lib/memchr.c   2017-04-14 16:36:56 UTC 
(rev 7725)
+++ trunk/tp/Texinfo/Convert/XSParagraph/lib/memchr.c   2017-04-14 17:20:48 UTC 
(rev 7726)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1993, 1996-1997, 1999-2000, 2003-2004, 2006, 2008-2016
+/* Copyright (C) 1991, 1993, 1996-1997, 1999-2000, 2003-2004, 2006, 2008-2017
    Free Software Foundation, Inc.
 
    Based on strlen implementation by Torbjorn Granlund (address@hidden),

Modified: trunk/tp/Texinfo/Convert/XSParagraph/lib/printf-args.c
===================================================================
--- trunk/tp/Texinfo/Convert/XSParagraph/lib/printf-args.c      2017-04-14 
16:36:56 UTC (rev 7725)
+++ trunk/tp/Texinfo/Convert/XSParagraph/lib/printf-args.c      2017-04-14 
17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 /* Decomposed printf argument list.
-   Copyright (C) 1999, 2002-2003, 2005-2007, 2009-2016 Free Software
+   Copyright (C) 1999, 2002-2003, 2005-2007, 2009-2017 Free Software
    Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify

Modified: trunk/tp/Texinfo/Convert/XSParagraph/lib/printf-args.h
===================================================================
--- trunk/tp/Texinfo/Convert/XSParagraph/lib/printf-args.h      2017-04-14 
16:36:56 UTC (rev 7725)
+++ trunk/tp/Texinfo/Convert/XSParagraph/lib/printf-args.h      2017-04-14 
17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 /* Decomposed printf argument list.
-   Copyright (C) 1999, 2002-2003, 2006-2007, 2011-2016 Free Software
+   Copyright (C) 1999, 2002-2003, 2006-2007, 2011-2017 Free Software
    Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify

Modified: trunk/tp/Texinfo/Convert/XSParagraph/lib/printf-parse.c
===================================================================
--- trunk/tp/Texinfo/Convert/XSParagraph/lib/printf-parse.c     2017-04-14 
16:36:56 UTC (rev 7725)
+++ trunk/tp/Texinfo/Convert/XSParagraph/lib/printf-parse.c     2017-04-14 
17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 /* Formatted output to strings.
-   Copyright (C) 1999-2000, 2002-2003, 2006-2016 Free Software Foundation, Inc.
+   Copyright (C) 1999-2000, 2002-2003, 2006-2017 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

Modified: trunk/tp/Texinfo/Convert/XSParagraph/lib/printf-parse.h
===================================================================
--- trunk/tp/Texinfo/Convert/XSParagraph/lib/printf-parse.h     2017-04-14 
16:36:56 UTC (rev 7725)
+++ trunk/tp/Texinfo/Convert/XSParagraph/lib/printf-parse.h     2017-04-14 
17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 /* Parse printf format string.
-   Copyright (C) 1999, 2002-2003, 2005, 2007, 2010-2016 Free Software
+   Copyright (C) 1999, 2002-2003, 2005, 2007, 2010-2017 Free Software
    Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify

Modified: trunk/tp/Texinfo/Convert/XSParagraph/lib/size_max.h
===================================================================
--- trunk/tp/Texinfo/Convert/XSParagraph/lib/size_max.h 2017-04-14 16:36:56 UTC 
(rev 7725)
+++ trunk/tp/Texinfo/Convert/XSParagraph/lib/size_max.h 2017-04-14 17:20:48 UTC 
(rev 7726)
@@ -1,5 +1,5 @@
 /* size_max.h -- declare SIZE_MAX through system headers
-   Copyright (C) 2005-2006, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2005-2006, 2009-2017 Free Software Foundation, Inc.
    Written by Simon Josefsson.
 
    This program is free software; you can redistribute it and/or modify

Modified: trunk/tp/Texinfo/Convert/XSParagraph/lib/stddef.in.h
===================================================================
--- trunk/tp/Texinfo/Convert/XSParagraph/lib/stddef.in.h        2017-04-14 
16:36:56 UTC (rev 7725)
+++ trunk/tp/Texinfo/Convert/XSParagraph/lib/stddef.in.h        2017-04-14 
17:20:48 UTC (rev 7726)
@@ -1,6 +1,6 @@
 /* A substitute for POSIX 2008 <stddef.h>, for platforms that have issues.
 
-   Copyright (C) 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2009-2017 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

Modified: trunk/tp/Texinfo/Convert/XSParagraph/lib/stdint.in.h
===================================================================
--- trunk/tp/Texinfo/Convert/XSParagraph/lib/stdint.in.h        2017-04-14 
16:36:56 UTC (rev 7725)
+++ trunk/tp/Texinfo/Convert/XSParagraph/lib/stdint.in.h        2017-04-14 
17:20:48 UTC (rev 7726)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2002, 2004-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2002, 2004-2017 Free Software Foundation, Inc.
    Written by Paul Eggert, Bruno Haible, Sam Steingold, Peter Burwood.
    This file is part of gnulib.
 
@@ -79,6 +79,21 @@
 #if ! defined address@hidden@_STDINT_H && ! defined 
_GL_JUST_INCLUDE_SYSTEM_STDINT_H
 #define address@hidden@_STDINT_H
 
+/* Get SCHAR_MIN, SCHAR_MAX, UCHAR_MAX, INT_MIN, INT_MAX,
+   LONG_MIN, LONG_MAX, ULONG_MAX, _GL_INTEGER_WIDTH.  */
+#include <limits.h>
+
+/* Override WINT_MIN and WINT_MAX if gnulib's <wchar.h> or <wctype.h> overrides
+   wint_t.  */
+#if @GNULIB_OVERRIDES_WINT_T@
+# undef WINT_MIN
+# undef WINT_MAX
+# define WINT_MIN 0x0U
+# define WINT_MAX 0xffffffffU
+#endif
+
+#if ! @HAVE_C99_STDINT_H@
+
 /* <sys/types.h> defines some of the stdint.h types as well, on glibc,
    IRIX 6.5, and OpenBSD 3.8 (via <machine/types.h>).
    AIX 5.2 <sys/types.h> isn't needed and causes troubles.
@@ -85,43 +100,44 @@
    Mac OS X 10.4.6 <sys/types.h> includes <stdint.h> (which is us), but
    relies on the system <stdint.h> definitions, so include
    <sys/types.h> after @address@hidden  */
-#if @HAVE_SYS_TYPES_H@ && ! defined _AIX
-# include <sys/types.h>
-#endif
+# if @HAVE_SYS_TYPES_H@ && ! defined _AIX
+#  include <sys/types.h>
+# endif
 
-/* Get SCHAR_MIN, SCHAR_MAX, UCHAR_MAX, INT_MIN, INT_MAX,
-   LONG_MIN, LONG_MAX, ULONG_MAX.  */
-#include <limits.h>
-
-#if @HAVE_INTTYPES_H@
+# if @HAVE_INTTYPES_H@
   /* In OpenBSD 3.8, <inttypes.h> includes <machine/types.h>, which defines
      int{8,16,32,64}_t, uint{8,16,32,64}_t and __BIT_TYPES_DEFINED__.
      <inttypes.h> also defines intptr_t and uintptr_t.  */
-# include <inttypes.h>
-#elif @HAVE_SYS_INTTYPES_H@
+#  include <inttypes.h>
+# elif @HAVE_SYS_INTTYPES_H@
   /* Solaris 7 <sys/inttypes.h> has the types except the *_fast*_t types, and
      the macros except for *_FAST*_*, INTPTR_MIN, PTRDIFF_MIN, PTRDIFF_MAX.  */
-# include <sys/inttypes.h>
-#endif
+#  include <sys/inttypes.h>
+# endif
 
-#if @HAVE_SYS_BITYPES_H@ && ! defined __BIT_TYPES_DEFINED__
+# if @HAVE_SYS_BITYPES_H@ && ! defined __BIT_TYPES_DEFINED__
   /* Linux libc4 >= 4.6.7 and libc5 have a <sys/bitypes.h> that defines
      int{8,16,32,64}_t and __BIT_TYPES_DEFINED__.  In libc5 >= 5.2.2 it is
      included by <sys/types.h>.  */
-# include <sys/bitypes.h>
-#endif
+#  include <sys/bitypes.h>
+# endif
 
-#undef _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H
+# undef _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H
 
 /* Minimum and maximum values for an integer type under the usual assumption.
    Return an unspecified value if BITS == 0, adding a check to pacify
    picky compilers.  */
 
-#define _STDINT_MIN(signed, bits, zero) \
-  ((signed) ? ~ _STDINT_MAX (signed, bits, zero) : (zero))
+/* These are separate macros, because if you try to merge these macros into
+   a single one, HP-UX cc rejects the resulting expression in constant
+   expressions.  */
+# define _STDINT_UNSIGNED_MIN(bits, zero) \
+    (zero)
+# define _STDINT_SIGNED_MIN(bits, zero) \
+    (~ _STDINT_MAX (1, bits, zero))
 
-#define _STDINT_MAX(signed, bits, zero) \
-  (((((zero) + 1) << ((bits) ? (bits) - 1 - (signed) : 0)) - 1) * 2 + 1)
+# define _STDINT_MAX(signed, bits, zero) \
+    (((((zero) + 1) << ((bits) ? (bits) - 1 - (signed) : 0)) - 1) * 2 + 1)
 
 #if !GNULIB_defined_stdint_types
 
@@ -130,26 +146,26 @@
 /* Here we assume a standard architecture where the hardware integer
    types have 8, 16, 32, optionally 64 bits.  */
 
-#undef int8_t
-#undef uint8_t
+# undef int8_t
+# undef uint8_t
 typedef signed char gl_int8_t;
 typedef unsigned char gl_uint8_t;
-#define int8_t gl_int8_t
-#define uint8_t gl_uint8_t
+# define int8_t gl_int8_t
+# define uint8_t gl_uint8_t
 
-#undef int16_t
-#undef uint16_t
+# undef int16_t
+# undef uint16_t
 typedef short int gl_int16_t;
 typedef unsigned short int gl_uint16_t;
-#define int16_t gl_int16_t
-#define uint16_t gl_uint16_t
+# define int16_t gl_int16_t
+# define uint16_t gl_uint16_t
 
-#undef int32_t
-#undef uint32_t
+# undef int32_t
+# undef uint32_t
 typedef int gl_int32_t;
 typedef unsigned int gl_uint32_t;
-#define int32_t gl_int32_t
-#define uint32_t gl_uint32_t
+# define int32_t gl_int32_t
+# define uint32_t gl_uint32_t
 
 /* If the system defines INT64_MAX, assume int64_t works.  That way,
    if the underlying platform defines int64_t to be a 64-bit long long
@@ -157,54 +173,54 @@
    int, which would mess up C++ name mangling.  We must use #ifdef
    rather than #if, to avoid an error with HP-UX 10.20 cc.  */
 
-#ifdef INT64_MAX
-# define GL_INT64_T
-#else
+# ifdef INT64_MAX
+#  define GL_INT64_T
+# else
 /* Do not undefine int64_t if gnulib is not being used with 64-bit
    types, since otherwise it breaks platforms like Tandem/NSK.  */
-# if LONG_MAX >> 31 >> 31 == 1
-#  undef int64_t
+#  if LONG_MAX >> 31 >> 31 == 1
+#   undef int64_t
 typedef long int gl_int64_t;
-#  define int64_t gl_int64_t
-#  define GL_INT64_T
-# elif defined _MSC_VER
-#  undef int64_t
+#   define int64_t gl_int64_t
+#   define GL_INT64_T
+#  elif defined _MSC_VER
+#   undef int64_t
 typedef __int64 gl_int64_t;
-#  define int64_t gl_int64_t
-#  define GL_INT64_T
-# elif @HAVE_LONG_LONG_INT@
-#  undef int64_t
+#   define int64_t gl_int64_t
+#   define GL_INT64_T
+#  elif @HAVE_LONG_LONG_INT@
+#   undef int64_t
 typedef long long int gl_int64_t;
-#  define int64_t gl_int64_t
-#  define GL_INT64_T
+#   define int64_t gl_int64_t
+#   define GL_INT64_T
+#  endif
 # endif
-#endif
 
-#ifdef UINT64_MAX
-# define GL_UINT64_T
-#else
-# if ULONG_MAX >> 31 >> 31 >> 1 == 1
-#  undef uint64_t
+# ifdef UINT64_MAX
+#  define GL_UINT64_T
+# else
+#  if ULONG_MAX >> 31 >> 31 >> 1 == 1
+#   undef uint64_t
 typedef unsigned long int gl_uint64_t;
-#  define uint64_t gl_uint64_t
-#  define GL_UINT64_T
-# elif defined _MSC_VER
-#  undef uint64_t
+#   define uint64_t gl_uint64_t
+#   define GL_UINT64_T
+#  elif defined _MSC_VER
+#   undef uint64_t
 typedef unsigned __int64 gl_uint64_t;
-#  define uint64_t gl_uint64_t
-#  define GL_UINT64_T
-# elif @HAVE_UNSIGNED_LONG_LONG_INT@
-#  undef uint64_t
+#   define uint64_t gl_uint64_t
+#   define GL_UINT64_T
+#  elif @HAVE_UNSIGNED_LONG_LONG_INT@
+#   undef uint64_t
 typedef unsigned long long int gl_uint64_t;
-#  define uint64_t gl_uint64_t
-#  define GL_UINT64_T
+#   define uint64_t gl_uint64_t
+#   define GL_UINT64_T
+#  endif
 # endif
-#endif
 
 /* Avoid collision with Solaris 2.5.1 <pthread.h> etc.  */
-#define _UINT8_T
-#define _UINT32_T
-#define _UINT64_T
+# define _UINT8_T
+# define _UINT32_T
+# define _UINT64_T
 
 
 /* 7.18.1.2. Minimum-width integer types */
@@ -213,26 +229,26 @@
    types have 8, 16, 32, optionally 64 bits. Therefore the leastN_t types
    are the same as the corresponding N_t types.  */
 
-#undef int_least8_t
-#undef uint_least8_t
-#undef int_least16_t
-#undef uint_least16_t
-#undef int_least32_t
-#undef uint_least32_t
-#undef int_least64_t
-#undef uint_least64_t
-#define int_least8_t int8_t
-#define uint_least8_t uint8_t
-#define int_least16_t int16_t
-#define uint_least16_t uint16_t
-#define int_least32_t int32_t
-#define uint_least32_t uint32_t
-#ifdef GL_INT64_T
-# define int_least64_t int64_t
-#endif
-#ifdef GL_UINT64_T
-# define uint_least64_t uint64_t
-#endif
+# undef int_least8_t
+# undef uint_least8_t
+# undef int_least16_t
+# undef uint_least16_t
+# undef int_least32_t
+# undef uint_least32_t
+# undef int_least64_t
+# undef uint_least64_t
+# define int_least8_t int8_t
+# define uint_least8_t uint8_t
+# define int_least16_t int16_t
+# define uint_least16_t uint16_t
+# define int_least32_t int32_t
+# define uint_least32_t uint32_t
+# ifdef GL_INT64_T
+#  define int_least64_t int64_t
+# endif
+# ifdef GL_UINT64_T
+#  define uint_least64_t uint64_t
+# endif
 
 /* 7.18.1.3. Fastest minimum-width integer types */
 
@@ -245,41 +261,41 @@
    uses types consistent with glibc, as that lessens the chance of
    incompatibility with older GNU hosts.  */
 
-#undef int_fast8_t
-#undef uint_fast8_t
-#undef int_fast16_t
-#undef uint_fast16_t
-#undef int_fast32_t
-#undef uint_fast32_t
-#undef int_fast64_t
-#undef uint_fast64_t
+# undef int_fast8_t
+# undef uint_fast8_t
+# undef int_fast16_t
+# undef uint_fast16_t
+# undef int_fast32_t
+# undef uint_fast32_t
+# undef int_fast64_t
+# undef uint_fast64_t
 typedef signed char gl_int_fast8_t;
 typedef unsigned char gl_uint_fast8_t;
 
-#ifdef __sun
+# ifdef __sun
 /* Define types compatible with SunOS 5.10, so that code compiled under
    earlier SunOS versions works with code compiled under SunOS 5.10.  */
 typedef int gl_int_fast32_t;
 typedef unsigned int gl_uint_fast32_t;
-#else
+# else
 typedef long int gl_int_fast32_t;
 typedef unsigned long int gl_uint_fast32_t;
-#endif
+# endif
 typedef gl_int_fast32_t gl_int_fast16_t;
 typedef gl_uint_fast32_t gl_uint_fast16_t;
 
-#define int_fast8_t gl_int_fast8_t
-#define uint_fast8_t gl_uint_fast8_t
-#define int_fast16_t gl_int_fast16_t
-#define uint_fast16_t gl_uint_fast16_t
-#define int_fast32_t gl_int_fast32_t
-#define uint_fast32_t gl_uint_fast32_t
-#ifdef GL_INT64_T
-# define int_fast64_t int64_t
-#endif
-#ifdef GL_UINT64_T
-# define uint_fast64_t uint64_t
-#endif
+# define int_fast8_t gl_int_fast8_t
+# define uint_fast8_t gl_uint_fast8_t
+# define int_fast16_t gl_int_fast16_t
+# define uint_fast16_t gl_uint_fast16_t
+# define int_fast32_t gl_int_fast32_t
+# define uint_fast32_t gl_uint_fast32_t
+# ifdef GL_INT64_T
+#  define int_fast64_t int64_t
+# endif
+# ifdef GL_UINT64_T
+#  define uint_fast64_t uint64_t
+# endif
 
 /* 7.18.1.4. Integer types capable of holding object pointers */
 
@@ -286,14 +302,14 @@
 /* kLIBC's stdint.h defines _INTPTR_T_DECLARED and needs its own
    definitions of intptr_t and uintptr_t (which use int and unsigned)
    to avoid clashes with declarations of system functions like sbrk.  */
-#ifndef _INTPTR_T_DECLARED
-#undef intptr_t
-#undef uintptr_t
+# ifndef _INTPTR_T_DECLARED
+# undef intptr_t
+# undef uintptr_t
 typedef long int gl_intptr_t;
 typedef unsigned long int gl_uintptr_t;
-#define intptr_t gl_intptr_t
-#define uintptr_t gl_uintptr_t
-#endif
+# define intptr_t gl_intptr_t
+# define uintptr_t gl_uintptr_t
+# endif
 
 /* 7.18.1.5. Greatest-width integer types */
 
@@ -304,33 +320,33 @@
    similarly for UINTMAX_MAX and uintmax_t.  This avoids problems with
    assuming one type where another is used by the system.  */
 
-#ifndef INTMAX_MAX
-# undef INTMAX_C
-# undef intmax_t
-# if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1
+# ifndef INTMAX_MAX
+#  undef INTMAX_C
+#  undef intmax_t
+#  if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1
 typedef long long int gl_intmax_t;
-#  define intmax_t gl_intmax_t
-# elif defined GL_INT64_T
-#  define intmax_t int64_t
-# else
+#   define intmax_t gl_intmax_t
+#  elif defined GL_INT64_T
+#   define intmax_t int64_t
+#  else
 typedef long int gl_intmax_t;
-#  define intmax_t gl_intmax_t
+#   define intmax_t gl_intmax_t
+#  endif
 # endif
-#endif
 
-#ifndef UINTMAX_MAX
-# undef UINTMAX_C
-# undef uintmax_t
-# if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1
+# ifndef UINTMAX_MAX
+#  undef UINTMAX_C
+#  undef uintmax_t
+#  if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1
 typedef unsigned long long int gl_uintmax_t;
-#  define uintmax_t gl_uintmax_t
-# elif defined GL_UINT64_T
-#  define uintmax_t uint64_t
-# else
+#   define uintmax_t gl_uintmax_t
+#  elif defined GL_UINT64_T
+#   define uintmax_t uint64_t
+#  else
 typedef unsigned long int gl_uintmax_t;
-#  define uintmax_t gl_uintmax_t
+#   define uintmax_t gl_uintmax_t
+#  endif
 # endif
-#endif
 
 /* Verify that intmax_t and uintmax_t have the same size.  Too much code
    breaks if this is not the case.  If this check fails, the reason is likely
@@ -338,8 +354,8 @@
 typedef int _verify_intmax_size[sizeof (intmax_t) == sizeof (uintmax_t)
                                 ? 1 : -1];
 
-#define GNULIB_defined_stdint_types 1
-#endif /* !GNULIB_defined_stdint_types */
+# define GNULIB_defined_stdint_types 1
+# endif /* !GNULIB_defined_stdint_types */
 
 /* 7.18.2. Limits of specified-width integer types */
 
@@ -348,37 +364,37 @@
 /* Here we assume a standard architecture where the hardware integer
    types have 8, 16, 32, optionally 64 bits.  */
 
-#undef INT8_MIN
-#undef INT8_MAX
-#undef UINT8_MAX
-#define INT8_MIN  (~ INT8_MAX)
-#define INT8_MAX  127
-#define UINT8_MAX  255
+# undef INT8_MIN
+# undef INT8_MAX
+# undef UINT8_MAX
+# define INT8_MIN  (~ INT8_MAX)
+# define INT8_MAX  127
+# define UINT8_MAX  255
 
-#undef INT16_MIN
-#undef INT16_MAX
-#undef UINT16_MAX
-#define INT16_MIN  (~ INT16_MAX)
-#define INT16_MAX  32767
-#define UINT16_MAX  65535
+# undef INT16_MIN
+# undef INT16_MAX
+# undef UINT16_MAX
+# define INT16_MIN  (~ INT16_MAX)
+# define INT16_MAX  32767
+# define UINT16_MAX  65535
 
-#undef INT32_MIN
-#undef INT32_MAX
-#undef UINT32_MAX
-#define INT32_MIN  (~ INT32_MAX)
-#define INT32_MAX  2147483647
-#define UINT32_MAX  4294967295U
+# undef INT32_MIN
+# undef INT32_MAX
+# undef UINT32_MAX
+# define INT32_MIN  (~ INT32_MAX)
+# define INT32_MAX  2147483647
+# define UINT32_MAX  4294967295U
 
-#if defined GL_INT64_T && ! defined INT64_MAX
+# if defined GL_INT64_T && ! defined INT64_MAX
 /* Prefer (- INTMAX_C (1) << 63) over (~ INT64_MAX) because SunPRO C 5.0
    evaluates the latter incorrectly in preprocessor expressions.  */
-# define INT64_MIN  (- INTMAX_C (1) << 63)
-# define INT64_MAX  INTMAX_C (9223372036854775807)
-#endif
+#  define INT64_MIN  (- INTMAX_C (1) << 63)
+#  define INT64_MAX  INTMAX_C (9223372036854775807)
+# endif
 
-#if defined GL_UINT64_T && ! defined UINT64_MAX
-# define UINT64_MAX  UINTMAX_C (18446744073709551615)
-#endif
+# if defined GL_UINT64_T && ! defined UINT64_MAX
+#  define UINT64_MAX  UINTMAX_C (18446744073709551615)
+# endif
 
 /* 7.18.2.2. Limits of minimum-width integer types */
 
@@ -386,38 +402,38 @@
    types have 8, 16, 32, optionally 64 bits. Therefore the leastN_t types
    are the same as the corresponding N_t types.  */
 
-#undef INT_LEAST8_MIN
-#undef INT_LEAST8_MAX
-#undef UINT_LEAST8_MAX
-#define INT_LEAST8_MIN  INT8_MIN
-#define INT_LEAST8_MAX  INT8_MAX
-#define UINT_LEAST8_MAX  UINT8_MAX
+# undef INT_LEAST8_MIN
+# undef INT_LEAST8_MAX
+# undef UINT_LEAST8_MAX
+# define INT_LEAST8_MIN  INT8_MIN
+# define INT_LEAST8_MAX  INT8_MAX
+# define UINT_LEAST8_MAX  UINT8_MAX
 
-#undef INT_LEAST16_MIN
-#undef INT_LEAST16_MAX
-#undef UINT_LEAST16_MAX
-#define INT_LEAST16_MIN  INT16_MIN
-#define INT_LEAST16_MAX  INT16_MAX
-#define UINT_LEAST16_MAX  UINT16_MAX
+# undef INT_LEAST16_MIN
+# undef INT_LEAST16_MAX
+# undef UINT_LEAST16_MAX
+# define INT_LEAST16_MIN  INT16_MIN
+# define INT_LEAST16_MAX  INT16_MAX
+# define UINT_LEAST16_MAX  UINT16_MAX
 
-#undef INT_LEAST32_MIN
-#undef INT_LEAST32_MAX
-#undef UINT_LEAST32_MAX
-#define INT_LEAST32_MIN  INT32_MIN
-#define INT_LEAST32_MAX  INT32_MAX
-#define UINT_LEAST32_MAX  UINT32_MAX
+# undef INT_LEAST32_MIN
+# undef INT_LEAST32_MAX
+# undef UINT_LEAST32_MAX
+# define INT_LEAST32_MIN  INT32_MIN
+# define INT_LEAST32_MAX  INT32_MAX
+# define UINT_LEAST32_MAX  UINT32_MAX
 
-#undef INT_LEAST64_MIN
-#undef INT_LEAST64_MAX
-#ifdef GL_INT64_T
-# define INT_LEAST64_MIN  INT64_MIN
-# define INT_LEAST64_MAX  INT64_MAX
-#endif
+# undef INT_LEAST64_MIN
+# undef INT_LEAST64_MAX
+# ifdef GL_INT64_T
+#  define INT_LEAST64_MIN  INT64_MIN
+#  define INT_LEAST64_MAX  INT64_MAX
+# endif
 
-#undef UINT_LEAST64_MAX
-#ifdef GL_UINT64_T
-# define UINT_LEAST64_MAX  UINT64_MAX
-#endif
+# undef UINT_LEAST64_MAX
+# ifdef GL_UINT64_T
+#  define UINT_LEAST64_MAX  UINT64_MAX
+# endif
 
 /* 7.18.2.3. Limits of fastest minimum-width integer types */
 
@@ -425,117 +441,121 @@
    types have 8, 16, 32, optionally 64 bits. Therefore the fastN_t types
    are taken from the same list of types.  */
 
-#undef INT_FAST8_MIN
-#undef INT_FAST8_MAX
-#undef UINT_FAST8_MAX
-#define INT_FAST8_MIN  SCHAR_MIN
-#define INT_FAST8_MAX  SCHAR_MAX
-#define UINT_FAST8_MAX  UCHAR_MAX
+# undef INT_FAST8_MIN
+# undef INT_FAST8_MAX
+# undef UINT_FAST8_MAX
+# define INT_FAST8_MIN  SCHAR_MIN
+# define INT_FAST8_MAX  SCHAR_MAX
+# define UINT_FAST8_MAX  UCHAR_MAX
 
-#undef INT_FAST16_MIN
-#undef INT_FAST16_MAX
-#undef UINT_FAST16_MAX
-#define INT_FAST16_MIN  INT_FAST32_MIN
-#define INT_FAST16_MAX  INT_FAST32_MAX
-#define UINT_FAST16_MAX  UINT_FAST32_MAX
+# undef INT_FAST16_MIN
+# undef INT_FAST16_MAX
+# undef UINT_FAST16_MAX
+# define INT_FAST16_MIN  INT_FAST32_MIN
+# define INT_FAST16_MAX  INT_FAST32_MAX
+# define UINT_FAST16_MAX  UINT_FAST32_MAX
 
-#undef INT_FAST32_MIN
-#undef INT_FAST32_MAX
-#undef UINT_FAST32_MAX
-#ifdef __sun
-# define INT_FAST32_MIN  INT_MIN
-# define INT_FAST32_MAX  INT_MAX
-# define UINT_FAST32_MAX  UINT_MAX
-#else
-# define INT_FAST32_MIN  LONG_MIN
-# define INT_FAST32_MAX  LONG_MAX
-# define UINT_FAST32_MAX  ULONG_MAX
-#endif
+# undef INT_FAST32_MIN
+# undef INT_FAST32_MAX
+# undef UINT_FAST32_MAX
+# ifdef __sun
+#  define INT_FAST32_MIN  INT_MIN
+#  define INT_FAST32_MAX  INT_MAX
+#  define UINT_FAST32_MAX  UINT_MAX
+# else
+#  define INT_FAST32_MIN  LONG_MIN
+#  define INT_FAST32_MAX  LONG_MAX
+#  define UINT_FAST32_MAX  ULONG_MAX
+# endif
 
-#undef INT_FAST64_MIN
-#undef INT_FAST64_MAX
-#ifdef GL_INT64_T
-# define INT_FAST64_MIN  INT64_MIN
-# define INT_FAST64_MAX  INT64_MAX
-#endif
+# undef INT_FAST64_MIN
+# undef INT_FAST64_MAX
+# ifdef GL_INT64_T
+#  define INT_FAST64_MIN  INT64_MIN
+#  define INT_FAST64_MAX  INT64_MAX
+# endif
 
-#undef UINT_FAST64_MAX
-#ifdef GL_UINT64_T
-# define UINT_FAST64_MAX  UINT64_MAX
-#endif
+# undef UINT_FAST64_MAX
+# ifdef GL_UINT64_T
+#  define UINT_FAST64_MAX  UINT64_MAX
+# endif
 
 /* 7.18.2.4. Limits of integer types capable of holding object pointers */
 
-#undef INTPTR_MIN
-#undef INTPTR_MAX
-#undef UINTPTR_MAX
-#define INTPTR_MIN  LONG_MIN
-#define INTPTR_MAX  LONG_MAX
-#define UINTPTR_MAX  ULONG_MAX
+# undef INTPTR_MIN
+# undef INTPTR_MAX
+# undef UINTPTR_MAX
+# define INTPTR_MIN  LONG_MIN
+# define INTPTR_MAX  LONG_MAX
+# define UINTPTR_MAX  ULONG_MAX
 
 /* 7.18.2.5. Limits of greatest-width integer types */
 
-#ifndef INTMAX_MAX
-# undef INTMAX_MIN
-# ifdef INT64_MAX
-#  define INTMAX_MIN  INT64_MIN
-#  define INTMAX_MAX  INT64_MAX
-# else
-#  define INTMAX_MIN  INT32_MIN
-#  define INTMAX_MAX  INT32_MAX
+# ifndef INTMAX_MAX
+#  undef INTMAX_MIN
+#  ifdef INT64_MAX
+#   define INTMAX_MIN  INT64_MIN
+#   define INTMAX_MAX  INT64_MAX
+#  else
+#   define INTMAX_MIN  INT32_MIN
+#   define INTMAX_MAX  INT32_MAX
+#  endif
 # endif
-#endif
 
-#ifndef UINTMAX_MAX
-# ifdef UINT64_MAX
-#  define UINTMAX_MAX  UINT64_MAX
-# else
-#  define UINTMAX_MAX  UINT32_MAX
+# ifndef UINTMAX_MAX
+#  ifdef UINT64_MAX
+#   define UINTMAX_MAX  UINT64_MAX
+#  else
+#   define UINTMAX_MAX  UINT32_MAX
+#  endif
 # endif
-#endif
 
 /* 7.18.3. Limits of other integer types */
 
 /* ptrdiff_t limits */
-#undef PTRDIFF_MIN
-#undef PTRDIFF_MAX
-#if @APPLE_UNIVERSAL_BUILD@
-# ifdef _LP64
-#  define PTRDIFF_MIN  _STDINT_MIN (1, 64, 0l)
-#  define PTRDIFF_MAX  _STDINT_MAX (1, 64, 0l)
+# undef PTRDIFF_MIN
+# undef PTRDIFF_MAX
+# if @APPLE_UNIVERSAL_BUILD@
+#  ifdef _LP64
+#   define PTRDIFF_MIN  _STDINT_SIGNED_MIN (64, 0l)
+#   define PTRDIFF_MAX  _STDINT_MAX (1, 64, 0l)
+#  else
+#   define PTRDIFF_MIN  _STDINT_SIGNED_MIN (32, 0)
+#   define PTRDIFF_MAX  _STDINT_MAX (1, 32, 0)
+#  endif
 # else
-#  define PTRDIFF_MIN  _STDINT_MIN (1, 32, 0)
-#  define PTRDIFF_MAX  _STDINT_MAX (1, 32, 0)
+#  define PTRDIFF_MIN  \
+    _STDINT_SIGNED_MIN (@BITSIZEOF_PTRDIFF_T@, address@hidden@)
+#  define PTRDIFF_MAX  \
+    _STDINT_MAX (1, @BITSIZEOF_PTRDIFF_T@, address@hidden@)
 # endif
-#else
-# define PTRDIFF_MIN  \
-    _STDINT_MIN (1, @BITSIZEOF_PTRDIFF_T@, address@hidden@)
-# define PTRDIFF_MAX  \
-    _STDINT_MAX (1, @BITSIZEOF_PTRDIFF_T@, address@hidden@)
-#endif
 
 /* sig_atomic_t limits */
-#undef SIG_ATOMIC_MIN
-#undef SIG_ATOMIC_MAX
-#define SIG_ATOMIC_MIN  \
-   _STDINT_MIN (@HAVE_SIGNED_SIG_ATOMIC_T@, @BITSIZEOF_SIG_ATOMIC_T@, \
-                address@hidden@)
-#define SIG_ATOMIC_MAX  \
+# undef SIG_ATOMIC_MIN
+# undef SIG_ATOMIC_MAX
+# if @HAVE_SIGNED_SIG_ATOMIC_T@
+#  define SIG_ATOMIC_MIN  \
+    _STDINT_SIGNED_MIN (@BITSIZEOF_SIG_ATOMIC_T@, address@hidden@)
+# else
+#  define SIG_ATOMIC_MIN  \
+    _STDINT_UNSIGNED_MIN (@BITSIZEOF_SIG_ATOMIC_T@, address@hidden@)
+# endif
+# define SIG_ATOMIC_MAX  \
    _STDINT_MAX (@HAVE_SIGNED_SIG_ATOMIC_T@, @BITSIZEOF_SIG_ATOMIC_T@, \
                 address@hidden@)
 
 
 /* size_t limit */
-#undef SIZE_MAX
-#if @APPLE_UNIVERSAL_BUILD@
-# ifdef _LP64
-#  define SIZE_MAX  _STDINT_MAX (0, 64, 0ul)
+# undef SIZE_MAX
+# if @APPLE_UNIVERSAL_BUILD@
+#  ifdef _LP64
+#   define SIZE_MAX  _STDINT_MAX (0, 64, 0ul)
+#  else
+#   define SIZE_MAX  _STDINT_MAX (0, 32, 0ul)
+#  endif
 # else
-#  define SIZE_MAX  _STDINT_MAX (0, 32, 0ul)
+#  define SIZE_MAX  _STDINT_MAX (0, @BITSIZEOF_SIZE_T@, address@hidden@)
 # endif
-#else
-# define SIZE_MAX  _STDINT_MAX (0, @BITSIZEOF_SIZE_T@, address@hidden@)
-#endif
 
 /* wchar_t limits */
 /* Get WCHAR_MIN, WCHAR_MAX.
@@ -543,29 +563,39 @@
    sequence of nested includes
    <wchar.h> -> <stdio.h> -> <getopt.h> -> <stdlib.h>, and the latter includes
    <stdint.h> and assumes its types are already defined.  */
-#if @HAVE_WCHAR_H@ && ! (defined WCHAR_MIN && defined WCHAR_MAX)
+# if @HAVE_WCHAR_H@ && ! (defined WCHAR_MIN && defined WCHAR_MAX)
   /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
      included before <wchar.h>.  */
-# include <stddef.h>
-# include <stdio.h>
-# include <time.h>
-# define _GL_JUST_INCLUDE_SYSTEM_WCHAR_H
-# include <wchar.h>
-# undef _GL_JUST_INCLUDE_SYSTEM_WCHAR_H
-#endif
-#undef WCHAR_MIN
-#undef WCHAR_MAX
-#define WCHAR_MIN  \
-   _STDINT_MIN (@HAVE_SIGNED_WCHAR_T@, @BITSIZEOF_WCHAR_T@, address@hidden@)
-#define WCHAR_MAX  \
+#  include <stddef.h>
+#  include <stdio.h>
+#  include <time.h>
+#  define _GL_JUST_INCLUDE_SYSTEM_WCHAR_H
+#  include <wchar.h>
+#  undef _GL_JUST_INCLUDE_SYSTEM_WCHAR_H
+# endif
+# undef WCHAR_MIN
+# undef WCHAR_MAX
+# if @HAVE_SIGNED_WCHAR_T@
+#  define WCHAR_MIN  \
+    _STDINT_SIGNED_MIN (@BITSIZEOF_WCHAR_T@, address@hidden@)
+# else
+#  define WCHAR_MIN  \
+    _STDINT_UNSIGNED_MIN (@BITSIZEOF_WCHAR_T@, address@hidden@)
+# endif
+# define WCHAR_MAX  \
    _STDINT_MAX (@HAVE_SIGNED_WCHAR_T@, @BITSIZEOF_WCHAR_T@, address@hidden@)
 
 /* wint_t limits */
-#undef WINT_MIN
-#undef WINT_MAX
-#define WINT_MIN  \
-   _STDINT_MIN (@HAVE_SIGNED_WINT_T@, @BITSIZEOF_WINT_T@, address@hidden@)
-#define WINT_MAX  \
+# undef WINT_MIN
+# undef WINT_MAX
+# if @HAVE_SIGNED_WINT_T@
+#  define WINT_MIN  \
+    _STDINT_SIGNED_MIN (@BITSIZEOF_WINT_T@, address@hidden@)
+# else
+#  define WINT_MIN  \
+    _STDINT_UNSIGNED_MIN (@BITSIZEOF_WINT_T@, address@hidden@)
+# endif
+# define WINT_MAX  \
    _STDINT_MAX (@HAVE_SIGNED_WINT_T@, @BITSIZEOF_WINT_T@, address@hidden@)
 
 /* 7.18.4. Macros for integer constants */
@@ -576,60 +606,121 @@
 /* Here we assume a standard architecture where the hardware integer
    types have 8, 16, 32, optionally 64 bits, and int is 32 bits.  */
 
-#undef INT8_C
-#undef UINT8_C
-#define INT8_C(x) x
-#define UINT8_C(x) x
+# undef INT8_C
+# undef UINT8_C
+# define INT8_C(x) x
+# define UINT8_C(x) x
 
-#undef INT16_C
-#undef UINT16_C
-#define INT16_C(x) x
-#define UINT16_C(x) x
+# undef INT16_C
+# undef UINT16_C
+# define INT16_C(x) x
+# define UINT16_C(x) x
 
-#undef INT32_C
-#undef UINT32_C
-#define INT32_C(x) x
-#define UINT32_C(x) x ## U
+# undef INT32_C
+# undef UINT32_C
+# define INT32_C(x) x
+# define UINT32_C(x) x ## U
 
-#undef INT64_C
-#undef UINT64_C
-#if LONG_MAX >> 31 >> 31 == 1
-# define INT64_C(x) x##L
-#elif defined _MSC_VER
-# define INT64_C(x) x##i64
-#elif @HAVE_LONG_LONG_INT@
-# define INT64_C(x) x##LL
-#endif
-#if ULONG_MAX >> 31 >> 31 >> 1 == 1
-# define UINT64_C(x) x##UL
-#elif defined _MSC_VER
-# define UINT64_C(x) x##ui64
-#elif @HAVE_UNSIGNED_LONG_LONG_INT@
-# define UINT64_C(x) x##ULL
-#endif
+# undef INT64_C
+# undef UINT64_C
+# if LONG_MAX >> 31 >> 31 == 1
+#  define INT64_C(x) x##L
+# elif defined _MSC_VER
+#  define INT64_C(x) x##i64
+# elif @HAVE_LONG_LONG_INT@
+#  define INT64_C(x) x##LL
+# endif
+# if ULONG_MAX >> 31 >> 31 >> 1 == 1
+#  define UINT64_C(x) x##UL
+# elif defined _MSC_VER
+#  define UINT64_C(x) x##ui64
+# elif @HAVE_UNSIGNED_LONG_LONG_INT@
+#  define UINT64_C(x) x##ULL
+# endif
 
 /* 7.18.4.2. Macros for greatest-width integer constants */
 
-#ifndef INTMAX_C
-# if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1
-#  define INTMAX_C(x)   x##LL
-# elif defined GL_INT64_T
-#  define INTMAX_C(x)   INT64_C(x)
-# else
-#  define INTMAX_C(x)   x##L
+# ifndef INTMAX_C
+#  if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1
+#   define INTMAX_C(x)   x##LL
+#  elif defined GL_INT64_T
+#   define INTMAX_C(x)   INT64_C(x)
+#  else
+#   define INTMAX_C(x)   x##L
+#  endif
 # endif
-#endif
 
-#ifndef UINTMAX_C
-# if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1
-#  define UINTMAX_C(x)  x##ULL
-# elif defined GL_UINT64_T
-#  define UINTMAX_C(x)  UINT64_C(x)
-# else
-#  define UINTMAX_C(x)  x##UL
+# ifndef UINTMAX_C
+#  if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1
+#   define UINTMAX_C(x)  x##ULL
+#  elif defined GL_UINT64_T
+#   define UINTMAX_C(x)  UINT64_C(x)
+#  else
+#   define UINTMAX_C(x)  x##UL
+#  endif
 # endif
-#endif
 
+#endif /* address@hidden@ */
+
+/* Macros specified by ISO/IEC TS 18661-1:2014.  */
+
+#if (!defined UINTMAX_WIDTH \
+     && (defined _GNU_SOURCE || defined __STDC_WANT_IEC_60559_BFP_EXT__))
+# ifdef INT8_MAX
+#  define INT8_WIDTH _GL_INTEGER_WIDTH (INT8_MIN, INT8_MAX)
+# endif
+# ifdef UINT8_MAX
+#  define UINT8_WIDTH _GL_INTEGER_WIDTH (0, UINT8_MAX)
+# endif
+# ifdef INT16_MAX
+#  define INT16_WIDTH _GL_INTEGER_WIDTH (INT16_MIN, INT16_MAX)
+# endif
+# ifdef UINT16_MAX
+#  define UINT16_WIDTH _GL_INTEGER_WIDTH (0, UINT16_MAX)
+# endif
+# ifdef INT32_MAX
+#  define INT32_WIDTH _GL_INTEGER_WIDTH (INT32_MIN, INT32_MAX)
+# endif
+# ifdef UINT32_MAX
+#  define UINT32_WIDTH _GL_INTEGER_WIDTH (0, UINT32_MAX)
+# endif
+# ifdef INT64_MAX
+#  define INT64_WIDTH _GL_INTEGER_WIDTH (INT64_MIN, INT64_MAX)
+# endif
+# ifdef UINT64_MAX
+#  define UINT64_WIDTH _GL_INTEGER_WIDTH (0, UINT64_MAX)
+# endif
+# define INT_LEAST8_WIDTH _GL_INTEGER_WIDTH (INT_LEAST8_MIN, INT_LEAST8_MAX)
+# define UINT_LEAST8_WIDTH _GL_INTEGER_WIDTH (0, UINT_LEAST8_MAX)
+# define INT_LEAST16_WIDTH _GL_INTEGER_WIDTH (INT_LEAST16_MIN, INT_LEAST16_MAX)
+# define UINT_LEAST16_WIDTH _GL_INTEGER_WIDTH (0, UINT_LEAST16_MAX)
+# define INT_LEAST32_WIDTH _GL_INTEGER_WIDTH (INT_LEAST32_MIN, INT_LEAST32_MAX)
+# define UINT_LEAST32_WIDTH _GL_INTEGER_WIDTH (0, UINT_LEAST32_MAX)
+# define INT_LEAST64_WIDTH _GL_INTEGER_WIDTH (INT_LEAST64_MIN, INT_LEAST64_MAX)
+# define UINT_LEAST64_WIDTH _GL_INTEGER_WIDTH (0, UINT_LEAST64_MAX)
+# define INT_FAST8_WIDTH _GL_INTEGER_WIDTH (INT_FAST8_MIN, INT_FAST8_MAX)
+# define UINT_FAST8_WIDTH _GL_INTEGER_WIDTH (0, UINT_FAST8_MAX)
+# define INT_FAST16_WIDTH _GL_INTEGER_WIDTH (INT_FAST16_MIN, INT_FAST16_MAX)
+# define UINT_FAST16_WIDTH _GL_INTEGER_WIDTH (0, UINT_FAST16_MAX)
+# define INT_FAST32_WIDTH _GL_INTEGER_WIDTH (INT_FAST32_MIN, INT_FAST32_MAX)
+# define UINT_FAST32_WIDTH _GL_INTEGER_WIDTH (0, UINT_FAST32_MAX)
+# define INT_FAST64_WIDTH _GL_INTEGER_WIDTH (INT_FAST64_MIN, INT_FAST64_MAX)
+# define UINT_FAST64_WIDTH _GL_INTEGER_WIDTH (0, UINT_FAST64_MAX)
+# define INTPTR_WIDTH _GL_INTEGER_WIDTH (INTPTR_MIN, INTPTR_MAX)
+# define UINTPTR_WIDTH _GL_INTEGER_WIDTH (0, UINTPTR_MAX)
+# define INTMAX_WIDTH _GL_INTEGER_WIDTH (INTMAX_MIN, INTMAX_MAX)
+# define UINTMAX_WIDTH _GL_INTEGER_WIDTH (0, UINTMAX_MAX)
+# define PTRDIFF_WIDTH _GL_INTEGER_WIDTH (PTRDIFF_MIN, PTRDIFF_MAX)
+# define SIZE_WIDTH _GL_INTEGER_WIDTH (0, SIZE_MAX)
+# define WCHAR_WIDTH _GL_INTEGER_WIDTH (WCHAR_MIN, WCHAR_MAX)
+# ifdef WINT_MAX
+#  define WINT_WIDTH _GL_INTEGER_WIDTH (WINT_MIN, WINT_MAX)
+# endif
+# ifdef SIG_ATOMIC_MAX
+#  define SIG_ATOMIC_WIDTH _GL_INTEGER_WIDTH (SIG_ATOMIC_MIN, SIG_ATOMIC_MAX)
+# endif
+#endif /* !WINT_WIDTH && (_GNU_SOURCE || __STDC_WANT_IEC_60559_BFP_EXT__) */
+
 #endif /* address@hidden@_STDINT_H */
 #endif /* !(defined __ANDROID__ && ...) */
 #endif /* !defined address@hidden@_STDINT_H && !defined 
_GL_JUST_INCLUDE_SYSTEM_STDINT_H */

Modified: trunk/tp/Texinfo/Convert/XSParagraph/lib/stdio.in.h
===================================================================
--- trunk/tp/Texinfo/Convert/XSParagraph/lib/stdio.in.h 2017-04-14 16:36:56 UTC 
(rev 7725)
+++ trunk/tp/Texinfo/Convert/XSParagraph/lib/stdio.in.h 2017-04-14 17:20:48 UTC 
(rev 7726)
@@ -1,6 +1,6 @@
 /* A GNU-like <stdio.h>.
 
-   Copyright (C) 2004, 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2007-2017 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
@@ -118,7 +118,27 @@
 # include <unistd.h>
 #endif
 
+/* MSVC declares 'perror' in <stdlib.h>, not in <stdio.h>.  We must include
+   it before we  #define perror rpl_perror.  */
+/* But in any case avoid namespace pollution on glibc systems.  */
+#if (@GNULIB_PERROR@ || defined GNULIB_POSIXCHECK) \
+    && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) \
+    && ! defined __GLIBC__
+# include <stdlib.h>
+#endif
 
+/* MSVC declares 'remove' in <io.h>, not in <stdio.h>.  We must include
+   it before we  #define remove rpl_remove.  */
+/* MSVC declares 'rename' in <io.h>, not in <stdio.h>.  We must include
+   it before we  #define rename rpl_rename.  */
+/* But in any case avoid namespace pollution on glibc systems.  */
+#if (@GNULIB_REMOVE@ || @GNULIB_RENAME@ || defined GNULIB_POSIXCHECK) \
+    && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) \
+    && ! defined __GLIBC__
+# include <io.h>
+#endif
+
+
 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
 
 /* The definition of _GL_ARG_NONNULL is copied here.  */

Modified: trunk/tp/Texinfo/Convert/XSParagraph/lib/string.in.h
===================================================================
--- trunk/tp/Texinfo/Convert/XSParagraph/lib/string.in.h        2017-04-14 
16:36:56 UTC (rev 7725)
+++ trunk/tp/Texinfo/Convert/XSParagraph/lib/string.in.h        2017-04-14 
17:20:48 UTC (rev 7726)
@@ -1,6 +1,6 @@
 /* A GNU-like <string.h>.
 
-   Copyright (C) 1995-1996, 2001-2016 Free Software Foundation, Inc.
+   Copyright (C) 1995-1996, 2001-2017 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

Modified: trunk/tp/Texinfo/Convert/XSParagraph/lib/sys_types.in.h
===================================================================
--- trunk/tp/Texinfo/Convert/XSParagraph/lib/sys_types.in.h     2017-04-14 
16:36:56 UTC (rev 7725)
+++ trunk/tp/Texinfo/Convert/XSParagraph/lib/sys_types.in.h     2017-04-14 
17:20:48 UTC (rev 7726)
@@ -1,6 +1,6 @@
 /* Provide a more complete sys/types.h.
 
-   Copyright (C) 2011-2016 Free Software Foundation, Inc.
+   Copyright (C) 2011-2017 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

Modified: trunk/tp/Texinfo/Convert/XSParagraph/lib/vasnprintf.c
===================================================================
--- trunk/tp/Texinfo/Convert/XSParagraph/lib/vasnprintf.c       2017-04-14 
16:36:56 UTC (rev 7725)
+++ trunk/tp/Texinfo/Convert/XSParagraph/lib/vasnprintf.c       2017-04-14 
17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 /* vsprintf with automatic memory allocation.
-   Copyright (C) 1999, 2002-2016 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2002-2017 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
@@ -4832,9 +4832,9 @@
                     break;
 # else
                     *fbp++ = 'l';
-                    /*FALLTHROUGH*/
 # endif
 #endif
+                    /*FALLTHROUGH*/
                   case TYPE_LONGINT:
                   case TYPE_ULONGINT:
 #if HAVE_WINT_T

Modified: trunk/tp/Texinfo/Convert/XSParagraph/lib/vasnprintf.h
===================================================================
--- trunk/tp/Texinfo/Convert/XSParagraph/lib/vasnprintf.h       2017-04-14 
16:36:56 UTC (rev 7725)
+++ trunk/tp/Texinfo/Convert/XSParagraph/lib/vasnprintf.h       2017-04-14 
17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 /* vsprintf with automatic memory allocation.
-   Copyright (C) 2002-2004, 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2002-2004, 2007-2017 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

Modified: trunk/tp/Texinfo/Convert/XSParagraph/lib/vasprintf.c
===================================================================
--- trunk/tp/Texinfo/Convert/XSParagraph/lib/vasprintf.c        2017-04-14 
16:36:56 UTC (rev 7725)
+++ trunk/tp/Texinfo/Convert/XSParagraph/lib/vasprintf.c        2017-04-14 
17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 /* Formatted output to strings.
-   Copyright (C) 1999, 2002, 2006-2016 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2002, 2006-2017 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

Modified: trunk/tp/Texinfo/Convert/XSParagraph/lib/verify.h
===================================================================
--- trunk/tp/Texinfo/Convert/XSParagraph/lib/verify.h   2017-04-14 16:36:56 UTC 
(rev 7725)
+++ trunk/tp/Texinfo/Convert/XSParagraph/lib/verify.h   2017-04-14 17:20:48 UTC 
(rev 7726)
@@ -1,6 +1,6 @@
 /* Compile-time assert-like macros.
 
-   Copyright (C) 2005-2006, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2005-2006, 2009-2017 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
@@ -248,7 +248,12 @@
 /* Verify requirement R at compile-time, as a declaration without a
    trailing ';'.  */
 
-#define verify(R) _GL_VERIFY (R, "verify (" #R ")")
+#ifdef __GNUC__
+# define verify(R) _GL_VERIFY (R, "verify (" #R ")")
+#else
+/* PGI barfs if R is long.  Play it safe.  */
+# define verify(R) _GL_VERIFY (R, "verify (...)")
+#endif
 
 #ifndef __has_builtin
 # define __has_builtin(x) 0

Modified: trunk/tp/Texinfo/Convert/XSParagraph/lib/wchar.in.h
===================================================================
--- trunk/tp/Texinfo/Convert/XSParagraph/lib/wchar.in.h 2017-04-14 16:36:56 UTC 
(rev 7725)
+++ trunk/tp/Texinfo/Convert/XSParagraph/lib/wchar.in.h 2017-04-14 17:20:48 UTC 
(rev 7726)
@@ -1,6 +1,6 @@
 /* A substitute for ISO C99 <wchar.h>, for platforms that have issues.
 
-   Copyright (C) 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007-2017 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -35,6 +35,7 @@
      || (defined __hpux                                                 \
          && ((defined _INTTYPES_INCLUDED && !defined strtoimax)         \
              || defined _GL_JUST_INCLUDE_SYSTEM_WCHAR_H))               \
+     || (defined __MINGW32__ && defined __STRING_H_SOURCED__)           \
      || defined _GL_ALREADY_INCLUDING_WCHAR_H)
 /* Special invocation convention:
    - Inside glibc and uClibc header files, but not MinGW.
@@ -44,6 +45,8 @@
      and once directly.  In both situations 'wint_t' is not yet defined,
      therefore we cannot provide the function overrides; instead include only
      the system's <wchar.h>.
+   - With MinGW 3.22, when <string.h> includes <wchar.h>, only some part of
+     <wchar.h> is actually processed, and that doesn't include 'mbstate_t'.
    - On IRIX 6.5, similarly, we have an include <wchar.h> -> <wctype.h>, and
      the latter includes <wchar.h>.  But here, we have no way to detect whether
      <wctype.h> is completely included or is still being included.  */
@@ -110,10 +113,10 @@
 #  define WEOF -1
 # endif
 #else
-/* MSVC defines wint_t as 'unsigned short' in <crtdefs.h>.
+/* mingw and MSVC define wint_t as 'unsigned short' in <crtdefs.h>.
    This is too small: ISO C 99 section 7.24.1.(2) says that wint_t must be
    "unchanged by default argument promotions".  Override it.  */
-# if defined _MSC_VER
+# if @GNULIB_OVERRIDES_WINT_T@
 #  if !GNULIB_defined_wint_t
 #   include <crtdefs.h>
 typedef unsigned int rpl_wint_t;

Modified: trunk/tp/Texinfo/Convert/XSParagraph/lib/xsize.h
===================================================================
--- trunk/tp/Texinfo/Convert/XSParagraph/lib/xsize.h    2017-04-14 16:36:56 UTC 
(rev 7725)
+++ trunk/tp/Texinfo/Convert/XSParagraph/lib/xsize.h    2017-04-14 17:20:48 UTC 
(rev 7726)
@@ -1,6 +1,6 @@
 /* xsize.h -- Checked size_t computations.
 
-   Copyright (C) 2003, 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2008-2017 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

Modified: trunk/tp/Texinfo/Convert/XSParagraph/m4/00gnulib.m4
===================================================================
--- trunk/tp/Texinfo/Convert/XSParagraph/m4/00gnulib.m4 2017-04-14 16:36:56 UTC 
(rev 7725)
+++ trunk/tp/Texinfo/Convert/XSParagraph/m4/00gnulib.m4 2017-04-14 17:20:48 UTC 
(rev 7726)
@@ -1,5 +1,5 @@
 # 00gnulib.m4 serial 3
-dnl Copyright (C) 2009-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2009-2017 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.

Modified: trunk/tp/Texinfo/Convert/XSParagraph/m4/absolute-header.m4
===================================================================
--- trunk/tp/Texinfo/Convert/XSParagraph/m4/absolute-header.m4  2017-04-14 
16:36:56 UTC (rev 7725)
+++ trunk/tp/Texinfo/Convert/XSParagraph/m4/absolute-header.m4  2017-04-14 
17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 # absolute-header.m4 serial 16
-dnl Copyright (C) 2006-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2006-2017 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.

Modified: trunk/tp/Texinfo/Convert/XSParagraph/m4/alloca.m4
===================================================================
--- trunk/tp/Texinfo/Convert/XSParagraph/m4/alloca.m4   2017-04-14 16:36:56 UTC 
(rev 7725)
+++ trunk/tp/Texinfo/Convert/XSParagraph/m4/alloca.m4   2017-04-14 17:20:48 UTC 
(rev 7726)
@@ -1,5 +1,5 @@
 # alloca.m4 serial 14
-dnl Copyright (C) 2002-2004, 2006-2007, 2009-2016 Free Software Foundation,
+dnl Copyright (C) 2002-2004, 2006-2007, 2009-2017 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,

Modified: trunk/tp/Texinfo/Convert/XSParagraph/m4/errno_h.m4
===================================================================
--- trunk/tp/Texinfo/Convert/XSParagraph/m4/errno_h.m4  2017-04-14 16:36:56 UTC 
(rev 7725)
+++ trunk/tp/Texinfo/Convert/XSParagraph/m4/errno_h.m4  2017-04-14 17:20:48 UTC 
(rev 7726)
@@ -1,5 +1,5 @@
 # errno_h.m4 serial 12
-dnl Copyright (C) 2004, 2006, 2008-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2004, 2006, 2008-2017 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.

Modified: trunk/tp/Texinfo/Convert/XSParagraph/m4/exponentd.m4
===================================================================
--- trunk/tp/Texinfo/Convert/XSParagraph/m4/exponentd.m4        2017-04-14 
16:36:56 UTC (rev 7725)
+++ trunk/tp/Texinfo/Convert/XSParagraph/m4/exponentd.m4        2017-04-14 
17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 # exponentd.m4 serial 3
-dnl Copyright (C) 2007-2008, 2010-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2007-2008, 2010-2017 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.

Modified: trunk/tp/Texinfo/Convert/XSParagraph/m4/extensions.m4
===================================================================
--- trunk/tp/Texinfo/Convert/XSParagraph/m4/extensions.m4       2017-04-14 
16:36:56 UTC (rev 7725)
+++ trunk/tp/Texinfo/Convert/XSParagraph/m4/extensions.m4       2017-04-14 
17:20:48 UTC (rev 7726)
@@ -1,7 +1,7 @@
-# serial 13  -*- Autoconf -*-
+# serial 15  -*- Autoconf -*-
 # Enable extensions on systems that normally disable them.
 
-# Copyright (C) 2003, 2006-2016 Free Software Foundation, Inc.
+# Copyright (C) 2003, 2006-2017 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.
@@ -60,7 +60,7 @@
 #ifndef _ALL_SOURCE
 # undef _ALL_SOURCE
 #endif
-/* Enable general extensions on OS X.  */
+/* Enable general extensions on macOS.  */
 #ifndef _DARWIN_C_SOURCE
 # undef _DARWIN_C_SOURCE
 #endif
@@ -68,14 +68,38 @@
 #ifndef _GNU_SOURCE
 # undef _GNU_SOURCE
 #endif
-/* Use GNU style printf and scanf.  */
-#ifndef __USE_MINGW_ANSI_STDIO
-# undef __USE_MINGW_ANSI_STDIO
-#endif
 /* Enable threading extensions on Solaris.  */
 #ifndef _POSIX_PTHREAD_SEMANTICS
 # undef _POSIX_PTHREAD_SEMANTICS
 #endif
+/* Enable extensions specified by ISO/IEC TS 18661-5:2014.  */
+#ifndef __STDC_WANT_IEC_60559_ATTRIBS_EXT__
+# undef __STDC_WANT_IEC_60559_ATTRIBS_EXT__
+#endif
+/* Enable extensions specified by ISO/IEC TS 18661-1:2014.  */
+#ifndef __STDC_WANT_IEC_60559_BFP_EXT__
+# undef __STDC_WANT_IEC_60559_BFP_EXT__
+#endif
+/* Enable extensions specified by ISO/IEC TS 18661-2:2015.  */
+#ifndef __STDC_WANT_IEC_60559_DFP_EXT__
+# undef __STDC_WANT_IEC_60559_DFP_EXT__
+#endif
+/* Enable extensions specified by ISO/IEC TS 18661-4:2015.  */
+#ifndef __STDC_WANT_IEC_60559_FUNCS_EXT__
+# undef __STDC_WANT_IEC_60559_FUNCS_EXT__
+#endif
+/* Enable extensions specified by ISO/IEC TS 18661-3:2015.  */
+#ifndef __STDC_WANT_IEC_60559_TYPES_EXT__
+# undef __STDC_WANT_IEC_60559_TYPES_EXT__
+#endif
+/* Enable extensions specified by ISO/IEC TR 24731-2:2010.  */
+#ifndef __STDC_WANT_LIB_EXT2__
+# undef __STDC_WANT_LIB_EXT2__
+#endif
+/* Enable extensions specified by ISO/IEC 24747:2009.  */
+#ifndef __STDC_WANT_MATH_SPEC_FUNCS__
+# undef __STDC_WANT_MATH_SPEC_FUNCS__
+#endif
 /* Enable extensions on HP NonStop.  */
 #ifndef _TANDEM_SOURCE
 # undef _TANDEM_SOURCE
@@ -104,8 +128,14 @@
   AC_DEFINE([_ALL_SOURCE])
   AC_DEFINE([_DARWIN_C_SOURCE])
   AC_DEFINE([_GNU_SOURCE])
-  AC_DEFINE([__USE_MINGW_ANSI_STDIO])
   AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
+  AC_DEFINE([__STDC_WANT_IEC_60559_ATTRIBS_EXT__])
+  AC_DEFINE([__STDC_WANT_IEC_60559_BFP_EXT__])
+  AC_DEFINE([__STDC_WANT_IEC_60559_DFP_EXT__])
+  AC_DEFINE([__STDC_WANT_IEC_60559_FUNCS_EXT__])
+  AC_DEFINE([__STDC_WANT_IEC_60559_TYPES_EXT__])
+  AC_DEFINE([__STDC_WANT_LIB_EXT2__])
+  AC_DEFINE([__STDC_WANT_MATH_SPEC_FUNCS__])
   AC_DEFINE([_TANDEM_SOURCE])
   AC_CACHE_CHECK([whether _XOPEN_SOURCE should be defined],
     [ac_cv_should_define__xopen_source],

Modified: trunk/tp/Texinfo/Convert/XSParagraph/m4/extern-inline.m4
===================================================================
--- trunk/tp/Texinfo/Convert/XSParagraph/m4/extern-inline.m4    2017-04-14 
16:36:56 UTC (rev 7725)
+++ trunk/tp/Texinfo/Convert/XSParagraph/m4/extern-inline.m4    2017-04-14 
17:20:48 UTC (rev 7726)
@@ -1,6 +1,6 @@
 dnl 'extern inline' a la ISO C99.
 
-dnl Copyright 2012-2016 Free Software Foundation, Inc.
+dnl Copyright 2012-2017 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.

Modified: trunk/tp/Texinfo/Convert/XSParagraph/m4/float_h.m4
===================================================================
--- trunk/tp/Texinfo/Convert/XSParagraph/m4/float_h.m4  2017-04-14 16:36:56 UTC 
(rev 7725)
+++ trunk/tp/Texinfo/Convert/XSParagraph/m4/float_h.m4  2017-04-14 17:20:48 UTC 
(rev 7726)
@@ -1,5 +1,5 @@
 # float_h.m4 serial 9
-dnl Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2007, 2009-2017 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.

Modified: trunk/tp/Texinfo/Convert/XSParagraph/m4/getdelim.m4
===================================================================
--- trunk/tp/Texinfo/Convert/XSParagraph/m4/getdelim.m4 2017-04-14 16:36:56 UTC 
(rev 7725)
+++ trunk/tp/Texinfo/Convert/XSParagraph/m4/getdelim.m4 2017-04-14 17:20:48 UTC 
(rev 7726)
@@ -1,6 +1,6 @@
 # getdelim.m4 serial 11
 
-dnl Copyright (C) 2005-2007, 2009-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2005-2007, 2009-2017 Free Software Foundation, Inc.
 dnl
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,

Modified: trunk/tp/Texinfo/Convert/XSParagraph/m4/getline.m4
===================================================================
--- trunk/tp/Texinfo/Convert/XSParagraph/m4/getline.m4  2017-04-14 16:36:56 UTC 
(rev 7725)
+++ trunk/tp/Texinfo/Convert/XSParagraph/m4/getline.m4  2017-04-14 17:20:48 UTC 
(rev 7726)
@@ -1,6 +1,6 @@
 # getline.m4 serial 27
 
-dnl Copyright (C) 1998-2003, 2005-2007, 2009-2016 Free Software Foundation,
+dnl Copyright (C) 1998-2003, 2005-2007, 2009-2017 Free Software Foundation,
 dnl Inc.
 dnl
 dnl This file is free software; the Free Software Foundation

Modified: trunk/tp/Texinfo/Convert/XSParagraph/m4/gnulib-cache.m4
===================================================================
--- trunk/tp/Texinfo/Convert/XSParagraph/m4/gnulib-cache.m4     2017-04-14 
16:36:56 UTC (rev 7725)
+++ trunk/tp/Texinfo/Convert/XSParagraph/m4/gnulib-cache.m4     2017-04-14 
17:20:48 UTC (rev 7726)
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2016 Free Software Foundation, Inc.
+# Copyright (C) 2002-2017 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

Modified: trunk/tp/Texinfo/Convert/XSParagraph/m4/gnulib-common.m4
===================================================================
--- trunk/tp/Texinfo/Convert/XSParagraph/m4/gnulib-common.m4    2017-04-14 
16:36:56 UTC (rev 7725)
+++ trunk/tp/Texinfo/Convert/XSParagraph/m4/gnulib-common.m4    2017-04-14 
17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
-# gnulib-common.m4 serial 36
-dnl Copyright (C) 2007-2016 Free Software Foundation, Inc.
+# gnulib-common.m4 serial 38
+dnl Copyright (C) 2007-2017 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.
@@ -256,7 +256,8 @@
   dnl library formats. In particular, the GNU binutils programs ar and ranlib
   dnl produce libraries that work only with gcc, not with cc.
   AC_REQUIRE([AC_PROG_CC])
-  AC_BEFORE([$0], [AM_PROG_AR])
+  dnl The '][' hides this use from 'aclocal'.
+  AC_BEFORE([$0], [A][M_PROG_AR])
   AC_CACHE_CHECK([for Minix Amsterdam compiler], [gl_cv_c_amsterdam_compiler],
     [
       AC_EGREP_CPP([Amsterdam],
@@ -288,7 +289,9 @@
     dnl __ACK__.  It may seem like its easier to avoid calling the macro here,
     dnl but we need to AC_SUBST both AR/ARFLAGS (thus those must have some good
     dnl default value and automake should usually know them).
-    m4_ifdef([AM_PROG_AR], [AM_PROG_AR], [:])
+    dnl
+    dnl The '][' hides this use from 'aclocal'.
+    m4_ifdef([A][M_PROG_AR], [A][M_PROG_AR], [:])
   fi
 
   dnl In case the code above has not helped with setting AR/ARFLAGS, use
@@ -456,7 +459,9 @@
      else
        ac_cv_path_SED=$SED
      fi
+    ])
  SED="$ac_cv_path_SED"
  AC_SUBST([SED])dnl
  rm -f conftest.sed
-])])])
+])
+])

Modified: trunk/tp/Texinfo/Convert/XSParagraph/m4/gnulib-comp.m4
===================================================================
--- trunk/tp/Texinfo/Convert/XSParagraph/m4/gnulib-comp.m4      2017-04-14 
16:36:56 UTC (rev 7725)
+++ trunk/tp/Texinfo/Convert/XSParagraph/m4/gnulib-comp.m4      2017-04-14 
17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 # DO NOT EDIT! GENERATED AUTOMATICALLY!
-# Copyright (C) 2002-2016 Free Software Foundation, Inc.
+# Copyright (C) 2002-2017 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
@@ -51,6 +51,7 @@
   # Code from module getdelim:
   # Code from module getline:
   # Code from module include_next:
+  # Code from module limits-h:
   # Code from module memchr:
   # Code from module multiarch:
   # Code from module size_max:
@@ -106,6 +107,7 @@
     gl_PREREQ_GETLINE
   fi
   gl_STDIO_MODULE_INDICATOR([getline])
+  gl_LIMITS_H
   gl_FUNC_MEMCHR
   if test $HAVE_MEMCHR = 0 || test $REPLACE_MEMCHR = 1; then
     AC_LIBOBJ([memchr])
@@ -265,12 +267,11 @@
 # This macro records the list of files which have been installed by
 # gnulib-tool and may be removed by future gnulib-tool invocations.
 AC_DEFUN([gl_FILE_LIST], [
-  build-aux/snippet/arg-nonnull.h
-  build-aux/snippet/c++defs.h
-  build-aux/snippet/warn-on-use.h
   lib/alloca.in.h
+  lib/arg-nonnull.h
   lib/asnprintf.c
   lib/asprintf.c
+  lib/c++defs.h
   lib/errno.in.h
   lib/float+.h
   lib/float.c
@@ -278,6 +279,7 @@
   lib/getdelim.c
   lib/getline.c
   lib/itold.c
+  lib/limits.in.h
   lib/memchr.c
   lib/memchr.valgrind
   lib/printf-args.c
@@ -294,6 +296,7 @@
   lib/vasnprintf.h
   lib/vasprintf.c
   lib/verify.h
+  lib/warn-on-use.h
   lib/wchar.in.h
   lib/xsize.c
   lib/xsize.h
@@ -311,6 +314,7 @@
   m4/include_next.m4
   m4/intmax_t.m4
   m4/inttypes_h.m4
+  m4/limits-h.m4
   m4/longlong.m4
   m4/math_h.m4
   m4/memchr.m4

Modified: trunk/tp/Texinfo/Convert/XSParagraph/m4/gnulib-tool.m4
===================================================================
--- trunk/tp/Texinfo/Convert/XSParagraph/m4/gnulib-tool.m4      2017-04-14 
16:36:56 UTC (rev 7725)
+++ trunk/tp/Texinfo/Convert/XSParagraph/m4/gnulib-tool.m4      2017-04-14 
17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 # gnulib-tool.m4 serial 2
-dnl Copyright (C) 2004-2005, 2009-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2004-2005, 2009-2017 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.

Modified: trunk/tp/Texinfo/Convert/XSParagraph/m4/include_next.m4
===================================================================
--- trunk/tp/Texinfo/Convert/XSParagraph/m4/include_next.m4     2017-04-14 
16:36:56 UTC (rev 7725)
+++ trunk/tp/Texinfo/Convert/XSParagraph/m4/include_next.m4     2017-04-14 
17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 # include_next.m4 serial 23
-dnl Copyright (C) 2006-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2006-2017 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.

Modified: trunk/tp/Texinfo/Convert/XSParagraph/m4/intmax_t.m4
===================================================================
--- trunk/tp/Texinfo/Convert/XSParagraph/m4/intmax_t.m4 2017-04-14 16:36:56 UTC 
(rev 7725)
+++ trunk/tp/Texinfo/Convert/XSParagraph/m4/intmax_t.m4 2017-04-14 17:20:48 UTC 
(rev 7726)
@@ -1,5 +1,5 @@
 # intmax_t.m4 serial 8
-dnl Copyright (C) 1997-2004, 2006-2007, 2009-2016 Free Software Foundation,
+dnl Copyright (C) 1997-2004, 2006-2007, 2009-2017 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,

Modified: trunk/tp/Texinfo/Convert/XSParagraph/m4/inttypes_h.m4
===================================================================
--- trunk/tp/Texinfo/Convert/XSParagraph/m4/inttypes_h.m4       2017-04-14 
16:36:56 UTC (rev 7725)
+++ trunk/tp/Texinfo/Convert/XSParagraph/m4/inttypes_h.m4       2017-04-14 
17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 # inttypes_h.m4 serial 10
-dnl Copyright (C) 1997-2004, 2006, 2008-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 1997-2004, 2006, 2008-2017 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.

Added: trunk/tp/Texinfo/Convert/XSParagraph/m4/limits-h.m4
===================================================================
--- trunk/tp/Texinfo/Convert/XSParagraph/m4/limits-h.m4                         
(rev 0)
+++ trunk/tp/Texinfo/Convert/XSParagraph/m4/limits-h.m4 2017-04-14 17:20:48 UTC 
(rev 7726)
@@ -0,0 +1,31 @@
+dnl Check whether limits.h has needed features.
+
+dnl Copyright 2016-2017 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Paul Eggert.
+
+AC_DEFUN_ONCE([gl_LIMITS_H],
+[
+  gl_CHECK_NEXT_HEADERS([limits.h])
+
+  AC_CACHE_CHECK([whether limits.h has ULLONG_WIDTH etc.],
+    [gl_cv_header_limits_width],
+    [AC_COMPILE_IFELSE(
+       [AC_LANG_PROGRAM([[#ifndef __STDC_WANT_IEC_60559_BFP_EXT__
+                           #define __STDC_WANT_IEC_60559_BFP_EXT__ 1
+                          #endif
+                          #include <limits.h>
+                          int ullw = ULLONG_WIDTH;]])],
+       [gl_cv_header_limits_width=yes],
+       [gl_cv_header_limits_width=no])])
+  if test "$gl_cv_header_limits_width" = yes; then
+    LIMITS_H=
+  else
+    LIMITS_H=limits.h
+  fi
+  AC_SUBST([LIMITS_H])
+  AM_CONDITIONAL([GL_GENERATE_LIMITS_H], [test -n "$LIMITS_H"])
+])

Modified: trunk/tp/Texinfo/Convert/XSParagraph/m4/longlong.m4
===================================================================
--- trunk/tp/Texinfo/Convert/XSParagraph/m4/longlong.m4 2017-04-14 16:36:56 UTC 
(rev 7725)
+++ trunk/tp/Texinfo/Convert/XSParagraph/m4/longlong.m4 2017-04-14 17:20:48 UTC 
(rev 7726)
@@ -1,5 +1,5 @@
 # longlong.m4 serial 17
-dnl Copyright (C) 1999-2007, 2009-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 1999-2007, 2009-2017 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.

Modified: trunk/tp/Texinfo/Convert/XSParagraph/m4/math_h.m4
===================================================================
--- trunk/tp/Texinfo/Convert/XSParagraph/m4/math_h.m4   2017-04-14 16:36:56 UTC 
(rev 7725)
+++ trunk/tp/Texinfo/Convert/XSParagraph/m4/math_h.m4   2017-04-14 17:20:48 UTC 
(rev 7726)
@@ -1,5 +1,5 @@
-# math_h.m4 serial 114
-dnl Copyright (C) 2007-2016 Free Software Foundation, Inc.
+# math_h.m4 serial 115
+dnl Copyright (C) 2007-2017 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.
@@ -256,11 +256,18 @@
   HAVE_DECL_TRUNC=1;           AC_SUBST([HAVE_DECL_TRUNC])
   HAVE_DECL_TRUNCF=1;          AC_SUBST([HAVE_DECL_TRUNCF])
   HAVE_DECL_TRUNCL=1;          AC_SUBST([HAVE_DECL_TRUNCL])
+  REPLACE_ACOSF=0;             AC_SUBST([REPLACE_ACOSF])
+  REPLACE_ASINF=0;             AC_SUBST([REPLACE_ASINF])
+  REPLACE_ATANF=0;             AC_SUBST([REPLACE_ATANF])
+  REPLACE_ATAN2F=0;            AC_SUBST([REPLACE_ATAN2F])
   REPLACE_CBRTF=0;             AC_SUBST([REPLACE_CBRTF])
   REPLACE_CBRTL=0;             AC_SUBST([REPLACE_CBRTL])
   REPLACE_CEIL=0;              AC_SUBST([REPLACE_CEIL])
   REPLACE_CEILF=0;             AC_SUBST([REPLACE_CEILF])
   REPLACE_CEILL=0;             AC_SUBST([REPLACE_CEILL])
+  REPLACE_COSF=0;              AC_SUBST([REPLACE_COSF])
+  REPLACE_COSHF=0;             AC_SUBST([REPLACE_COSHF])
+  REPLACE_EXPF=0;              AC_SUBST([REPLACE_EXPF])
   REPLACE_EXPM1=0;             AC_SUBST([REPLACE_EXPM1])
   REPLACE_EXPM1F=0;            AC_SUBST([REPLACE_EXPM1F])
   REPLACE_EXP2=0;              AC_SUBST([REPLACE_EXP2])
@@ -315,7 +322,12 @@
   REPLACE_ROUNDL=0;            AC_SUBST([REPLACE_ROUNDL])
   REPLACE_SIGNBIT=0;           AC_SUBST([REPLACE_SIGNBIT])
   REPLACE_SIGNBIT_USING_GCC=0; AC_SUBST([REPLACE_SIGNBIT_USING_GCC])
+  REPLACE_SINF=0;              AC_SUBST([REPLACE_SINF])
+  REPLACE_SINHF=0;             AC_SUBST([REPLACE_SINHF])
+  REPLACE_SQRTF=0;             AC_SUBST([REPLACE_SQRTF])
   REPLACE_SQRTL=0;             AC_SUBST([REPLACE_SQRTL])
+  REPLACE_TANF=0;              AC_SUBST([REPLACE_TANF])
+  REPLACE_TANHF=0;             AC_SUBST([REPLACE_TANHF])
   REPLACE_TRUNC=0;             AC_SUBST([REPLACE_TRUNC])
   REPLACE_TRUNCF=0;            AC_SUBST([REPLACE_TRUNCF])
   REPLACE_TRUNCL=0;            AC_SUBST([REPLACE_TRUNCL])

Modified: trunk/tp/Texinfo/Convert/XSParagraph/m4/memchr.m4
===================================================================
--- trunk/tp/Texinfo/Convert/XSParagraph/m4/memchr.m4   2017-04-14 16:36:56 UTC 
(rev 7725)
+++ trunk/tp/Texinfo/Convert/XSParagraph/m4/memchr.m4   2017-04-14 17:20:48 UTC 
(rev 7726)
@@ -1,5 +1,5 @@
 # memchr.m4 serial 12
-dnl Copyright (C) 2002-2004, 2009-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2004, 2009-2017 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.

Modified: trunk/tp/Texinfo/Convert/XSParagraph/m4/mmap-anon.m4
===================================================================
--- trunk/tp/Texinfo/Convert/XSParagraph/m4/mmap-anon.m4        2017-04-14 
16:36:56 UTC (rev 7725)
+++ trunk/tp/Texinfo/Convert/XSParagraph/m4/mmap-anon.m4        2017-04-14 
17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 # mmap-anon.m4 serial 10
-dnl Copyright (C) 2005, 2007, 2009-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2005, 2007, 2009-2017 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.

Modified: trunk/tp/Texinfo/Convert/XSParagraph/m4/multiarch.m4
===================================================================
--- trunk/tp/Texinfo/Convert/XSParagraph/m4/multiarch.m4        2017-04-14 
16:36:56 UTC (rev 7725)
+++ trunk/tp/Texinfo/Convert/XSParagraph/m4/multiarch.m4        2017-04-14 
17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 # multiarch.m4 serial 7
-dnl Copyright (C) 2008-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2008-2017 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.

Modified: trunk/tp/Texinfo/Convert/XSParagraph/m4/off_t.m4
===================================================================
--- trunk/tp/Texinfo/Convert/XSParagraph/m4/off_t.m4    2017-04-14 16:36:56 UTC 
(rev 7725)
+++ trunk/tp/Texinfo/Convert/XSParagraph/m4/off_t.m4    2017-04-14 17:20:48 UTC 
(rev 7726)
@@ -1,5 +1,5 @@
 # off_t.m4 serial 1
-dnl Copyright (C) 2012-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2012-2017 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.

Modified: trunk/tp/Texinfo/Convert/XSParagraph/m4/onceonly.m4
===================================================================
--- trunk/tp/Texinfo/Convert/XSParagraph/m4/onceonly.m4 2017-04-14 16:36:56 UTC 
(rev 7725)
+++ trunk/tp/Texinfo/Convert/XSParagraph/m4/onceonly.m4 2017-04-14 17:20:48 UTC 
(rev 7726)
@@ -1,5 +1,5 @@
 # onceonly.m4 serial 9
-dnl Copyright (C) 2002-2003, 2005-2006, 2008-2016 Free Software Foundation,
+dnl Copyright (C) 2002-2003, 2005-2006, 2008-2017 Free Software Foundation,
 dnl Inc.
 dnl
 dnl This file is free software; you can redistribute it and/or modify

Modified: trunk/tp/Texinfo/Convert/XSParagraph/m4/printf.m4
===================================================================
--- trunk/tp/Texinfo/Convert/XSParagraph/m4/printf.m4   2017-04-14 16:36:56 UTC 
(rev 7725)
+++ trunk/tp/Texinfo/Convert/XSParagraph/m4/printf.m4   2017-04-14 17:20:48 UTC 
(rev 7726)
@@ -1,5 +1,5 @@
 # printf.m4 serial 52
-dnl Copyright (C) 2003, 2007-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2003, 2007-2017 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.
@@ -38,6 +38,8 @@
   if (sprintf (buf, "%ju %d", (uintmax_t) 12345671, 33, 44, 55) < 0
       || strcmp (buf, "12345671 33") != 0)
     result |= 1;
+#else
+  result |= 1;
 #endif
   buf[0] = '\0';
   if (sprintf (buf, "%zu %d", (size_t) 12345672, 33, 44, 55) < 0

Modified: trunk/tp/Texinfo/Convert/XSParagraph/m4/size_max.m4
===================================================================
--- trunk/tp/Texinfo/Convert/XSParagraph/m4/size_max.m4 2017-04-14 16:36:56 UTC 
(rev 7725)
+++ trunk/tp/Texinfo/Convert/XSParagraph/m4/size_max.m4 2017-04-14 17:20:48 UTC 
(rev 7726)
@@ -1,5 +1,5 @@
 # size_max.m4 serial 10
-dnl Copyright (C) 2003, 2005-2006, 2008-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2003, 2005-2006, 2008-2017 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.

Modified: trunk/tp/Texinfo/Convert/XSParagraph/m4/ssize_t.m4
===================================================================
--- trunk/tp/Texinfo/Convert/XSParagraph/m4/ssize_t.m4  2017-04-14 16:36:56 UTC 
(rev 7725)
+++ trunk/tp/Texinfo/Convert/XSParagraph/m4/ssize_t.m4  2017-04-14 17:20:48 UTC 
(rev 7726)
@@ -1,5 +1,5 @@
 # ssize_t.m4 serial 5 (gettext-0.18.2)
-dnl Copyright (C) 2001-2003, 2006, 2010-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2001-2003, 2006, 2010-2017 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.

Modified: trunk/tp/Texinfo/Convert/XSParagraph/m4/stddef_h.m4
===================================================================
--- trunk/tp/Texinfo/Convert/XSParagraph/m4/stddef_h.m4 2017-04-14 16:36:56 UTC 
(rev 7725)
+++ trunk/tp/Texinfo/Convert/XSParagraph/m4/stddef_h.m4 2017-04-14 17:20:48 UTC 
(rev 7726)
@@ -1,6 +1,6 @@
 dnl A placeholder for <stddef.h>, for platforms that have issues.
 # stddef_h.m4 serial 5
-dnl Copyright (C) 2009-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2009-2017 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.

Modified: trunk/tp/Texinfo/Convert/XSParagraph/m4/stdint.m4
===================================================================
--- trunk/tp/Texinfo/Convert/XSParagraph/m4/stdint.m4   2017-04-14 16:36:56 UTC 
(rev 7725)
+++ trunk/tp/Texinfo/Convert/XSParagraph/m4/stdint.m4   2017-04-14 17:20:48 UTC 
(rev 7726)
@@ -1,5 +1,5 @@
-# stdint.m4 serial 44
-dnl Copyright (C) 2001-2016 Free Software Foundation, Inc.
+# stdint.m4 serial 50
+dnl Copyright (C) 2001-2017 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -11,6 +11,9 @@
 [
   AC_PREREQ([2.59])dnl
 
+  AC_REQUIRE([gl_LIMITS_H])
+  AC_REQUIRE([gt_TYPE_WINT_T])
+
   dnl Check for long long int and unsigned long long int.
   AC_REQUIRE([AC_TYPE_LONG_LONG_INT])
   if test $ac_cv_type_long_long_int = yes; then
@@ -152,6 +155,15 @@
 intmax_t i = INTMAX_MAX;
 uintmax_t j = UINTMAX_MAX;
 
+/* Check that SIZE_MAX has the correct type, if possible.  */
+#if 201112 <= __STDC_VERSION__
+int k = _Generic (SIZE_MAX, size_t: 0);
+#elif (2 <= __GNUC__ || defined __IBM__TYPEOF__ \
+       || (0x5110 <= __SUNPRO_C && !__STDC__))
+extern size_t k;
+extern __typeof__ (SIZE_MAX) k;
+#endif
+
 #include <limits.h> /* for CHAR_BIT */
 #define TYPE_MINIMUM(t) \
   ((t) ((t) 0 < (t) -1 ? (t) 0 : ~ TYPE_MAXIMUM (t)))
@@ -282,7 +294,13 @@
          ])
       ])
   fi
+
+  HAVE_C99_STDINT_H=0
+  HAVE_SYS_BITYPES_H=0
+  HAVE_SYS_INTTYPES_H=0
+  STDINT_H=stdint.h
   if test "$gl_cv_header_working_stdint_h" = yes; then
+    HAVE_C99_STDINT_H=1
     dnl Now see whether the system <stdint.h> works without
     dnl __STDC_CONSTANT_MACROS/__STDC_LIMIT_MACROS defined.
     AC_CACHE_CHECK([whether stdint.h predates C++11],
@@ -289,7 +307,7 @@
       [gl_cv_header_stdint_predates_cxx11_h],
       [gl_cv_header_stdint_predates_cxx11_h=yes
        AC_COMPILE_IFELSE([
-        AC_LANG_PROGRAM([[
+         AC_LANG_PROGRAM([[
 #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */
 #include <stdint.h>
 ]
@@ -306,7 +324,24 @@
       AC_DEFINE([__STDC_LIMIT_MACROS], [1],
                 [Define to 1 if the system <stdint.h> predates C++11.])
     fi
-    STDINT_H=
+    AC_CACHE_CHECK([whether stdint.h has UINTMAX_WIDTH etc.],
+      [gl_cv_header_stdint_width],
+      [gl_cv_header_stdint_width=no
+       AC_COMPILE_IFELSE(
+         [AC_LANG_PROGRAM([[
+            /* Work if build is not clean.  */
+            #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1
+            #ifndef __STDC_WANT_IEC_60559_BFP_EXT__
+             #define __STDC_WANT_IEC_60559_BFP_EXT__ 1
+            #endif
+            #include <stdint.h>
+            ]gl_STDINT_INCLUDES[
+            int iw = UINTMAX_WIDTH;
+            ]])],
+         [gl_cv_header_stdint_width=yes])])
+    if test "$gl_cv_header_stdint_width" = yes; then
+      STDINT_H=
+    fi
   else
     dnl Check for <sys/inttypes.h>, and for
     dnl <sys/bitypes.h> (used in Linux libc4 >= 4.6.7 and libc5).
@@ -313,20 +348,20 @@
     AC_CHECK_HEADERS([sys/inttypes.h sys/bitypes.h])
     if test $ac_cv_header_sys_inttypes_h = yes; then
       HAVE_SYS_INTTYPES_H=1
-    else
-      HAVE_SYS_INTTYPES_H=0
     fi
-    AC_SUBST([HAVE_SYS_INTTYPES_H])
     if test $ac_cv_header_sys_bitypes_h = yes; then
       HAVE_SYS_BITYPES_H=1
-    else
-      HAVE_SYS_BITYPES_H=0
     fi
-    AC_SUBST([HAVE_SYS_BITYPES_H])
-
     gl_STDINT_TYPE_PROPERTIES
-    STDINT_H=stdint.h
   fi
+
+  dnl The substitute stdint.h needs the substitute limit.h's _GL_INTEGER_WIDTH.
+  LIMITS_H=limits.h
+  AM_CONDITIONAL([GL_GENERATE_LIMITS_H], [test -n "$LIMITS_H"])
+
+  AC_SUBST([HAVE_C99_STDINT_H])
+  AC_SUBST([HAVE_SYS_BITYPES_H])
+  AC_SUBST([HAVE_SYS_INTTYPES_H])
   AC_SUBST([STDINT_H])
   AM_CONDITIONAL([GL_GENERATE_STDINT_H], [test -n "$STDINT_H"])
 ])
@@ -494,7 +529,7 @@
   dnl requirement that wint_t is "unchanged by default argument promotions".
   dnl In this case gnulib's <wchar.h> and <wctype.h> override wint_t.
   dnl Set the variable BITSIZEOF_WINT_T accordingly.
-  if test $BITSIZEOF_WINT_T -lt 32; then
+  if test $GNULIB_OVERRIDES_WINT_T = 1; then
     BITSIZEOF_WINT_T=32
   fi
 ])
@@ -504,8 +539,3 @@
 m4_ifdef([AC_COMPUTE_INT], [], [
   AC_DEFUN([AC_COMPUTE_INT], [_AC_COMPUTE_INT([$2],[$1],[$3],[$4])])
 ])
-
-# Hey Emacs!
-# Local Variables:
-# indent-tabs-mode: nil
-# End:

Modified: trunk/tp/Texinfo/Convert/XSParagraph/m4/stdint_h.m4
===================================================================
--- trunk/tp/Texinfo/Convert/XSParagraph/m4/stdint_h.m4 2017-04-14 16:36:56 UTC 
(rev 7725)
+++ trunk/tp/Texinfo/Convert/XSParagraph/m4/stdint_h.m4 2017-04-14 17:20:48 UTC 
(rev 7726)
@@ -1,5 +1,5 @@
 # stdint_h.m4 serial 9
-dnl Copyright (C) 1997-2004, 2006, 2008-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 1997-2004, 2006, 2008-2017 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.

Modified: trunk/tp/Texinfo/Convert/XSParagraph/m4/stdio_h.m4
===================================================================
--- trunk/tp/Texinfo/Convert/XSParagraph/m4/stdio_h.m4  2017-04-14 16:36:56 UTC 
(rev 7725)
+++ trunk/tp/Texinfo/Convert/XSParagraph/m4/stdio_h.m4  2017-04-14 17:20:48 UTC 
(rev 7726)
@@ -1,5 +1,5 @@
-# stdio_h.m4 serial 46
-dnl Copyright (C) 2007-2016 Free Software Foundation, Inc.
+# stdio_h.m4 serial 48
+dnl Copyright (C) 2007-2017 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.
@@ -6,9 +6,13 @@
 
 AC_DEFUN([gl_STDIO_H],
 [
-  dnl For __USE_MINGW_ANSI_STDIO
-  AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
-
+  AH_VERBATIM([MINGW_ANSI_STDIO],
+[/* Use GNU style printf and scanf.  */
+#ifndef __USE_MINGW_ANSI_STDIO
+# undef __USE_MINGW_ANSI_STDIO
+#endif
+])
+  AC_DEFINE([__USE_MINGW_ANSI_STDIO])
   AC_REQUIRE([gl_STDIO_H_DEFAULTS])
   gl_NEXT_HEADERS([stdio.h])
 

Modified: trunk/tp/Texinfo/Convert/XSParagraph/m4/string_h.m4
===================================================================
--- trunk/tp/Texinfo/Convert/XSParagraph/m4/string_h.m4 2017-04-14 16:36:56 UTC 
(rev 7725)
+++ trunk/tp/Texinfo/Convert/XSParagraph/m4/string_h.m4 2017-04-14 17:20:48 UTC 
(rev 7726)
@@ -1,6 +1,6 @@
 # Configure a GNU-like replacement for <string.h>.
 
-# Copyright (C) 2007-2016 Free Software Foundation, Inc.
+# Copyright (C) 2007-2017 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.

Modified: trunk/tp/Texinfo/Convert/XSParagraph/m4/sys_types_h.m4
===================================================================
--- trunk/tp/Texinfo/Convert/XSParagraph/m4/sys_types_h.m4      2017-04-14 
16:36:56 UTC (rev 7725)
+++ trunk/tp/Texinfo/Convert/XSParagraph/m4/sys_types_h.m4      2017-04-14 
17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
-# sys_types_h.m4 serial 5
-dnl Copyright (C) 2011-2016 Free Software Foundation, Inc.
+# sys_types_h.m4 serial 6
+dnl Copyright (C) 2011-2017 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.
@@ -22,3 +22,28 @@
 AC_DEFUN([gl_SYS_TYPES_H_DEFAULTS],
 [
 ])
+
+# This works around a buggy version in autoconf <= 2.69.
+# See <https://lists.gnu.org/archive/html/autoconf/2016-08/msg00014.html>
+
+m4_version_prereq([2.70], [], [
+
+# This is taken from the following Autoconf patch:
+# http://git.sv.gnu.org/cgit/autoconf.git/commit/?id=e17a30e98
+
+m4_undefine([AC_HEADER_MAJOR])
+AC_DEFUN([AC_HEADER_MAJOR],
+[AC_CHECK_HEADERS_ONCE([sys/types.h])
+AC_CHECK_HEADER([sys/mkdev.h],
+  [AC_DEFINE([MAJOR_IN_MKDEV], [1],
+    [Define to 1 if `major', `minor', and `makedev' are declared in
+     <mkdev.h>.])])
+if test $ac_cv_header_sys_mkdev_h = no; then
+  AC_CHECK_HEADER([sys/sysmacros.h],
+    [AC_DEFINE([MAJOR_IN_SYSMACROS], [1],
+      [Define to 1 if `major', `minor', and `makedev' are declared in
+       <sysmacros.h>.])])
+fi
+])
+
+])

Modified: trunk/tp/Texinfo/Convert/XSParagraph/m4/vasnprintf.m4
===================================================================
--- trunk/tp/Texinfo/Convert/XSParagraph/m4/vasnprintf.m4       2017-04-14 
16:36:56 UTC (rev 7725)
+++ trunk/tp/Texinfo/Convert/XSParagraph/m4/vasnprintf.m4       2017-04-14 
17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 # vasnprintf.m4 serial 36
-dnl Copyright (C) 2002-2004, 2006-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2004, 2006-2017 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.

Modified: trunk/tp/Texinfo/Convert/XSParagraph/m4/vasprintf.m4
===================================================================
--- trunk/tp/Texinfo/Convert/XSParagraph/m4/vasprintf.m4        2017-04-14 
16:36:56 UTC (rev 7725)
+++ trunk/tp/Texinfo/Convert/XSParagraph/m4/vasprintf.m4        2017-04-14 
17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 # vasprintf.m4 serial 6
-dnl Copyright (C) 2002-2003, 2006-2007, 2009-2016 Free Software Foundation,
+dnl Copyright (C) 2002-2003, 2006-2007, 2009-2017 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,

Modified: trunk/tp/Texinfo/Convert/XSParagraph/m4/warn-on-use.m4
===================================================================
--- trunk/tp/Texinfo/Convert/XSParagraph/m4/warn-on-use.m4      2017-04-14 
16:36:56 UTC (rev 7725)
+++ trunk/tp/Texinfo/Convert/XSParagraph/m4/warn-on-use.m4      2017-04-14 
17:20:48 UTC (rev 7726)
@@ -1,5 +1,5 @@
 # warn-on-use.m4 serial 5
-dnl Copyright (C) 2010-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2010-2017 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.

Modified: trunk/tp/Texinfo/Convert/XSParagraph/m4/wchar_h.m4
===================================================================
--- trunk/tp/Texinfo/Convert/XSParagraph/m4/wchar_h.m4  2017-04-14 16:36:56 UTC 
(rev 7725)
+++ trunk/tp/Texinfo/Convert/XSParagraph/m4/wchar_h.m4  2017-04-14 17:20:48 UTC 
(rev 7726)
@@ -1,6 +1,6 @@
 dnl A placeholder for ISO C99 <wchar.h>, for platforms that have issues.
 
-dnl Copyright (C) 2007-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2007-2017 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.

Modified: trunk/tp/Texinfo/Convert/XSParagraph/m4/wchar_t.m4
===================================================================
--- trunk/tp/Texinfo/Convert/XSParagraph/m4/wchar_t.m4  2017-04-14 16:36:56 UTC 
(rev 7725)
+++ trunk/tp/Texinfo/Convert/XSParagraph/m4/wchar_t.m4  2017-04-14 17:20:48 UTC 
(rev 7726)
@@ -1,5 +1,5 @@
 # wchar_t.m4 serial 4 (gettext-0.18.2)
-dnl Copyright (C) 2002-2003, 2008-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2003, 2008-2017 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.

Modified: trunk/tp/Texinfo/Convert/XSParagraph/m4/wint_t.m4
===================================================================
--- trunk/tp/Texinfo/Convert/XSParagraph/m4/wint_t.m4   2017-04-14 16:36:56 UTC 
(rev 7725)
+++ trunk/tp/Texinfo/Convert/XSParagraph/m4/wint_t.m4   2017-04-14 17:20:48 UTC 
(rev 7726)
@@ -1,11 +1,12 @@
-# wint_t.m4 serial 5 (gettext-0.18.2)
-dnl Copyright (C) 2003, 2007-2016 Free Software Foundation, Inc.
+# wint_t.m4 serial 6
+dnl Copyright (C) 2003, 2007-2017 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
 
 dnl From Bruno Haible.
-dnl Test whether <wchar.h> has the 'wint_t' type.
+dnl Test whether <wchar.h> has the 'wint_t' type and whether gnulib's
+dnl <wchar.h> or <wctype.h> would, if present, override 'wint_t'.
 dnl Prerequisite: AC_PROG_CC
 
 AC_DEFUN([gt_TYPE_WINT_T],
@@ -28,5 +29,34 @@
        [gt_cv_c_wint_t=no])])
   if test $gt_cv_c_wint_t = yes; then
     AC_DEFINE([HAVE_WINT_T], [1], [Define if you have the 'wint_t' type.])
+
+    dnl Determine whether gnulib's <wchar.h> or <wctype.h> would, if present,
+    dnl override 'wint_t'.
+    AC_CACHE_CHECK([whether wint_t is too small],
+      [gl_cv_type_wint_t_too_small],
+      [AC_COMPILE_IFELSE(
+           [AC_LANG_PROGRAM([[
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+   <wchar.h>.
+   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+   included before <wchar.h>.  */
+#if !(defined __GLIBC__ && !defined __UCLIBC__)
+# include <stddef.h>
+# include <stdio.h>
+# include <time.h>
+#endif
+#include <wchar.h>
+              int verify[sizeof (wint_t) < sizeof (int) ? -1 : 1];
+              ]])],
+           [gl_cv_type_wint_t_too_small=no],
+           [gl_cv_type_wint_t_too_small=yes])])
+    if test $gl_cv_type_wint_t_too_small = yes; then
+      GNULIB_OVERRIDES_WINT_T=1
+    else
+      GNULIB_OVERRIDES_WINT_T=0
+    fi
+  else
+    GNULIB_OVERRIDES_WINT_T=0
   fi
+  AC_SUBST([GNULIB_OVERRIDES_WINT_T])
 ])

Modified: trunk/tp/Texinfo/Convert/XSParagraph/m4/xsize.m4
===================================================================
--- trunk/tp/Texinfo/Convert/XSParagraph/m4/xsize.m4    2017-04-14 16:36:56 UTC 
(rev 7725)
+++ trunk/tp/Texinfo/Convert/XSParagraph/m4/xsize.m4    2017-04-14 17:20:48 UTC 
(rev 7726)
@@ -1,5 +1,5 @@
 # xsize.m4 serial 5
-dnl Copyright (C) 2003-2004, 2008-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2003-2004, 2008-2017 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.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]