Commit 7cfda699 authored by Alexandre Duret-Lutz's avatar Alexandre Duret-Lutz
Browse files

Upgrade to gnulib 6b8f1dd1a21ce49319795391e21adf645b64db3c.

* m4/absolute-header.m4: New file.
* lib/Makefile.am, lib/argp-fmtstream.h, lib/argp.h, lib/error.c,
lib/gethrxtime.h, lib/intprops.h, lib/localcharset.c,
lib/quotearg.c, lib/stdio.in.h, lib/strerror-override.h,
lib/sys_time.in.h, lib/timespec.h, lib/unistd.in.h, lib/verify.h,
lib/wctype.in.h, lib/xalloc.h, lib/xsize.h, lib/xtime.h,
m4/configmake.m4, m4/extern-inline.m4, m4/gnulib-comp.m4,
m4/include_next.m4, m4/unistd_h.m4: Update to today's gnulib.
parent 0afb9fe1
......@@ -53,6 +53,15 @@ libgnu_la_LDFLAGS += $(LIB_CLOCK_GETTIME)
libgnu_la_LDFLAGS += $(LIB_GETHRXTIME)
libgnu_la_LDFLAGS += $(LTLIBINTL)
## begin gnulib module absolute-header
# Use this preprocessor expression to decide whether #include_next works.
# Do not rely on a 'configure'-time test for this, since the expression
# might appear in an installed header, which is used by some other compiler.
HAVE_INCLUDE_NEXT = (__GNUC__ || 60000000 <= __DECC_VER)
## end gnulib module absolute-header
## begin gnulib module alloca
......@@ -126,7 +135,7 @@ EXTRA_DIST += c-strcaseeq.h
## begin gnulib module configmake
# Listed in the same order as the GNU makefile conventions, and
# provided by autoconf 2.59c+.
# provided by autoconf 2.59c+ or 2.70.
# The Automake-defined pkg* macros are appended, in the order
# listed in the Automake 1.10a+ documentation.
configmake.h: Makefile
......@@ -142,6 +151,7 @@ configmake.h: Makefile
echo '#define SYSCONFDIR "$(sysconfdir)"'; \
echo '#define SHAREDSTATEDIR "$(sharedstatedir)"'; \
echo '#define LOCALSTATEDIR "$(localstatedir)"'; \
echo '#define RUNSTATEDIR "$(runstatedir)"'; \
echo '#define INCLUDEDIR "$(includedir)"'; \
echo '#define OLDINCLUDEDIR "$(oldincludedir)"'; \
echo '#define DOCDIR "$(docdir)"'; \
......@@ -1620,6 +1630,7 @@ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
-e 's|@''REPLACE_FTRUNCATE''@|$(REPLACE_FTRUNCATE)|g' \
-e 's|@''REPLACE_GETCWD''@|$(REPLACE_GETCWD)|g' \
-e 's|@''REPLACE_GETDOMAINNAME''@|$(REPLACE_GETDOMAINNAME)|g' \
-e 's|@''REPLACE_GETDTABLESIZE''@|$(REPLACE_GETDTABLESIZE)|g' \
-e 's|@''REPLACE_GETLOGIN_R''@|$(REPLACE_GETLOGIN_R)|g' \
-e 's|@''REPLACE_GETGROUPS''@|$(REPLACE_GETGROUPS)|g' \
-e 's|@''REPLACE_GETPAGESIZE''@|$(REPLACE_GETPAGESIZE)|g' \
......
......@@ -197,6 +197,9 @@ extern int __argp_fmtstream_ensure (argp_fmtstream_t __fs, size_t __amount);
#define __argp_fmtstream_point argp_fmtstream_point
#define __argp_fmtstream_update _argp_fmtstream_update
#define __argp_fmtstream_ensure _argp_fmtstream_ensure
#ifndef _GL_INLINE_HEADER_BEGIN
#error "Please include config.h first."
#endif
_GL_INLINE_HEADER_BEGIN
#ifndef ARGP_FS_EI
# define ARGP_FS_EI _GL_INLINE
......
......@@ -579,6 +579,9 @@ extern void *__argp_input (const struct argp *__restrict __argp,
# define __argp_state_help argp_state_help
# define __option_is_short _option_is_short
# define __option_is_end _option_is_end
#ifndef _GL_INLINE_HEADER_BEGIN
#error "Please include config.h first."
#endif
_GL_INLINE_HEADER_BEGIN
# ifndef ARGP_EI
# define ARGP_EI _GL_INLINE
......
......@@ -195,7 +195,7 @@ print_errno_message (int errnum)
#endif
}
static void
static void _GL_ATTRIBUTE_FORMAT_PRINTF (3, 0) _GL_ARG_NONNULL ((3))
error_tail (int status, int errnum, const char *message, va_list args)
{
#if _LIBC
......
......@@ -22,6 +22,9 @@
#include "xtime.h"
#ifndef _GL_INLINE_HEADER_BEGIN
#error "Please include config.h first."
#endif
_GL_INLINE_HEADER_BEGIN
#ifndef GETHRXTIME_INLINE
# define GETHRXTIME_INLINE _GL_INLINE
......
......@@ -89,7 +89,8 @@
/* Return 1 if the __typeof__ keyword works. This could be done by
'configure', but for now it's easier to do it by hand. */
#if 2 <= __GNUC__ || defined __IBM__TYPEOF__ || 0x5110 <= __SUNPRO_C
#if (2 <= __GNUC__ || defined __IBM__TYPEOF__ \
|| (0x5110 <= __SUNPRO_C && !__STDC__))
# define _GL_HAVE___TYPEOF__ 1
#else
# define _GL_HAVE___TYPEOF__ 0
......
......@@ -65,6 +65,11 @@
# include <os2.h>
#endif
/* For MB_CUR_MAX_L */
#if defined DARWIN7
# include <xlocale.h>
#endif
#if ENABLE_RELOCATABLE
# include "relocatable.h"
#else
......@@ -545,7 +550,7 @@ locale_charset (void)
#ifdef DARWIN7
/* Mac OS X sets MB_CUR_MAX to 1 when LC_ALL=C, and "UTF-8"
(the default codeset) does not work when MB_CUR_MAX is 1. */
if (strcmp (codeset, "UTF-8") == 0 && MB_CUR_MAX <= 1)
if (strcmp (codeset, "UTF-8") == 0 && MB_CUR_MAX_L (uselocale (NULL)) <= 1)
codeset = "ASCII";
#endif
......
......@@ -626,7 +626,7 @@ quotearg_buffer_restyled (char *buffer, size_t buffersize,
if (! ((backslash_escapes || elide_outer_quotes)
&& quote_these_too
&& quote_these_too[c / INT_BITS] & (1 << (c % INT_BITS)))
&& quote_these_too[c / INT_BITS] >> (c % INT_BITS) & 1)
&& !is_right_quote)
goto store_c;
......
......@@ -124,6 +124,15 @@
#define _GL_STDIO_STRINGIZE(token) #token
#define _GL_STDIO_MACROEXPAND_AND_STRINGIZE(token) _GL_STDIO_STRINGIZE(token)
/* When also using extern inline, suppress the use of static inline in
standard headers of problematic Apple configurations, as Libc at
least through Libc-825.26 (2013-04-09) mishandles it; see, e.g.,
<http://lists.gnu.org/archive/html/bug-gnulib/2012-12/msg00023.html>.
Perhaps Apple will fix this some day. */
#if (defined _GL_EXTERN_INLINE_IN_USE && defined __APPLE__ \
&& defined __GNUC__ && defined __STDC__)
# undef putc_unlocked
#endif
#if @GNULIB_DPRINTF@
# if @REPLACE_DPRINTF@
......
......@@ -48,7 +48,7 @@
|| GNULIB_defined_EOWNERDEAD \
|| GNULIB_defined_ENOTRECOVERABLE \
|| GNULIB_defined_EILSEQ
extern const char *strerror_override (int errnum);
extern const char *strerror_override (int errnum) _GL_ATTRIBUTE_CONST;
# else
# define strerror_override(ignored) NULL
# endif
......
......@@ -24,11 +24,12 @@
#endif
@PRAGMA_COLUMNS@
/* On Cygwin, <sys/time.h> includes itself recursively via <sys/select.h>.
/* On Cygwin and on many BSDish systems, <sys/time.h> includes itself
recursively via <sys/select.h>.
Simply delegate to the system's header in this case; it is a no-op.
Without this extra ifdef, the C++ gettimeofday declaration below
would be a forward declaration in gnulib's nested <sys/time.h>. */
#ifdef _CYGWIN_SYS_TIME_H
#if defined _CYGWIN_SYS_TIME_H || defined _SYS_TIME_H || defined _SYS_TIME_H_
# @INCLUDE_NEXT@ @NEXT_SYS_TIME_H@
#else
......
......@@ -21,11 +21,31 @@
# include <time.h>
#ifndef _GL_INLINE_HEADER_BEGIN
#error "Please include config.h first."
#endif
_GL_INLINE_HEADER_BEGIN
#ifndef _GL_TIMESPEC_INLINE
# define _GL_TIMESPEC_INLINE _GL_INLINE
#endif
/* Resolution of timespec time stamps (in units per second), and log
base 10 of the resolution. */
enum { TIMESPEC_RESOLUTION = 1000000000 };
enum { LOG10_TIMESPEC_RESOLUTION = 9 };
/* Return a timespec with seconds S and nanoseconds NS. */
_GL_TIMESPEC_INLINE struct timespec
make_timespec (time_t s, long int ns)
{
struct timespec r;
r.tv_sec = s;
r.tv_nsec = ns;
return r;
}
/* Return negative, zero, positive if A < B, A == B, A > B, respectively.
For each time stamp T, this code assumes that either:
......
......@@ -116,6 +116,9 @@
# include <getopt.h>
#endif
#ifndef _GL_INLINE_HEADER_BEGIN
#error "Please include config.h first."
#endif
_GL_INLINE_HEADER_BEGIN
#ifndef _GL_UNISTD_INLINE
# define _GL_UNISTD_INLINE _GL_INLINE
......@@ -651,10 +654,19 @@ _GL_WARN_ON_USE (getdomainname, "getdomainname is unportable - "
#if @GNULIB_GETDTABLESIZE@
/* Return the maximum number of file descriptors in the current process.
In POSIX, this is same as sysconf (_SC_OPEN_MAX). */
# if !@HAVE_GETDTABLESIZE@
# if @REPLACE_GETDTABLESIZE@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef getdtablesize
# define getdtablesize rpl_getdtablesize
# endif
_GL_FUNCDECL_RPL (getdtablesize, int, (void));
_GL_CXXALIAS_RPL (getdtablesize, int, (void));
# else
# if !@HAVE_GETDTABLESIZE@
_GL_FUNCDECL_SYS (getdtablesize, int, (void));
# endif
# endif
_GL_CXXALIAS_SYS (getdtablesize, int, (void));
# endif
_GL_CXXALIASWARN (getdtablesize);
#elif defined GNULIB_POSIXCHECK
# undef getdtablesize
......
......@@ -250,6 +250,30 @@ template <int w>
#define verify(R) _GL_VERIFY (R, "verify (" #R ")")
#ifndef __has_builtin
# define __has_builtin(x) 0
#endif
/* Assume that R always holds. This lets the compiler optimize
accordingly. R should not have side-effects; it may or may not be
evaluated. Behavior is undefined if R is false. */
#if (__has_builtin (__builtin_unreachable) \
|| 4 < __GNUC__ + (5 <= __GNUC_MINOR__))
# define assume(R) ((R) ? (void) 0 : __builtin_unreachable ())
#elif 1200 <= _MSC_VER
# define assume(R) __assume (R)
#elif (defined lint \
&& (__has_builtin (__builtin_trap) \
|| 3 < __GNUC__ + (3 < __GNUC_MINOR__ + (4 <= __GNUC_PATCHLEVEL__))))
/* Doing it this way helps various packages when configured with
--enable-gcc-warnings, which compiles with -Dlint. It's nicer
when 'assume' silences warnings even with older GCCs. */
# define assume(R) ((R) ? (void) 0 : __builtin_trap ())
#else
# define assume(R) ((void) (0 && (R)))
#endif
/* @assert.h omit end@ */
#endif
......@@ -61,6 +61,9 @@
#ifndef _@GUARD_PREFIX@_WCTYPE_H
#define _@GUARD_PREFIX@_WCTYPE_H
#ifndef _GL_INLINE_HEADER_BEGIN
#error "Please include config.h first."
#endif
_GL_INLINE_HEADER_BEGIN
#ifndef _GL_WCTYPE_INLINE
# define _GL_WCTYPE_INLINE _GL_INLINE
......
......@@ -22,6 +22,9 @@
#include "xalloc-oversized.h"
#ifndef _GL_INLINE_HEADER_BEGIN
#error "Please include config.h first."
#endif
_GL_INLINE_HEADER_BEGIN
#ifndef XALLOC_INLINE
# define XALLOC_INLINE _GL_INLINE
......
......@@ -27,6 +27,9 @@
# include <stdint.h>
#endif
#ifndef _GL_INLINE_HEADER_BEGIN
#error "Please include config.h first."
#endif
_GL_INLINE_HEADER_BEGIN
#ifndef XSIZE_INLINE
# define XSIZE_INLINE _GL_INLINE
......
......@@ -20,6 +20,9 @@
#ifndef XTIME_H_
#define XTIME_H_ 1
#ifndef _GL_INLINE_HEADER_BEGIN
#error "Please include config.h first."
#endif
_GL_INLINE_HEADER_BEGIN
#ifndef XTIME_INLINE
# define XTIME_INLINE _GL_INLINE
......
# absolute-header.m4 serial 16
dnl Copyright (C) 2006-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
dnl From Derek Price.
# gl_ABSOLUTE_HEADER(HEADER1 HEADER2 ...)
# ---------------------------------------
# Find the absolute name of a header file, testing first if the header exists.
# If the header were sys/inttypes.h, this macro would define
# ABSOLUTE_SYS_INTTYPES_H to the '""' quoted absolute name of sys/inttypes.h
# in config.h
# (e.g. '#define ABSOLUTE_SYS_INTTYPES_H "///usr/include/sys/inttypes.h"').
# The three "///" are to pacify Sun C 5.8, which otherwise would say
# "warning: #include of /usr/include/... may be non-portable".
# Use '""', not '<>', so that the /// cannot be confused with a C99 comment.
# Note: This macro assumes that the header file is not empty after
# preprocessing, i.e. it does not only define preprocessor macros but also
# provides some type/enum definitions or function/variable declarations.
AC_DEFUN([gl_ABSOLUTE_HEADER],
[AC_REQUIRE([AC_CANONICAL_HOST])
AC_LANG_PREPROC_REQUIRE()dnl
dnl FIXME: gl_absolute_header and ac_header_exists must be used unquoted
dnl until we can assume autoconf 2.64 or newer.
m4_foreach_w([gl_HEADER_NAME], [$1],
[AS_VAR_PUSHDEF([gl_absolute_header],
[gl_cv_absolute_]m4_defn([gl_HEADER_NAME]))dnl
AC_CACHE_CHECK([absolute name of <]m4_defn([gl_HEADER_NAME])[>],
m4_defn([gl_absolute_header]),
[AS_VAR_PUSHDEF([ac_header_exists],
[ac_cv_header_]m4_defn([gl_HEADER_NAME]))dnl
AC_CHECK_HEADERS_ONCE(m4_defn([gl_HEADER_NAME]))dnl
if test AS_VAR_GET(ac_header_exists) = yes; then
gl_ABSOLUTE_HEADER_ONE(m4_defn([gl_HEADER_NAME]))
fi
AS_VAR_POPDEF([ac_header_exists])dnl
])dnl
AC_DEFINE_UNQUOTED(AS_TR_CPP([ABSOLUTE_]m4_defn([gl_HEADER_NAME])),
["AS_VAR_GET(gl_absolute_header)"],
[Define this to an absolute name of <]m4_defn([gl_HEADER_NAME])[>.])
AS_VAR_POPDEF([gl_absolute_header])dnl
])dnl
])# gl_ABSOLUTE_HEADER
# gl_ABSOLUTE_HEADER_ONE(HEADER)
# ------------------------------
# Like gl_ABSOLUTE_HEADER, except that:
# - it assumes that the header exists,
# - it uses the current CPPFLAGS,
# - it does not cache the result,
# - it is silent.
AC_DEFUN([gl_ABSOLUTE_HEADER_ONE],
[
AC_REQUIRE([AC_CANONICAL_HOST])
AC_LANG_CONFTEST([AC_LANG_SOURCE([[#include <]]m4_dquote([$1])[[>]])])
dnl AIX "xlc -E" and "cc -E" omit #line directives for header files
dnl that contain only a #include of other header files and no
dnl non-comment tokens of their own. This leads to a failure to
dnl detect the absolute name of <dirent.h>, <signal.h>, <poll.h>
dnl and others. The workaround is to force preservation of comments
dnl through option -C. This ensures all necessary #line directives
dnl are present. GCC supports option -C as well.
case "$host_os" in
aix*) gl_absname_cpp="$ac_cpp -C" ;;
*) gl_absname_cpp="$ac_cpp" ;;
esac
changequote(,)
case "$host_os" in
mingw*)
dnl For the sake of native Windows compilers (excluding gcc),
dnl treat backslash as a directory separator, like /.
dnl Actually, these compilers use a double-backslash as
dnl directory separator, inside the
dnl # line "filename"
dnl directives.
gl_dirsep_regex='[/\\]'
;;
*)
gl_dirsep_regex='\/'
;;
esac
dnl A sed expression that turns a string into a basic regular
dnl expression, for use within "/.../".
gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
gl_header_literal_regex=`echo '$1' \
| sed -e "$gl_make_literal_regex_sed"`
gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
s|^/[^/]|//&|
p
q
}'
changequote([,])
dnl eval is necessary to expand gl_absname_cpp.
dnl Ultrix and Pyramid sh refuse to redirect output of eval,
dnl so use subshell.
AS_VAR_SET([gl_cv_absolute_]AS_TR_SH([[$1]]),
[`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD |
sed -n "$gl_absolute_header_sed"`])
])
# configmake.m4 serial 1
# configmake.m4 serial 2
dnl Copyright (C) 2010-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
......@@ -7,8 +7,9 @@ dnl with or without modifications, as long as this notice is preserved.
# gl_CONFIGMAKE_PREP
# ------------------
# Guarantee all of the standard directory variables, even when used with
# autoconf 2.59 (datarootdir wasn't supported until 2.59c) or automake
# 1.9.6 (pkglibexecdir wasn't supported until 1.10b.).
# autoconf 2.59 (datarootdir wasn't supported until 2.59c, and runstatedir
# in 2.70) or automake 1.9.6 (pkglibexecdir wasn't supported until 1.10b,
# and runstatedir in 1.14.1).
AC_DEFUN([gl_CONFIGMAKE_PREP],
[
dnl Technically, datadir should default to datarootdir. But if
......@@ -43,6 +44,10 @@ AC_DEFUN([gl_CONFIGMAKE_PREP],
if test "x$localedir" = x; then
AC_SUBST([localedir], ['${datarootdir}/locale'])
fi
dnl Added in autoconf 2.70
if test "x$runstatedir" = x; then
AC_SUBST([runstatedir], ['${localstatedir}/run'])
fi
dnl Automake 1.9.6 only lacks pkglibexecdir; and since 1.11 merely
dnl provides it without AC_SUBST, this blind use of AC_SUBST is safe.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment