Update from Gnulib

This incorporates:
2019-01-26 getloadavg: Add support for Android
2019-01-24 fchownat: Fix compilation error on Android 4.3
2019-01-24 mbtowc: Fix compilation error on Android 4.3
2019-01-24 random: Fix compilation error on Android 4.3
2019-01-24 renameat: Fix compilation error on Android 4.3
2019-01-24 unlinkat: Fix compilation error on Android 4.3
2019-01-19 gettext: support disabling use of VLAs
2019-01-17 sys_stat: Fix warning on OS/2 kLIBC
2019-01-17 fcntl: Fix syntax error (regression from 2018-10-05)
2019-01-10 verify: Enable _GL_HAVE_STATIC_ASSERT for recent G++
2018-12-22 stdioext: port to newer 32-bit Android
2018-12-16 libc-config: Support HP-UX cc in C99 mode.
* build-aux/config.guess, build-aux/config.sub, doc/misc/texinfo.tex:
* lib/cdefs.h, lib/fcntl.c, lib/getloadavg.c, lib/gettext.h:
* lib/regexec.c, lib/stdio-impl.h, lib/stdio.in.h, lib/stdlib.in.h:
* lib/sys_stat.in.h, lib/unistd.in.h, lib/verify.h, m4/stdlib_h.m4:
Copy from Gnulib.
* lib/gnulib.mk.in: Regenerate.
This commit is contained in:
Paul Eggert 2019-01-27 16:20:03 -08:00
parent cc1c46e412
commit d81aa8516e
16 changed files with 156 additions and 50 deletions

View file

@ -2,7 +2,7 @@
# Attempt to guess a canonical system name.
# Copyright 1992-2019 Free Software Foundation, Inc.
timestamp='2019-01-01'
timestamp='2019-01-15'
# 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

20
build-aux/config.sub vendored
View file

@ -2,7 +2,7 @@
# Configuration validation subroutine script.
# Copyright 1992-2019 Free Software Foundation, Inc.
timestamp='2019-01-01'
timestamp='2019-01-05'
# 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
@ -111,6 +111,7 @@ case $# in
esac
# Split fields of configuration type
# shellcheck disable=SC2162
IFS="-" read field1 field2 field3 field4 <<EOF
$1
EOF
@ -918,6 +919,7 @@ case $basic_machine in
;;
*-*)
# shellcheck disable=SC2162
IFS="-" read cpu vendor <<EOF
$basic_machine
EOF
@ -1183,13 +1185,13 @@ case $cpu-$vendor in
| le32 | le64 \
| lm32 \
| m32c | m32r | m32rle \
| m5200 | m68000 | m680[012346]0 | m68360 | m683?2 | m68k | v70 | w65 \
| m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip \
| m5200 | m68000 | m680[012346]0 | m68360 | m683?2 | m68k \
| m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x \
| m88110 | m88k | maxq | mb | mcore | mep | metag \
| microblaze | microblazeel \
| mips | mipsbe | mipseb | mipsel | mipsle \
| mips16 \
| mips64 | mips64el \
| mips64 | mips64eb | mips64el \
| mips64octeon | mips64octeonel \
| mips64orion | mips64orionel \
| mips64r5900 | mips64r5900el \
@ -1216,11 +1218,12 @@ case $cpu-$vendor in
| nds32 | nds32le | nds32be \
| nfp \
| nios | nios2 | nios2eb | nios2el \
| none | np1 | ns16k | ns32k \
| none | np1 | ns16k | ns32k | nvptx \
| open8 \
| or1k* \
| or32 \
| orion \
| picochip \
| pdp10 | pdp11 | pj | pjl | pn | power \
| powerpc | powerpc64 | powerpc64le | powerpcle | powerpcspe \
| pru \
@ -1228,7 +1231,8 @@ case $cpu-$vendor in
| riscv | riscv32 | riscv64 \
| rl78 | romp | rs6000 | rx \
| score \
| sh | sh[1234] | sh[24]a | sh[24]ae[lb] | sh[23]e | she[lb] | sh[lb]e \
| sh | shl \
| sh[1234] | sh[24]a | sh[24]ae[lb] | sh[23]e | she[lb] | sh[lb]e \
| sh[1234]e[lb] | sh[12345][lb]e | sh[23]ele | sh64 | sh64le \
| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet \
| sparclite \
@ -1238,10 +1242,10 @@ case $cpu-$vendor in
| tic30 | tic4x | tic54x | tic55x | tic6x | tic80 \
| tron \
| ubicom32 \
| v850 | v850e | v850e1 | v850es | v850e2 | v850e2v3 \
| v70 | v850 | v850e | v850e1 | v850es | v850e2 | v850e2v3 \
| vax \
| visium \
| wasm32 \
| w65 | wasm32 \
| we32k \
| x86 | x86_64 | xc16x | xgate | xps100 \
| xstormy16 | xtensa* \

