mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-29 19:30:36 +02:00
Update Gnulib to v0.0-7695-g26c0590.
* gnulib-local/m4/canonicalize.m4.diff: Remove. * Makefile.am (EXTRA_DIST): Adjust accordingly.
This commit is contained in:
parent
44cd55752a
commit
7ae4e75af5
34 changed files with 1116 additions and 796 deletions
|
@ -155,7 +155,7 @@ EXTRA_DIST += arpa_inet.in.h
|
|||
|
||||
## begin gnulib module binary-io
|
||||
|
||||
libgnu_la_SOURCES += binary-io.h
|
||||
libgnu_la_SOURCES += binary-io.h binary-io.c
|
||||
|
||||
## end gnulib module binary-io
|
||||
|
||||
|
@ -614,7 +614,7 @@ EXTRA_DIST += $(top_srcdir)/build-aux/gnu-web-doc-update
|
|||
|
||||
distclean-local: clean-GNUmakefile
|
||||
clean-GNUmakefile:
|
||||
test x'$(VPATH)' != x && rm -f $(top_builddir)/GNUmakefile || :
|
||||
test '$(srcdir)' = . || rm -f $(top_builddir)/GNUmakefile
|
||||
|
||||
EXTRA_DIST += $(top_srcdir)/GNUmakefile
|
||||
|
||||
|
@ -1795,6 +1795,7 @@ EXTRA_libgnu_la_SOURCES += stat.c
|
|||
|
||||
## begin gnulib module stat-time
|
||||
|
||||
libgnu_la_SOURCES += stat-time.c
|
||||
|
||||
EXTRA_DIST += stat-time.h
|
||||
|
||||
|
@ -2133,6 +2134,7 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \
|
|||
-e 's|@''REPLACE_MALLOC''@|$(REPLACE_MALLOC)|g' \
|
||||
-e 's|@''REPLACE_MBTOWC''@|$(REPLACE_MBTOWC)|g' \
|
||||
-e 's|@''REPLACE_MKSTEMP''@|$(REPLACE_MKSTEMP)|g' \
|
||||
-e 's|@''REPLACE_PTSNAME''@|$(REPLACE_PTSNAME)|g' \
|
||||
-e 's|@''REPLACE_PTSNAME_R''@|$(REPLACE_PTSNAME_R)|g' \
|
||||
-e 's|@''REPLACE_PUTENV''@|$(REPLACE_PUTENV)|g' \
|
||||
-e 's|@''REPLACE_RANDOM_R''@|$(REPLACE_RANDOM_R)|g' \
|
||||
|
@ -3008,7 +3010,7 @@ EXTRA_libgnu_la_SOURCES += write.c
|
|||
|
||||
## begin gnulib module xsize
|
||||
|
||||
libgnu_la_SOURCES += xsize.h
|
||||
libgnu_la_SOURCES += xsize.h xsize.c
|
||||
|
||||
## end gnulib module xsize
|
||||
|
||||
|
|
3
lib/binary-io.c
Normal file
3
lib/binary-io.c
Normal file
|
@ -0,0 +1,3 @@
|
|||
#include <config.h>
|
||||
#define BINARY_IO_INLINE _GL_EXTERN_INLINE
|
||||
#include "binary-io.h"
|
|
@ -25,6 +25,11 @@
|
|||
so we include it here first. */
|
||||
#include <stdio.h>
|
||||
|
||||
_GL_INLINE_HEADER_BEGIN
|
||||
#ifndef BINARY_IO_INLINE
|
||||
# define BINARY_IO_INLINE _GL_INLINE
|
||||
#endif
|
||||
|
||||
/* set_binary_mode (fd, mode)
|
||||
sets the binary/text I/O mode of file descriptor fd to the given mode
|
||||
(must be O_BINARY or O_TEXT) and returns the previous mode. */
|
||||
|
@ -39,9 +44,9 @@
|
|||
# endif
|
||||
#else
|
||||
/* On reasonable systems, binary I/O is the only choice. */
|
||||
/* Use an inline function rather than a macro, to avoid gcc warnings
|
||||
/* Use a function rather than a macro, to avoid gcc warnings
|
||||
"warning: statement with no effect". */
|
||||
static inline int
|
||||
BINARY_IO_INLINE int
|
||||
set_binary_mode (int fd, int mode)
|
||||
{
|
||||
(void) fd;
|
||||
|
@ -62,4 +67,6 @@ set_binary_mode (int fd, int mode)
|
|||
# define SET_BINARY(fd) ((void) set_binary_mode (fd, O_BINARY))
|
||||
#endif
|
||||
|
||||
_GL_INLINE_HEADER_END
|
||||
|
||||
#endif /* _BINARY_H */
|
||||
|
|
|
@ -270,5 +270,10 @@
|
|||
# define GNULIB_defined_ENOTRECOVERABLE 1
|
||||
# endif
|
||||
|
||||
# ifndef EILSEQ
|
||||
# define EILSEQ 2015
|
||||
# define GNULIB_defined_EILSEQ 1
|
||||
# endif
|
||||
|
||||
#endif /* _@GUARD_PREFIX@_ERRNO_H */
|
||||
#endif /* _@GUARD_PREFIX@_ERRNO_H */
|
||||
|
|
|
@ -216,6 +216,10 @@ _GL_WARN_ON_USE (openat, "openat is not portable - "
|
|||
# define O_EXEC O_RDONLY /* This is often close enough in older systems. */
|
||||
#endif
|
||||
|
||||
#ifndef O_IGNORE_CTTY
|
||||
# define O_IGNORE_CTTY 0
|
||||
#endif
|
||||
|
||||
#ifndef O_NDELAY
|
||||
# define O_NDELAY 0
|
||||
#endif
|
||||
|
@ -249,10 +253,18 @@ _GL_WARN_ON_USE (openat, "openat is not portable - "
|
|||
# define O_NOFOLLOW 0
|
||||
#endif
|
||||
|
||||
#ifndef O_NOLINK
|
||||
# define O_NOLINK 0
|
||||
#endif
|
||||
|
||||
#ifndef O_NOLINKS
|
||||
# define O_NOLINKS 0
|
||||
#endif
|
||||
|
||||
#ifndef O_NOTRANS
|
||||
# define O_NOTRANS 0
|
||||
#endif
|
||||
|
||||
#ifndef O_RSYNC
|
||||
# define O_RSYNC 0
|
||||
#endif
|
||||
|
@ -269,7 +281,7 @@ _GL_WARN_ON_USE (openat, "openat is not portable - "
|
|||
# define O_TTY_INIT 0
|
||||
#endif
|
||||
|
||||
#if O_ACCMODE != (O_RDONLY | O_WRONLY | O_RDWR | O_EXEC | O_SEARCH)
|
||||
#if ~O_ACCMODE & (O_RDONLY | O_WRONLY | O_RDWR | O_EXEC | O_SEARCH)
|
||||
# undef O_ACCMODE
|
||||
# define O_ACCMODE (O_RDONLY | O_WRONLY | O_RDWR | O_EXEC | O_SEARCH)
|
||||
#endif
|
||||
|
|
|
@ -183,9 +183,12 @@ npgettext_aux (const char *domain,
|
|||
|
||||
#include <string.h>
|
||||
|
||||
#define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS \
|
||||
(((__GNUC__ >= 3 || __GNUG__ >= 2) && !defined __STRICT_ANSI__) \
|
||||
/* || __STDC_VERSION__ >= 199901L */ )
|
||||
#if (((__GNUC__ >= 3 || __GNUG__ >= 2) && !defined __STRICT_ANSI__) \
|
||||
/* || __STDC_VERSION__ >= 199901L */ )
|
||||
# define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS 1
|
||||
#else
|
||||
# define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS 0
|
||||
#endif
|
||||
|
||||
#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
|
||||
#include <stdlib.h>
|
||||
|
|
|
@ -542,6 +542,13 @@ locale_charset (void)
|
|||
if (codeset[0] == '\0')
|
||||
codeset = "ASCII";
|
||||
|
||||
#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)
|
||||
codeset = "ASCII";
|
||||
#endif
|
||||
|
||||
return codeset;
|
||||
}
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ extern "C" {
|
|||
and a page size can be as small as 4096 bytes. So we cannot safely
|
||||
allocate anything larger than 4096 bytes. Also care for the possibility
|
||||
of a few compiler-allocated temporary stack slots.
|
||||
This must be a macro, not an inline function. */
|
||||
This must be a macro, not a function. */
|
||||
# define safe_alloca(N) ((N) < 4032 ? alloca (N) : NULL)
|
||||
#else
|
||||
# define safe_alloca(N) ((void) (N), NULL)
|
||||
|
|
|
@ -735,7 +735,7 @@ re_search_internal (const regex_t *preg,
|
|||
mctx.input.tip_context = (eflags & REG_NOTBOL) ? CONTEXT_BEGBUF
|
||||
: CONTEXT_NEWLINE | CONTEXT_BEGBUF;
|
||||
|
||||
/* Check incrementally whether of not the input string match. */
|
||||
/* Check incrementally whether the input string matches. */
|
||||
incr = (last_start < start) ? -1 : 1;
|
||||
left_lim = (last_start < start) ? last_start : start;
|
||||
right_lim = (last_start < start) ? start : last_start;
|
||||
|
|
3
lib/stat-time.c
Normal file
3
lib/stat-time.c
Normal file
|
@ -0,0 +1,3 @@
|
|||
#include <config.h>
|
||||
#define _GL_STAT_TIME_INLINE _GL_EXTERN_INLINE
|
||||
#include "stat-time.h"
|
|
@ -23,6 +23,11 @@
|
|||
#include <sys/stat.h>
|
||||
#include <time.h>
|
||||
|
||||
_GL_INLINE_HEADER_BEGIN
|
||||
#ifndef _GL_STAT_TIME_INLINE
|
||||
# define _GL_STAT_TIME_INLINE _GL_INLINE
|
||||
#endif
|
||||
|
||||
/* STAT_TIMESPEC (ST, ST_XTIM) is the ST_XTIM member for *ST of type
|
||||
struct timespec, if available. If not, then STAT_TIMESPEC_NS (ST,
|
||||
ST_XTIM) is the nanosecond component of the ST_XTIM member for *ST,
|
||||
|
@ -46,7 +51,7 @@
|
|||
#endif
|
||||
|
||||
/* Return the nanosecond component of *ST's access time. */
|
||||
static inline long int
|
||||
_GL_STAT_TIME_INLINE long int
|
||||
get_stat_atime_ns (struct stat const *st)
|
||||
{
|
||||
# if defined STAT_TIMESPEC
|
||||
|
@ -59,7 +64,7 @@ get_stat_atime_ns (struct stat const *st)
|
|||
}
|
||||
|
||||
/* Return the nanosecond component of *ST's status change time. */
|
||||
static inline long int
|
||||
_GL_STAT_TIME_INLINE long int
|
||||
get_stat_ctime_ns (struct stat const *st)
|
||||
{
|
||||
# if defined STAT_TIMESPEC
|
||||
|
@ -72,7 +77,7 @@ get_stat_ctime_ns (struct stat const *st)
|
|||
}
|
||||
|
||||
/* Return the nanosecond component of *ST's data modification time. */
|
||||
static inline long int
|
||||
_GL_STAT_TIME_INLINE long int
|
||||
get_stat_mtime_ns (struct stat const *st)
|
||||
{
|
||||
# if defined STAT_TIMESPEC
|
||||
|
@ -85,7 +90,7 @@ get_stat_mtime_ns (struct stat const *st)
|
|||
}
|
||||
|
||||
/* Return the nanosecond component of *ST's birth time. */
|
||||
static inline long int
|
||||
_GL_STAT_TIME_INLINE long int
|
||||
get_stat_birthtime_ns (struct stat const *st)
|
||||
{
|
||||
# if defined HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC
|
||||
|
@ -100,7 +105,7 @@ get_stat_birthtime_ns (struct stat const *st)
|
|||
}
|
||||
|
||||
/* Return *ST's access time. */
|
||||
static inline struct timespec
|
||||
_GL_STAT_TIME_INLINE struct timespec
|
||||
get_stat_atime (struct stat const *st)
|
||||
{
|
||||
#ifdef STAT_TIMESPEC
|
||||
|
@ -114,7 +119,7 @@ get_stat_atime (struct stat const *st)
|
|||
}
|
||||
|
||||
/* Return *ST's status change time. */
|
||||
static inline struct timespec
|
||||
_GL_STAT_TIME_INLINE struct timespec
|
||||
get_stat_ctime (struct stat const *st)
|
||||
{
|
||||
#ifdef STAT_TIMESPEC
|
||||
|
@ -128,7 +133,7 @@ get_stat_ctime (struct stat const *st)
|
|||
}
|
||||
|
||||
/* Return *ST's data modification time. */
|
||||
static inline struct timespec
|
||||
_GL_STAT_TIME_INLINE struct timespec
|
||||
get_stat_mtime (struct stat const *st)
|
||||
{
|
||||
#ifdef STAT_TIMESPEC
|
||||
|
@ -143,7 +148,7 @@ get_stat_mtime (struct stat const *st)
|
|||
|
||||
/* Return *ST's birth time, if available; otherwise return a value
|
||||
with tv_sec and tv_nsec both equal to -1. */
|
||||
static inline struct timespec
|
||||
_GL_STAT_TIME_INLINE struct timespec
|
||||
get_stat_birthtime (struct stat const *st)
|
||||
{
|
||||
struct timespec t;
|
||||
|
@ -186,4 +191,6 @@ get_stat_birthtime (struct stat const *st)
|
|||
return t;
|
||||
}
|
||||
|
||||
_GL_INLINE_HEADER_END
|
||||
|
||||
#endif
|
||||
|
|
|
@ -66,24 +66,19 @@
|
|||
# undef true
|
||||
#endif
|
||||
|
||||
/* For the sake of symbolic names in gdb, we define true and false as
|
||||
enum constants, not only as macros.
|
||||
It is tempting to write
|
||||
typedef enum { false = 0, true = 1 } _Bool;
|
||||
so that gdb prints values of type 'bool' symbolically. But if we do
|
||||
this, values of type '_Bool' may promote to 'int' or 'unsigned int'
|
||||
(see ISO C 99 6.7.2.2.(4)); however, '_Bool' must promote to 'int'
|
||||
(see ISO C 99 6.3.1.1.(2)). So we add a negative value to the
|
||||
enum; this ensures that '_Bool' promotes to 'int'. */
|
||||
#if defined __cplusplus || (defined __BEOS__ && !defined __HAIKU__)
|
||||
#ifdef __cplusplus
|
||||
# define _Bool bool
|
||||
# define bool bool
|
||||
#else
|
||||
# if defined __BEOS__ && !defined __HAIKU__
|
||||
/* A compiler known to have 'bool'. */
|
||||
/* If the compiler already has both 'bool' and '_Bool', we can assume they
|
||||
are the same types. */
|
||||
# if !@HAVE__BOOL@
|
||||
# if !@HAVE__BOOL@
|
||||
typedef bool _Bool;
|
||||
# endif
|
||||
#else
|
||||
# if !defined __GNUC__
|
||||
# endif
|
||||
# else
|
||||
# if !defined __GNUC__
|
||||
/* If @HAVE__BOOL@:
|
||||
Some HP-UX cc and AIX IBM C compiler versions have compiler bugs when
|
||||
the built-in _Bool type is used. See
|
||||
|
@ -103,19 +98,35 @@ typedef bool _Bool;
|
|||
"Invalid enumerator. (badenum)" with HP-UX cc on Tru64.
|
||||
The only benefit of the enum, debuggability, is not important
|
||||
with these compilers. So use 'signed char' and no enum. */
|
||||
# define _Bool signed char
|
||||
# else
|
||||
# define _Bool signed char
|
||||
# else
|
||||
/* With this compiler, trust the _Bool type if the compiler has it. */
|
||||
# if !@HAVE__BOOL@
|
||||
# if !@HAVE__BOOL@
|
||||
/* For the sake of symbolic names in gdb, define true and false as
|
||||
enum constants, not only as macros.
|
||||
It is tempting to write
|
||||
typedef enum { false = 0, true = 1 } _Bool;
|
||||
so that gdb prints values of type 'bool' symbolically. But then
|
||||
values of type '_Bool' might promote to 'int' or 'unsigned int'
|
||||
(see ISO C 99 6.7.2.2.(4)); however, '_Bool' must promote to 'int'
|
||||
(see ISO C 99 6.3.1.1.(2)). So add a negative value to the
|
||||
enum; this ensures that '_Bool' promotes to 'int'. */
|
||||
typedef enum { _Bool_must_promote_to_int = -1, false = 0, true = 1 } _Bool;
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
# define bool _Bool
|
||||
#endif
|
||||
#define bool _Bool
|
||||
|
||||
/* The other macros must be usable in preprocessor directives. */
|
||||
#define false 0
|
||||
#define true 1
|
||||
#ifdef __cplusplus
|
||||
# define false false
|
||||
# define true true
|
||||
#else
|
||||
# define false 0
|
||||
# define true 1
|
||||
#endif
|
||||
|
||||
#define __bool_true_false_are_defined 1
|
||||
|
||||
#endif /* _GL_STDBOOL_H */
|
||||
|
|
|
@ -457,10 +457,19 @@ _GL_WARN_ON_USE (posix_openpt, "posix_openpt is not portable - "
|
|||
#if @GNULIB_PTSNAME@
|
||||
/* Return the pathname of the pseudo-terminal slave associated with
|
||||
the master FD is open on, or NULL on errors. */
|
||||
# if !@HAVE_PTSNAME@
|
||||
# if @REPLACE_PTSNAME@
|
||||
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
|
||||
# undef ptsname
|
||||
# define ptsname rpl_ptsname
|
||||
# endif
|
||||
_GL_FUNCDECL_RPL (ptsname, char *, (int fd));
|
||||
_GL_CXXALIAS_RPL (ptsname, char *, (int fd));
|
||||
# else
|
||||
# if !@HAVE_PTSNAME@
|
||||
_GL_FUNCDECL_SYS (ptsname, char *, (int fd));
|
||||
# endif
|
||||
# endif
|
||||
_GL_CXXALIAS_SYS (ptsname, char *, (int fd));
|
||||
# endif
|
||||
_GL_CXXALIASWARN (ptsname);
|
||||
#elif defined GNULIB_POSIXCHECK
|
||||
# undef ptsname
|
||||
|
|
|
@ -125,7 +125,7 @@
|
|||
extern int (*dummy (void)) [sizeof (struct {...})];
|
||||
|
||||
* GCC warns about duplicate declarations of the dummy function if
|
||||
-Wredundant_decls is used. GCC 4.3 and later have a builtin
|
||||
-Wredundant-decls is used. GCC 4.3 and later have a builtin
|
||||
__COUNTER__ macro that can let us generate unique identifiers for
|
||||
each dummy function, to suppress this warning.
|
||||
|
||||
|
@ -133,6 +133,10 @@
|
|||
which do not support _Static_assert, also do not warn about the
|
||||
last declaration mentioned above.
|
||||
|
||||
* GCC warns if -Wnested-externs is enabled and verify() is used
|
||||
within a function body; but inside a function, you can always
|
||||
arrange to use verify_expr() instead.
|
||||
|
||||
* In C++, any struct definition inside sizeof is invalid.
|
||||
Use a template type to work around the problem. */
|
||||
|
||||
|
|
3
lib/xsize.c
Normal file
3
lib/xsize.c
Normal file
|
@ -0,0 +1,3 @@
|
|||
#include <config.h>
|
||||
#define XSIZE_INLINE _GL_EXTERN_INLINE
|
||||
#include "xsize.h"
|
17
lib/xsize.h
17
lib/xsize.h
|
@ -27,6 +27,11 @@
|
|||
# include <stdint.h>
|
||||
#endif
|
||||
|
||||
_GL_INLINE_HEADER_BEGIN
|
||||
#ifndef XSIZE_INLINE
|
||||
# define XSIZE_INLINE _GL_INLINE
|
||||
#endif
|
||||
|
||||
/* The size of memory objects is often computed through expressions of
|
||||
type size_t. Example:
|
||||
void* p = malloc (header_size + n * element_size).
|
||||
|
@ -48,7 +53,7 @@
|
|||
((N) <= SIZE_MAX ? (size_t) (N) : SIZE_MAX)
|
||||
|
||||
/* Sum of two sizes, with overflow check. */
|
||||
static inline size_t
|
||||
XSIZE_INLINE size_t
|
||||
#if __GNUC__ >= 3
|
||||
__attribute__ ((__pure__))
|
||||
#endif
|
||||
|
@ -59,7 +64,7 @@ xsum (size_t size1, size_t size2)
|
|||
}
|
||||
|
||||
/* Sum of three sizes, with overflow check. */
|
||||
static inline size_t
|
||||
XSIZE_INLINE size_t
|
||||
#if __GNUC__ >= 3
|
||||
__attribute__ ((__pure__))
|
||||
#endif
|
||||
|
@ -69,7 +74,7 @@ xsum3 (size_t size1, size_t size2, size_t size3)
|
|||
}
|
||||
|
||||
/* Sum of four sizes, with overflow check. */
|
||||
static inline size_t
|
||||
XSIZE_INLINE size_t
|
||||
#if __GNUC__ >= 3
|
||||
__attribute__ ((__pure__))
|
||||
#endif
|
||||
|
@ -79,7 +84,7 @@ xsum4 (size_t size1, size_t size2, size_t size3, size_t size4)
|
|||
}
|
||||
|
||||
/* Maximum of two sizes, with overflow check. */
|
||||
static inline size_t
|
||||
XSIZE_INLINE size_t
|
||||
#if __GNUC__ >= 3
|
||||
__attribute__ ((__pure__))
|
||||
#endif
|
||||
|
@ -92,7 +97,7 @@ xmax (size_t size1, size_t size2)
|
|||
|
||||
/* Multiplication of a count with an element size, with overflow check.
|
||||
The count must be >= 0 and the element size must be > 0.
|
||||
This is a macro, not an inline function, so that it works correctly even
|
||||
This is a macro, not a function, so that it works correctly even
|
||||
when N is of a wider type and N > SIZE_MAX. */
|
||||
#define xtimes(N, ELSIZE) \
|
||||
((N) <= SIZE_MAX / (ELSIZE) ? (size_t) (N) * (ELSIZE) : SIZE_MAX)
|
||||
|
@ -104,4 +109,6 @@ xmax (size_t size1, size_t size2)
|
|||
#define size_in_bounds_p(SIZE) \
|
||||
((SIZE) != SIZE_MAX)
|
||||
|
||||
_GL_INLINE_HEADER_END
|
||||
|
||||
#endif /* _XSIZE_H */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue