summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2019-03-25 14:53:56 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2019-03-25 14:55:49 -0700
commita3c5530975e57f813ec0f52e16584aacaadc1d05 (patch)
tree52a7d07e99d41a0c2db2c110b1d853fdd83b43b4 /lib
parentd43af7b64bd22724e5e9a624bcc06b4ed28faf73 (diff)
downloademacs-a3c5530975e57f813ec0f52e16584aacaadc1d05.tar.gz
Update from Gnulib.
This incorporates: 2019-03-23 Support cross-compilation to musl libc 2019-03-23 noreturn: In C++ mode with clang, use _Noreturn as fallback 2019-03-22 _Noreturn: beware of C's _Noreturn in C++ pre C++11 2019-03-19 Help making signal handlers more reliable 2019-03-18 _Noreturn: clang and MSVC do support [[noreturn]] in C++11 2019-03-17 _Noreturn: GCC 4.7 does not support [[noreturn]] in C++11 2019-03-14 all: Update URLs to msdn.microsoft.com * doc/misc/texinfo.tex, lib/_Noreturn.h, lib/gettimeofday.c: * lib/mktime.c, lib/regcomp.c, lib/regexec.c, lib/stat-time.h: * lib/utimens.c, m4/fdopendir.m4, m4/getgroups.m4: * m4/gettimeofday.m4, m4/gnulib-common.m4, m4/putenv.m4, m4/utimes.m4: Update from gnulib.
Diffstat (limited to 'lib')
-rw-r--r--lib/_Noreturn.h9
-rw-r--r--lib/gettimeofday.c6
-rw-r--r--lib/mktime.c2
-rw-r--r--lib/regcomp.c20
-rw-r--r--lib/regexec.c14
-rw-r--r--lib/stat-time.h2
-rw-r--r--lib/utimens.c8
7 files changed, 32 insertions, 29 deletions
diff --git a/lib/_Noreturn.h b/lib/_Noreturn.h
index 94fdfaf0220..7594e4b0c0b 100644
--- a/lib/_Noreturn.h
+++ b/lib/_Noreturn.h
@@ -1,8 +1,11 @@
#ifndef _Noreturn
-# if 201103 <= (defined __cplusplus ? __cplusplus : 0)
+# if (defined __cplusplus \
+ && ((201103 <= __cplusplus && !(__GNUC__ == 4 && __GNUC_MINOR__ == 7)) \
+ || (defined _MSC_VER && 1900 <= _MSC_VER)))
# define _Noreturn [[noreturn]]
-# elif (201112 <= (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) \
- || 4 < __GNUC__ + (7 <= __GNUC_MINOR__))
+# elif ((!defined __cplusplus || defined __clang__) \
+ && (201112 <= (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) \
+ || 4 < __GNUC__ + (7 <= __GNUC_MINOR__)))
/* _Noreturn works as-is. */
# elif 2 < __GNUC__ + (8 <= __GNUC_MINOR__) || 0x5110 <= __SUNPRO_C
# define _Noreturn __attribute__ ((__noreturn__))
diff --git a/lib/gettimeofday.c b/lib/gettimeofday.c
index 360cdc4d793..e728bf47355 100644
--- a/lib/gettimeofday.c
+++ b/lib/gettimeofday.c
@@ -72,10 +72,10 @@ gettimeofday (struct timeval *restrict tv, void *restrict tz)
/* On native Windows, there are two ways to get the current time:
GetSystemTimeAsFileTime
- <https://msdn.microsoft.com/en-us/library/ms724397.aspx>
+ <https://docs.microsoft.com/en-us/windows/desktop/api/sysinfoapi/nf-sysinfoapi-getsystemtimeasfiletime>
or
GetSystemTimePreciseAsFileTime
- <https://msdn.microsoft.com/en-us/library/hh706895.aspx>.
+ <https://docs.microsoft.com/en-us/windows/desktop/api/sysinfoapi/nf-sysinfoapi-getsystemtimepreciseasfiletime>.
GetSystemTimeAsFileTime produces values that jump by increments of
15.627 milliseconds (!) on average.
Whereas GetSystemTimePreciseAsFileTime values usually jump by 1 or 2
@@ -92,7 +92,7 @@ gettimeofday (struct timeval *restrict tv, void *restrict tz)
GetSystemTimeAsFileTime (&current_time);
/* Convert from FILETIME to 'struct timeval'. */
- /* FILETIME: <https://msdn.microsoft.com/en-us/library/ms724284.aspx> */
+ /* FILETIME: <https://docs.microsoft.com/en-us/windows/desktop/api/minwinbase/ns-minwinbase-filetime> */
ULONGLONG since_1601 =
((ULONGLONG) current_time.dwHighDateTime << 32)
| (ULONGLONG) current_time.dwLowDateTime;
diff --git a/lib/mktime.c b/lib/mktime.c
index d411aa77058..e3783d7a95e 100644
--- a/lib/mktime.c
+++ b/lib/mktime.c
@@ -72,7 +72,7 @@ my_tzset (void)
/* Rectify the value of the environment variable TZ.
There are four possible kinds of such values:
- Traditional US time zone names, e.g. "PST8PDT". Syntax: see
- <https://msdn.microsoft.com/en-us/library/90s5c885.aspx>
+ <https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/tzset>
- Time zone names based on geography, that contain one or more
slashes, e.g. "Europe/Moscow".
- Time zone names based on geography, without slashes, e.g.
diff --git a/lib/regcomp.c b/lib/regcomp.c
index 10a0a49d97a..892139a02af 100644
--- a/lib/regcomp.c
+++ b/lib/regcomp.c
@@ -1800,8 +1800,8 @@ peek_token (re_token_t *token, re_string_t *input, reg_syntax_t syntax)
token->word_char = 0;
#ifdef RE_ENABLE_I18N
token->mb_partial = 0;
- if (input->mb_cur_max > 1 &&
- !re_string_first_byte (input, re_string_cur_idx (input)))
+ if (input->mb_cur_max > 1
+ && !re_string_first_byte (input, re_string_cur_idx (input)))
{
token->type = CHARACTER;
token->mb_partial = 1;
@@ -1988,8 +1988,8 @@ peek_token (re_token_t *token, re_string_t *input, reg_syntax_t syntax)
token->type = OP_PERIOD;
break;
case '^':
- if (!(syntax & (RE_CONTEXT_INDEP_ANCHORS | RE_CARET_ANCHORS_HERE)) &&
- re_string_cur_idx (input) != 0)
+ if (!(syntax & (RE_CONTEXT_INDEP_ANCHORS | RE_CARET_ANCHORS_HERE))
+ && re_string_cur_idx (input) != 0)
{
char prev = re_string_peek_byte (input, -1);
if (!(syntax & RE_NEWLINE_ALT) || prev != '\n')
@@ -1999,8 +1999,8 @@ peek_token (re_token_t *token, re_string_t *input, reg_syntax_t syntax)
token->opr.ctx_type = LINE_FIRST;
break;
case '$':
- if (!(syntax & RE_CONTEXT_INDEP_ANCHORS) &&
- re_string_cur_idx (input) + 1 != re_string_length (input))
+ if (!(syntax & RE_CONTEXT_INDEP_ANCHORS)
+ && re_string_cur_idx (input) + 1 != re_string_length (input))
{
re_token_t next;
re_string_skip_bytes (input, 1);
@@ -2034,8 +2034,8 @@ peek_token_bracket (re_token_t *token, re_string_t *input, reg_syntax_t syntax)
token->opr.c = c;
#ifdef RE_ENABLE_I18N
- if (input->mb_cur_max > 1 &&
- !re_string_first_byte (input, re_string_cur_idx (input)))
+ if (input->mb_cur_max > 1
+ && !re_string_first_byte (input, re_string_cur_idx (input)))
{
token->type = CHARACTER;
return 1;
@@ -2333,8 +2333,8 @@ parse_expression (re_string_t *regexp, regex_t *preg, re_token_t *token,
}
FALLTHROUGH;
case OP_CLOSE_SUBEXP:
- if ((token->type == OP_CLOSE_SUBEXP) &&
- !(syntax & RE_UNMATCHED_RIGHT_PAREN_ORD))
+ if ((token->type == OP_CLOSE_SUBEXP)
+ && !(syntax & RE_UNMATCHED_RIGHT_PAREN_ORD))
{
*err = REG_ERPAREN;
return NULL;
diff --git a/lib/regexec.c b/lib/regexec.c
index 7fcd1a509ae..f464869fb03 100644
--- a/lib/regexec.c
+++ b/lib/regexec.c
@@ -2204,9 +2204,9 @@ sift_states_iter_mb (const re_match_context_t *mctx, re_sift_context_t *sctx,
int naccepted;
/* Check the node can accept "multi byte". */
naccepted = check_node_accept_bytes (dfa, node_idx, &mctx->input, str_idx);
- if (naccepted > 0 && str_idx + naccepted <= max_str_idx &&
- !STATE_NODE_CONTAINS (sctx->sifted_states[str_idx + naccepted],
- dfa->nexts[node_idx]))
+ if (naccepted > 0 && str_idx + naccepted <= max_str_idx
+ && !STATE_NODE_CONTAINS (sctx->sifted_states[str_idx + naccepted],
+ dfa->nexts[node_idx]))
/* The node can't accept the "multi byte", or the
destination was already thrown away, then the node
couldn't accept the current input "multi byte". */
@@ -3782,10 +3782,10 @@ check_node_accept_bytes (const re_dfa_t *dfa, Idx node_idx,
/* FIXME: I don't think this if is needed, as both '\n'
and '\0' are char_len == 1. */
/* '.' accepts any one character except the following two cases. */
- if ((!(dfa->syntax & RE_DOT_NEWLINE) &&
- re_string_byte_at (input, str_idx) == '\n') ||
- ((dfa->syntax & RE_DOT_NOT_NULL) &&
- re_string_byte_at (input, str_idx) == '\0'))
+ if ((!(dfa->syntax & RE_DOT_NEWLINE)
+ && re_string_byte_at (input, str_idx) == '\n')
+ || ((dfa->syntax & RE_DOT_NOT_NULL)
+ && re_string_byte_at (input, str_idx) == '\0'))
return 0;
return char_len;
}
diff --git a/lib/stat-time.h b/lib/stat-time.h
index d4f1f96104e..38a1f55a6cf 100644
--- a/lib/stat-time.h
+++ b/lib/stat-time.h
@@ -171,7 +171,7 @@ get_stat_birthtime (struct stat const *st _GL_UNUSED)
#elif defined _WIN32 && ! defined __CYGWIN__
/* Native Windows platforms (but not Cygwin) put the "file creation
time" in st_ctime (!). See
- <https://msdn.microsoft.com/en-us/library/14h5k7ff(VS.80).aspx>. */
+ <https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/stat-functions>. */
# if _GL_WINDOWS_STAT_TIMESPEC
t = st->st_ctim;
# else
diff --git a/lib/utimens.c b/lib/utimens.c
index 34689bcd655..c9b65ef4c20 100644
--- a/lib/utimens.c
+++ b/lib/utimens.c
@@ -288,8 +288,8 @@ fdutimens (int fd, char const *file, struct timespec const timespec[2])
#ifdef USE_SETFILETIME
/* On native Windows, use SetFileTime(). See
- <https://msdn.microsoft.com/en-us/library/ms724933.aspx>
- <https://msdn.microsoft.com/en-us/library/ms724284.aspx> */
+ <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-setfiletime>
+ <https://docs.microsoft.com/en-us/windows/desktop/api/minwinbase/ns-minwinbase-filetime> */
if (0 <= fd)
{
HANDLE handle;
@@ -307,10 +307,10 @@ fdutimens (int fd, char const *file, struct timespec const timespec[2])
if (ts == NULL || ts[0].tv_nsec == UTIME_NOW || ts[1].tv_nsec == UTIME_NOW)
{
/* GetSystemTimeAsFileTime
- <https://msdn.microsoft.com/en-us/library/ms724397.aspx>.
+ <https://docs.microsoft.com/en-us/windows/desktop/api/sysinfoapi/nf-sysinfoapi-getsystemtimeasfiletime>.
It would be overkill to use
GetSystemTimePreciseAsFileTime
- <https://msdn.microsoft.com/en-us/library/hh706895.aspx>. */
+ <https://docs.microsoft.com/en-us/windows/desktop/api/sysinfoapi/nf-sysinfoapi-getsystemtimepreciseasfiletime>. */
GetSystemTimeAsFileTime (&current_time);
}