View file

@ -3,7 +3,8 @@
% Load plain if necessary, i.e., if running under initex.
\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
%
\def\texinfoversion{2018-12-28.17}
\def\texinfoversion{2019-01-03-15}
%
% Copyright 1985, 1986, 1988, 1990-2018 Free Software Foundation, Inc.
%
@ -5043,8 +5044,8 @@
\commondummyword\xref
}
% For testing: output @{ and @} in index sort strings as \{ and \}.
\newif\ifusebracesinindexes
% This does nothing, but for a time it was recommended to use
% \usebracesinindexestrue to be able to use braces in index entries.
\let\indexlbrace\relax
\let\indexrbrace\relax

View file

@ -340,7 +340,7 @@
semantics.
clang++ identifies itself as gcc-4.2, but has support for GNU inlining
semantics, that can be checked fot by using the __GNUC_STDC_INLINE_ and
semantics, that can be checked for by using the __GNUC_STDC_INLINE_ and
__GNUC_GNU_INLINE__ macro definitions. */
#if (!defined __cplusplus || __GNUC_PREREQ (4,3) \
|| (defined __clang__ && (defined __GNUC_STDC_INLINE__ \

View file

@ -545,7 +545,7 @@ rpl_fcntl_DUPFD_CLOEXEC (int fd, int target)
#ifdef __KLIBC__
static int
klibc_fcntl (int fd, int action, /* arg */...);
klibc_fcntl (int fd, int action, /* arg */...)
{
va_list arg_ptr;
int arg;

View file

@ -47,8 +47,8 @@
N_NAME_POINTER The nlist n_name element is a pointer,
not an array.
HAVE_STRUCT_NLIST_N_UN_N_NAME 'n_un.n_name' is member of 'struct nlist'.
LINUX_LDAV_FILE [__linux__, __CYGWIN__]: File containing
load averages.
LINUX_LDAV_FILE [__linux__, __ANDROID__, __CYGWIN__]: File
containing load averages.
Specific system predefines this file uses, aside from setting
default values if not emacs:
@ -65,7 +65,7 @@
UMAX4_3
VMS
_WIN32 Native Windows (possibly also defined on Cygwin)
__linux__ Linux: assumes /proc file system mounted.
__linux__, __ANDROID__ Linux: assumes /proc file system mounted.
Support from Michael K. Johnson.
__CYGWIN__ Cygwin emulates linux /proc/loadavg.
__NetBSD__ NetBSD: assumes /kern file system mounted.
@ -263,7 +263,7 @@
# ifdef LOAD_AVE_TYPE
# ifndef __VMS
# ifndef __linux__
# if !(defined __linux__ || defined __ANDROID__)
# ifndef NLIST_STRUCT
# include <a.out.h>
# else /* NLIST_STRUCT */
@ -286,7 +286,7 @@
# ifndef LDAV_SYMBOL
# define LDAV_SYMBOL "_avenrun"
# endif /* LDAV_SYMBOL */
# endif /* __linux__ */
# endif /* __linux__ || __ANDROID__ */
# else /* __VMS */
@ -359,7 +359,8 @@
# include <sys/dg_sys_info.h>
# endif
# if (defined __linux__ || defined __CYGWIN__ || defined SUNOS_5 \
# if (defined __linux__ || defined __ANDROID__ \
|| defined __CYGWIN__ || defined SUNOS_5 \
|| (defined LOAD_AVE_TYPE && ! defined __VMS))
# include <fcntl.h>
# endif
@ -388,7 +389,7 @@ static bool getloadavg_initialized;
/* Offset in kmem to seek to read load average, or 0 means invalid. */
static long offset;
# if ! defined __VMS && ! defined sgi && ! defined __linux__
# if ! defined __VMS && ! defined sgi && ! (defined __linux__ || defined __ANDROID__)
static struct nlist name_list[2];
# endif
@ -498,8 +499,8 @@ getloadavg (double loadavg[], int nelem)
}
# endif
# if !defined (LDAV_DONE) && (defined (__linux__) || defined (__CYGWIN__))
/* Linux without glibc, Cygwin */
# if !defined (LDAV_DONE) && (defined __linux__ || defined __ANDROID__ || defined __CYGWIN__)
/* Linux without glibc, Android, Cygwin */
# define LDAV_DONE
# undef LOAD_AVE_TYPE
@ -554,7 +555,7 @@ getloadavg (double loadavg[], int nelem)
return elem;
# endif /* __linux__ || __CYGWIN__ */
# endif /* __linux__ || __ANDROID__ || __CYGWIN__ */
# if !defined (LDAV_DONE) && defined (__NetBSD__) /* NetBSD < 0.9 */
# define LDAV_DONE

View file

@ -184,9 +184,16 @@ npgettext_aux (const char *domain,
#include <string.h>
#if (((__GNUC__ >= 3 || __GNUG__ >= 2) && !defined __STRICT_ANSI__) \
/* || (__STDC_VERSION__ == 199901L && !defined __HP_cc)
|| (__STDC_VERSION__ >= 201112L && !defined __STDC_NO_VLA__) */ )
/* GNULIB_NO_VLA can be defined to disable use of VLAs even if supported.
This relates to the -Wvla and -Wvla-larger-than warnings, enabled in
the default GCC many warnings set. This allows programs to disable use
of VLAs, which may be unintended, or may be awkward to support portably,
or may have security implications due to non-deterministic stack usage. */
#if (!defined GNULIB_NO_VLA \
&& (((__GNUC__ >= 3 || __GNUG__ >= 2) && !defined __STRICT_ANSI__) \
/* || (__STDC_VERSION__ == 199901L && !defined __HP_cc)
|| (__STDC_VERSION__ >= 201112L && !defined __STDC_NO_VLA__) */ ))
# define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS 1
#else
# define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS 0

View file

@ -197,6 +197,7 @@ DBUS_OBJ = @DBUS_OBJ@
DEFS = @DEFS@
DESLIB = @DESLIB@
DOCMISC_W32 = @DOCMISC_W32@
DUMPING = @DUMPING@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
@ -556,6 +557,7 @@ HAVE_GETTIMEOFDAY = @HAVE_GETTIMEOFDAY@
HAVE_GRANTPT = @HAVE_GRANTPT@
HAVE_GROUP_MEMBER = @HAVE_GROUP_MEMBER@
HAVE_IMAXDIV_T = @HAVE_IMAXDIV_T@
HAVE_INITSTATE = @HAVE_INITSTATE@
HAVE_INTTYPES_H = @HAVE_INTTYPES_H@
HAVE_LCHMOD = @HAVE_LCHMOD@
HAVE_LCHOWN = @HAVE_LCHOWN@
@ -566,6 +568,7 @@ HAVE_LSTAT = @HAVE_LSTAT@
HAVE_MAKEINFO = @HAVE_MAKEINFO@
HAVE_MAX_ALIGN_T = @HAVE_MAX_ALIGN_T@
HAVE_MBSLEN = @HAVE_MBSLEN@
HAVE_MBTOWC = @HAVE_MBTOWC@
HAVE_MEMCHR = @HAVE_MEMCHR@
HAVE_MEMPCPY = @HAVE_MEMPCPY@
HAVE_MKDIRAT = @HAVE_MKDIRAT@
@ -613,6 +616,7 @@ HAVE_SCANDIR = @HAVE_SCANDIR@
HAVE_SECURE_GETENV = @HAVE_SECURE_GETENV@
HAVE_SETENV = @HAVE_SETENV@
HAVE_SETHOSTNAME = @HAVE_SETHOSTNAME@
HAVE_SETSTATE = @HAVE_SETSTATE@
HAVE_SIGACTION = @HAVE_SIGACTION@
HAVE_SIGHANDLER_T = @HAVE_SIGHANDLER_T@
HAVE_SIGINFO_T = @HAVE_SIGINFO_T@
@ -859,6 +863,7 @@ REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@
REPLACE_GETPASS = @REPLACE_GETPASS@
REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@
REPLACE_GMTIME = @REPLACE_GMTIME@
REPLACE_INITSTATE = @REPLACE_INITSTATE@
REPLACE_ISATTY = @REPLACE_ISATTY@
REPLACE_LCHOWN = @REPLACE_LCHOWN@
REPLACE_LINK = @REPLACE_LINK@
@ -894,6 +899,7 @@ REPLACE_PUTENV = @REPLACE_PUTENV@
REPLACE_PWRITE = @REPLACE_PWRITE@
REPLACE_QSORT_R = @REPLACE_QSORT_R@
REPLACE_RAISE = @REPLACE_RAISE@
REPLACE_RANDOM = @REPLACE_RANDOM@
REPLACE_RANDOM_R = @REPLACE_RANDOM_R@
REPLACE_READ = @REPLACE_READ@
REPLACE_READLINK = @REPLACE_READLINK@
@ -906,6 +912,7 @@ REPLACE_RENAMEAT = @REPLACE_RENAMEAT@
REPLACE_RMDIR = @REPLACE_RMDIR@
REPLACE_SELECT = @REPLACE_SELECT@
REPLACE_SETENV = @REPLACE_SETENV@
REPLACE_SETSTATE = @REPLACE_SETSTATE@
REPLACE_SLEEP = @REPLACE_SLEEP@
REPLACE_SNPRINTF = @REPLACE_SNPRINTF@
REPLACE_SPRINTF = @REPLACE_SPRINTF@
@ -952,7 +959,6 @@ REPLACE_WRITE = @REPLACE_WRITE@
RSVG_CFLAGS = @RSVG_CFLAGS@
RSVG_LIBS = @RSVG_LIBS@
SEPCHAR = @SEPCHAR@
SETFATTR = @SETFATTR@
SETTINGS_CFLAGS = @SETTINGS_CFLAGS@
SETTINGS_LIBS = @SETTINGS_LIBS@
SHELL = @SHELL@
@ -1009,6 +1015,7 @@ XMKMF = @XMKMF@
XOBJ = @XOBJ@
XRANDR_CFLAGS = @XRANDR_CFLAGS@
XRANDR_LIBS = @XRANDR_LIBS@
XRENDER_LIBS = @XRENDER_LIBS@
XWIDGETS_OBJ = @XWIDGETS_OBJ@
X_TOOLKIT_TYPE = @X_TOOLKIT_TYPE@
ac_ct_CC = @ac_ct_CC@
@ -2552,7 +2559,9 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \
-e 's|@''HAVE_DECL_GETLOADAVG''@|$(HAVE_DECL_GETLOADAVG)|g' \
-e 's|@''HAVE_GETSUBOPT''@|$(HAVE_GETSUBOPT)|g' \
-e 's|@''HAVE_GRANTPT''@|$(HAVE_GRANTPT)|g' \
-e 's|@''HAVE_INITSTATE''@|$(HAVE_INITSTATE)|g' \
-e 's|@''HAVE_DECL_INITSTATE''@|$(HAVE_DECL_INITSTATE)|g' \
-e 's|@''HAVE_MBTOWC''@|$(HAVE_MBTOWC)|g' \
-e 's|@''HAVE_MKDTEMP''@|$(HAVE_MKDTEMP)|g' \
-e 's|@''HAVE_MKOSTEMP''@|$(HAVE_MKOSTEMP)|g' \
-e 's|@''HAVE_MKOSTEMPS''@|$(HAVE_MKOSTEMPS)|g' \
@ -2570,6 +2579,7 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \
-e 's|@''HAVE_RPMATCH''@|$(HAVE_RPMATCH)|g' \
-e 's|@''HAVE_SECURE_GETENV''@|$(HAVE_SECURE_GETENV)|g' \
-e 's|@''HAVE_DECL_SETENV''@|$(HAVE_DECL_SETENV)|g' \
-e 's|@''HAVE_SETSTATE''@|$(HAVE_SETSTATE)|g' \
-e 's|@''HAVE_DECL_SETSTATE''@|$(HAVE_DECL_SETSTATE)|g' \
-e 's|@''HAVE_STRTOD''@|$(HAVE_STRTOD)|g' \
-e 's|@''HAVE_STRTOLL''@|$(HAVE_STRTOLL)|g' \
@ -2580,6 +2590,7 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \
-e 's|@''HAVE_DECL_UNSETENV''@|$(HAVE_DECL_UNSETENV)|g' \
-e 's|@''REPLACE_CALLOC''@|$(REPLACE_CALLOC)|g' \
-e 's|@''REPLACE_CANONICALIZE_FILE_NAME''@|$(REPLACE_CANONICALIZE_FILE_NAME)|g' \
-e 's|@''REPLACE_INITSTATE''@|$(REPLACE_INITSTATE)|g' \
-e 's|@''REPLACE_MALLOC''@|$(REPLACE_MALLOC)|g' \
-e 's|@''REPLACE_MBTOWC''@|$(REPLACE_MBTOWC)|g' \
-e 's|@''REPLACE_MKSTEMP''@|$(REPLACE_MKSTEMP)|g' \
@ -2587,10 +2598,12 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \
-e 's|@''REPLACE_PTSNAME_R''@|$(REPLACE_PTSNAME_R)|g' \
-e 's|@''REPLACE_PUTENV''@|$(REPLACE_PUTENV)|g' \
-e 's|@''REPLACE_QSORT_R''@|$(REPLACE_QSORT_R)|g' \
-e 's|@''REPLACE_RANDOM''@|$(REPLACE_RANDOM)|g' \
-e 's|@''REPLACE_RANDOM_R''@|$(REPLACE_RANDOM_R)|g' \
-e 's|@''REPLACE_REALLOC''@|$(REPLACE_REALLOC)|g' \
-e 's|@''REPLACE_REALPATH''@|$(REPLACE_REALPATH)|g' \
-e 's|@''REPLACE_SETENV''@|$(REPLACE_SETENV)|g' \
-e 's|@''REPLACE_SETSTATE''@|$(REPLACE_SETSTATE)|g' \
-e 's|@''REPLACE_STRTOD''@|$(REPLACE_STRTOD)|g' \
-e 's|@''REPLACE_UNSETENV''@|$(REPLACE_UNSETENV)|g' \
-e 's|@''REPLACE_WCTOMB''@|$(REPLACE_WCTOMB)|g' \

