1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-22 07:09:54 +00:00

Merge from gnulib

This incorporates:
2017-01-09 maint: time stamp -> timestamp
2017-01-07 stdioext: Port to Minix 3.2 and newer
2017-01-06 glob, intprops, xalloc: work around Clang bug
2017-01-02 revert copyright-year change to synced files
* doc/misc/texinfo.tex, lib/fpending.c, lib/intprops.h, lib/mktime.c:
* lib/stat-time.h, lib/stdio-impl.h, lib/time.in.h, lib/timespec.h:
* lib/utimens.c, lib/xalloc-oversized.h:
Copy from gnulib.
This commit is contained in:
Paul Eggert 2017-01-10 07:48:37 -08:00
parent 560a384038
commit fa0a2b4e7c
10 changed files with 22 additions and 33 deletions

View File

@ -5,7 +5,10 @@
%
\def\texinfoversion{2016-09-18.18}
%
% Copyright 1985-1986, 1988, 1990-2017 Free Software Foundation, Inc.
% Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
% 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016
% Free Software Foundation, Inc.
%
% This texinfo.tex file is free software: you can redistribute it and/or
% modify it under the terms of the GNU General Public License as

View File

@ -35,7 +35,7 @@ __fpending (FILE *fp)
#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
return fp->_IO_write_ptr - fp->_IO_write_base;
#elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
/* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Android */
/* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
return fp->_p - fp->_bf._base;
#elif defined __EMX__ /* emx+gcc */
return fp->_ptr - fp->_buffer;

View File

@ -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))
@ -241,12 +237,10 @@ verify (TYPE_WIDTH (unsigned int) == UINT_WIDTH);
: (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

View File

@ -153,7 +153,7 @@ isdst_differ (int a, int b)
/* Return an integer value measuring (YEAR1-YDAY1 HOUR1:MIN1:SEC1) -
(YEAR0-YDAY0 HOUR0:MIN0:SEC0) in seconds, assuming that the clocks
were not adjusted between the time stamps.
were not adjusted between the timestamps.
The YEAR values uses the same numbering as TP->tm_year. Values
need not be in the usual range. However, YEAR1 must not overflow

View File

@ -181,7 +181,7 @@ get_stat_birthtime (struct stat const *st)
|| defined HAVE_STRUCT_STAT_ST_BIRTHTIMENSEC)
/* FreeBSD and NetBSD sometimes signal the absence of knowledge by
using zero. Attempt to work around this problem. Alas, this can
report failure even for valid time stamps. Also, NetBSD
report failure even for valid timestamps. Also, NetBSD
sometimes returns junk in the birth time fields; work around this
bug if it is detected. */
if (! (t.tv_sec && 0 <= t.tv_nsec && t.tv_nsec < 1000000000))

View File

@ -29,7 +29,7 @@
#include <errno.h> /* For detecting Plan9. */
#if defined __sferror || defined __DragonFly__ || defined __ANDROID__
/* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Android */
/* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
# if defined __DragonFly__ /* DragonFly */
/* See <http://www.dragonflybsd.org/cvsweb/src/lib/libc/stdio/priv_stdio.h?rev=HEAD&content-type=text/x-cvsweb-markup>. */
@ -58,7 +58,7 @@
# define fp_ fp
# endif
# if (defined __NetBSD__ && __NetBSD_Version__ >= 105270000) || defined __OpenBSD__ || defined __ANDROID__ /* NetBSD >= 1.5ZA, OpenBSD, Android */
# if (defined __NetBSD__ && __NetBSD_Version__ >= 105270000) || defined __OpenBSD__ || defined __minix || defined __ANDROID__ /* NetBSD >= 1.5ZA, OpenBSD, Minix 3, Android */
/* See <http://cvsweb.netbsd.org/bsdweb.cgi/src/lib/libc/stdio/fileext.h?rev=HEAD&content-type=text/x-cvsweb-markup>
and <http://www.openbsd.org/cgi-bin/cvsweb/src/lib/libc/stdio/fileext.h?rev=HEAD&content-type=text/x-cvsweb-markup> */
struct __sfileext

View File

@ -217,7 +217,7 @@ _GL_CXXALIAS_SYS (gmtime, struct tm *, (time_t const *__timer));
_GL_CXXALIASWARN (gmtime);
# endif
/* Parse BUF as a time stamp, assuming FORMAT specifies its layout, and store
/* Parse BUF as a timestamp, assuming FORMAT specifies its layout, and store
the resulting broken-down time into TM. See
<http://www.opengroup.org/susv3xsh/strptime.html>. */
# if @GNULIB_STRPTIME@

View File

@ -29,7 +29,7 @@ _GL_INLINE_HEADER_BEGIN
# define _GL_TIMESPEC_INLINE _GL_INLINE
#endif
/* Resolution of timespec time stamps (in units per second), and log
/* Resolution of timespec timestamps (in units per second), and log
base 10 of the resolution. */
enum { TIMESPEC_RESOLUTION = 1000000000 };
@ -48,7 +48,7 @@ make_timespec (time_t s, long int ns)
/* Return negative, zero, positive if A < B, A == B, A > B, respectively.
For each time stamp T, this code assumes that either:
For each timestamp T, this code assumes that either:
* T.tv_nsec is in the range 0..999999999; or
* T.tv_sec corresponds to a valid leap second on a host that supports
@ -56,7 +56,7 @@ make_timespec (time_t s, long int ns)
* T.tv_sec is the minimum time_t value and T.tv_nsec is -1; or
T.tv_sec is the maximum time_t value and T.tv_nsec is 2000000000.
This allows for special struct timespec values that are less or
greater than all possible valid time stamps.
greater than all possible valid timestamps.
In all these cases, it is safe to subtract two tv_nsec values and
convert the result to integer without worrying about overflow on

View File

@ -154,14 +154,14 @@ update_timespec (struct stat const *statbuf, struct timespec *ts[2])
return false;
}
/* Set the access and modification time stamps of FD (a.k.a. FILE) to be
/* Set the access and modification timestamps of FD (a.k.a. FILE) to be
TIMESPEC[0] and TIMESPEC[1], respectively.
FD must be either negative -- in which case it is ignored --
or a file descriptor that is open on FILE.
If FD is nonnegative, then FILE can be NULL, which means
use just futimes (or equivalent) instead of utimes (or equivalent),
and fail if on an old system without futimes (or equivalent).
If TIMESPEC is null, set the time stamps to the current time.
If TIMESPEC is null, set the timestamps to the current time.
Return 0 on success, -1 (setting errno) on failure. */
int
@ -190,7 +190,7 @@ fdutimens (int fd, char const *file, struct timespec const timespec[2])
return -1;
}
/* Some Linux-based NFS clients are buggy, and mishandle time stamps
/* Some Linux-based NFS clients are buggy, and mishandle timestamps
of files in NFS file systems in some cases. We have no
configure-time test for this, but please see
<http://bugs.gentoo.org/show_bug.cgi?id=132673> for references to
@ -411,7 +411,7 @@ fdutimens (int fd, char const *file, struct timespec const timespec[2])
}
}
/* Set the access and modification time stamps of FILE to be
/* Set the access and modification timestamps of FILE to be
TIMESPEC[0] and TIMESPEC[1], respectively. */
int
utimens (char const *file, struct timespec const timespec[2])
@ -419,7 +419,7 @@ utimens (char const *file, struct timespec const timespec[2])
return fdutimens (-1, file, timespec);
}
/* Set the access and modification time stamps of FILE to be
/* Set the access and modification timestamps of FILE to be
TIMESPEC[0] and TIMESPEC[1], respectively, without dereferencing
symlinks. Fail with ENOSYS if the platform does not support
changing symlink timestamps, but FILE was a symlink. */

View File

@ -21,11 +21,6 @@
#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_t calculation,
or would generate a value larger than PTRDIFF_MAX.
This expands to a constant expression if N and S are both constants.
@ -46,13 +41,10 @@ typedef size_t __xalloc_count_type;
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)
#if 7 <= __GNUC__
# define xalloc_oversized(n, s) \
__builtin_mul_overflow_p (n, s, (__xalloc_count_type) 1)
#elif ((5 <= __GNUC__ \
|| (__has_builtin (__builtin_mul_overflow) \
&& __has_builtin (__builtin_constant_p))) \
&& !__STRICT_ANSI__)
#elif 5 <= __GNUC__ && !__STRICT_ANSI__
# define xalloc_oversized(n, s) \
(__builtin_constant_p (n) && __builtin_constant_p (s) \
? __xalloc_oversized (n, s) \