View file

@ -2207,7 +2207,7 @@ sift_states_iter_mb (const re_match_context_t *mctx, re_sift_context_t *sctx,
dfa->nexts[node_idx]))
/* The node can't accept the "multi byte", or the
destination was already thrown away, then the node
could't accept the current input "multi byte". */
couldn't accept the current input "multi byte". */
naccepted = 0;
/* Otherwise, it is sure that the node could accept
'naccepted' bytes input. */

View file

@ -61,6 +61,11 @@
# define _r pub._r
# define _w pub._w
# elif defined __ANDROID__ /* Android */
# ifdef __LP64__
# define _gl_flags_file_t int
# else
# define _gl_flags_file_t short
# endif
/* Up to this commit from 2015-10-12
<https://android.googlesource.com/platform/bionic.git/+/f0141dfab10a4b332769d52fa76631a64741297a>
the innards of FILE were public, and fp_ub could be defined like for OpenBSD,
@ -70,8 +75,8 @@
# define fp_ ((struct { unsigned char *_p; \
int _r; \
int _w; \
int _flags; \
int _file; \
_gl_flags_file_t _flags; \
_gl_flags_file_t _file; \
struct { unsigned char *_base; size_t _size; } _bf; \
int _lbfsize; \
void *_cookie; \

View file

@ -118,6 +118,13 @@
# include <unistd.h>
#endif
/* Android 4.3 declares renameat in <sys/stat.h>, not in <stdio.h>. */
/* But in any case avoid namespace pollution on glibc systems. */
#if (@GNULIB_RENAMEAT@ || defined GNULIB_POSIXCHECK) && defined __ANDROID__ \
&& ! defined __GLIBC__
# include <sys/stat.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. */

View file

@ -306,9 +306,18 @@ _GL_WARN_ON_USE (malloc, "malloc is not POSIX compliant everywhere - "
_GL_FUNCDECL_RPL (mbtowc, int, (wchar_t *pwc, const char *s, size_t n));
_GL_CXXALIAS_RPL (mbtowc, int, (wchar_t *pwc, const char *s, size_t n));
# else
# if !@HAVE_MBTOWC@
_GL_FUNCDECL_SYS (mbtowc, int, (wchar_t *pwc, const char *s, size_t n));
# endif
_GL_CXXALIAS_SYS (mbtowc, int, (wchar_t *pwc, const char *s, size_t n));
# endif
_GL_CXXALIASWARN (mbtowc);
#elif defined GNULIB_POSIXCHECK
# undef mbtowc
# if HAVE_RAW_DECL_MBTOWC
_GL_WARN_ON_USE (mbtowc, "mbtowc is not portable - "
"use gnulib module mbtowc for portability");
# endif
#endif
#if @GNULIB_MKDTEMP@
@ -573,10 +582,19 @@ _GL_WARN_ON_USE (qsort_r, "qsort_r is not portable - "
#if @GNULIB_RANDOM@
# if !@HAVE_RANDOM@
# if @REPLACE_RANDOM@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef random
# define random rpl_random
# endif
_GL_FUNCDECL_RPL (random, long, (void));
_GL_CXXALIAS_RPL (random, long, (void));
# else
# if !@HAVE_RANDOM@
_GL_FUNCDECL_SYS (random, long, (void));
# endif
# endif
_GL_CXXALIAS_SYS (random, long, (void));
# endif
_GL_CXXALIASWARN (random);
#elif defined GNULIB_POSIXCHECK
# undef random
@ -587,10 +605,19 @@ _GL_WARN_ON_USE (random, "random is unportable - "
#endif
#if @GNULIB_RANDOM@
# if !@HAVE_RANDOM@
# if @REPLACE_RANDOM@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef srandom
# define srandom rpl_srandom
# endif
_GL_FUNCDECL_RPL (srandom, void, (unsigned int seed));
_GL_CXXALIAS_RPL (srandom, void, (unsigned int seed));
# else
# if !@HAVE_RANDOM@
_GL_FUNCDECL_SYS (srandom, void, (unsigned int seed));
# endif
# endif
_GL_CXXALIAS_SYS (srandom, void, (unsigned int seed));
# endif
_GL_CXXALIASWARN (srandom);
#elif defined GNULIB_POSIXCHECK
# undef srandom
@ -601,31 +628,52 @@ _GL_WARN_ON_USE (srandom, "srandom is unportable - "
#endif
#if @GNULIB_RANDOM@
# if !@HAVE_RANDOM@ || !@HAVE_DECL_INITSTATE@
# if @REPLACE_INITSTATE@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef initstate
# define initstate rpl_initstate
# endif
_GL_FUNCDECL_RPL (initstate, char *,
(unsigned int seed, char *buf, size_t buf_size)
_GL_ARG_NONNULL ((2)));
_GL_CXXALIAS_RPL (initstate, char *,
(unsigned int seed, char *buf, size_t buf_size));
# else
# if !@HAVE_INITSTATE@ || !@HAVE_DECL_INITSTATE@
_GL_FUNCDECL_SYS (initstate, char *,
(unsigned int seed, char *buf, size_t buf_size)
_GL_ARG_NONNULL ((2)));
# endif
# endif
_GL_CXXALIAS_SYS (initstate, char *,
(unsigned int seed, char *buf, size_t buf_size));
# endif
_GL_CXXALIASWARN (initstate);
#elif defined GNULIB_POSIXCHECK
# undef initstate
# if HAVE_RAW_DECL_INITSTATE_R
# if HAVE_RAW_DECL_INITSTATE
_GL_WARN_ON_USE (initstate, "initstate is unportable - "
"use gnulib module random for portability");
# endif
#endif
#if @GNULIB_RANDOM@
# if !@HAVE_RANDOM@ || !@HAVE_DECL_SETSTATE@
# if @REPLACE_SETSTATE@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef setstate
# define setstate rpl_setstate
# endif
_GL_FUNCDECL_RPL (setstate, char *, (char *arg_state) _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (setstate, char *, (char *arg_state));
# else
# if !@HAVE_SETSTATE@ || !@HAVE_DECL_SETSTATE@
_GL_FUNCDECL_SYS (setstate, char *, (char *arg_state) _GL_ARG_NONNULL ((1)));
# endif
# endif
_GL_CXXALIAS_SYS (setstate, char *, (char *arg_state));
# endif
_GL_CXXALIASWARN (setstate);
#elif defined GNULIB_POSIXCHECK
# undef setstate
# if HAVE_RAW_DECL_SETSTATE_R
# if HAVE_RAW_DECL_SETSTATE
_GL_WARN_ON_USE (setstate, "setstate is unportable - "
"use gnulib module random for portability");
# endif

View file

@ -54,9 +54,16 @@
/* The definition of _GL_WARN_ON_USE is copied here. */
/* Before doing "#define mknod rpl_mknod" below, we need to include all
headers that may declare mknod(). OS/2 kLIBC declares mknod() in
<unistd.h>, not in <sys/stat.h>. */
#ifdef __KLIBC__
# include <unistd.h>
#endif
/* Before doing "#define mkdir rpl_mkdir" below, we need to include all
headers that may declare mkdir(). Native Windows platforms declare mkdir
in <io.h> and/or <direct.h>, not in <unistd.h>. */
in <io.h> and/or <direct.h>, not in <sys/stat.h>. */
#if defined _WIN32 && ! defined __CYGWIN__
# include <io.h> /* mingw32, mingw64 */
# include <direct.h> /* mingw64, MSVC 9 */

View file

@ -68,9 +68,11 @@
# include <stdio.h>
#endif
/* Cygwin 1.7.1 declares unlinkat in <fcntl.h>, not in <unistd.h>. */
/* Cygwin 1.7.1 and Android 4.3 declare unlinkat in <fcntl.h>, not in
<unistd.h>. */
/* But avoid namespace pollution on glibc systems. */
#if (@GNULIB_UNLINKAT@ || defined GNULIB_POSIXCHECK) && defined __CYGWIN__ \
#if (@GNULIB_UNLINKAT@ || defined GNULIB_POSIXCHECK) \
&& (defined __CYGWIN__ || defined __ANDROID__) \
&& ! defined __GLIBC__
# include <fcntl.h>
#endif
@ -113,6 +115,13 @@
# include <netdb.h>
#endif
/* Android 4.3 declares fchownat in <sys/stat.h>, not in <unistd.h>. */
/* But avoid namespace pollution on glibc systems. */
#if (@GNULIB_FCHOWNAT@ || defined GNULIB_POSIXCHECK) && defined __ANDROID__ \
&& !defined __GLIBC__
# include <sys/stat.h>
#endif
/* MSVC defines off_t in <sys/types.h>.
May also define off_t to a 64-bit type on native Windows. */
#if !@HAVE_UNISTD_H@ || @WINDOWS_64_BIT_OFF_T@

View file

@ -26,7 +26,7 @@
here generates easier-to-read diagnostics when verify (R) fails.
Define _GL_HAVE_STATIC_ASSERT to 1 if static_assert works as per C++11.
This will likely be supported by future GCC versions, in C++ mode.
This is supported by GCC 6.1.0 and later, in C++ mode.
Use this only with GCC. If we were willing to slow 'configure'
down we could also use it with other compilers, but since this
@ -36,9 +36,7 @@
&& !defined __cplusplus)
# define _GL_HAVE__STATIC_ASSERT 1
#endif
/* The condition (99 < __GNUC__) is temporary, until we know about the
first G++ release that supports static_assert. */
#if (99 < __GNUC__) && defined __cplusplus
#if (6 <= __GNUC__) && defined __cplusplus
# define _GL_HAVE_STATIC_ASSERT 1
#endif

View file

@ -1,4 +1,4 @@
# stdlib_h.m4 serial 45
# stdlib_h.m4 serial 47
dnl Copyright (C) 2007-2019 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@ -23,7 +23,7 @@ AC_DEFUN([gl_STDLIB_H],
# include <random.h>
#endif
]], [_Exit atoll canonicalize_file_name getloadavg getsubopt grantpt
initstate initstate_r mkdtemp mkostemp mkostemps mkstemp mkstemps
initstate initstate_r mbtowc mkdtemp mkostemp mkostemps mkstemp mkstemps
posix_openpt ptsname ptsname_r qsort_r random random_r reallocarray
realpath rpmatch secure_getenv setenv setstate setstate_r srandom
srandom_r strtod strtoll strtoull unlockpt unsetenv])
@ -81,7 +81,9 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS],
HAVE_DECL_GETLOADAVG=1; AC_SUBST([HAVE_DECL_GETLOADAVG])
HAVE_GETSUBOPT=1; AC_SUBST([HAVE_GETSUBOPT])
HAVE_GRANTPT=1; AC_SUBST([HAVE_GRANTPT])
HAVE_INITSTATE=1; AC_SUBST([HAVE_INITSTATE])
HAVE_DECL_INITSTATE=1; AC_SUBST([HAVE_DECL_INITSTATE])
HAVE_MBTOWC=1; AC_SUBST([HAVE_MBTOWC])
HAVE_MKDTEMP=1; AC_SUBST([HAVE_MKDTEMP])
HAVE_MKOSTEMP=1; AC_SUBST([HAVE_MKOSTEMP])
HAVE_MKOSTEMPS=1; AC_SUBST([HAVE_MKOSTEMPS])
@ -100,6 +102,7 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS],
HAVE_SECURE_GETENV=1; AC_SUBST([HAVE_SECURE_GETENV])
HAVE_SETENV=1; AC_SUBST([HAVE_SETENV])
HAVE_DECL_SETENV=1; AC_SUBST([HAVE_DECL_SETENV])
HAVE_SETSTATE=1; AC_SUBST([HAVE_SETSTATE])
HAVE_DECL_SETSTATE=1; AC_SUBST([HAVE_DECL_SETSTATE])
HAVE_STRTOD=1; AC_SUBST([HAVE_STRTOD])
HAVE_STRTOLL=1; AC_SUBST([HAVE_STRTOLL])
@ -110,6 +113,7 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS],
HAVE_DECL_UNSETENV=1; AC_SUBST([HAVE_DECL_UNSETENV])
REPLACE_CALLOC=0; AC_SUBST([REPLACE_CALLOC])
REPLACE_CANONICALIZE_FILE_NAME=0; AC_SUBST([REPLACE_CANONICALIZE_FILE_NAME])
REPLACE_INITSTATE=0; AC_SUBST([REPLACE_INITSTATE])
REPLACE_MALLOC=0; AC_SUBST([REPLACE_MALLOC])
REPLACE_MBTOWC=0; AC_SUBST([REPLACE_MBTOWC])
REPLACE_MKSTEMP=0; AC_SUBST([REPLACE_MKSTEMP])
@ -117,10 +121,12 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS],
REPLACE_PTSNAME_R=0; AC_SUBST([REPLACE_PTSNAME_R])
REPLACE_PUTENV=0; AC_SUBST([REPLACE_PUTENV])
REPLACE_QSORT_R=0; AC_SUBST([REPLACE_QSORT_R])
REPLACE_RANDOM=0; AC_SUBST([REPLACE_RANDOM])
REPLACE_RANDOM_R=0; AC_SUBST([REPLACE_RANDOM_R])
REPLACE_REALLOC=0; AC_SUBST([REPLACE_REALLOC])
REPLACE_REALPATH=0; AC_SUBST([REPLACE_REALPATH])
REPLACE_SETENV=0; AC_SUBST([REPLACE_SETENV])
REPLACE_SETSTATE=0; AC_SUBST([REPLACE_SETSTATE])
REPLACE_STRTOD=0; AC_SUBST([REPLACE_STRTOD])
REPLACE_UNSETENV=0; AC_SUBST([REPLACE_UNSETENV])
REPLACE_WCTOMB=0; AC_SUBST([REPLACE_WCTOMB])