summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2020-08-12 20:23:00 +0200
committerBruno Haible <bruno@clisp.org>2020-08-12 20:23:36 +0200
commit2237f22e8b8f385f12eeac2aeb793f1eac19198b (patch)
tree0cd260a546420d37f6b73a1de9234096162d0334
parent69931285d521536a61eb87bd1a75e8d6f4d2fa05 (diff)
downloadgnulib-2237f22e8b8f385f12eeac2aeb793f1eac19198b.tar.gz
Revert autoupdate's revert.
* config/srclist.txt: Mark regex.h as needing sync with glibc.
-rw-r--r--ChangeLog5
-rw-r--r--config/srclist.txt2
-rw-r--r--lib/regex.h17
3 files changed, 18 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 380ca474e9..e3a368edbc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2020-08-12 Bruno Haible <bruno@clisp.org>
+
+ Revert autoupdate's revert.
+ * config/srclist.txt: Mark regex.h as needing sync with glibc.
+
2020-08-11 Bruno Haible <bruno@clisp.org>
thread-optim: Fix a compiler warning.
diff --git a/config/srclist.txt b/config/srclist.txt
index 679bc2a46d..d8fbebff55 100644
--- a/config/srclist.txt
+++ b/config/srclist.txt
@@ -56,7 +56,7 @@ $LIBCSRC malloc/scratch_buffer_set_array_size.c lib/malloc
#$LIBCSRC include/intprops.h lib
$LIBCSRC posix/regcomp.c lib
$LIBCSRC posix/regex.c lib
-$LIBCSRC posix/regex.h lib
+#$LIBCSRC posix/regex.h lib
$LIBCSRC posix/regex_internal.c lib
#$LIBCSRC posix/regex_internal.h lib
$LIBCSRC posix/regexec.c lib
diff --git a/lib/regex.h b/lib/regex.h
index 5fe41c8685..7418e6c76f 100644
--- a/lib/regex.h
+++ b/lib/regex.h
@@ -612,7 +612,9 @@ extern int re_exec (const char *);
'configure' might #define 'restrict' to those words, so pick a
different name. */
#ifndef _Restrict_
-# if defined __restrict || 2 < __GNUC__ + (95 <= __GNUC_MINOR__)
+# if defined __restrict \
+ || 2 < __GNUC__ + (95 <= __GNUC_MINOR__) \
+ || __clang_major__ >= 3
# define _Restrict_ __restrict
# elif 199901L <= __STDC_VERSION__ || defined restrict
# define _Restrict_ restrict
@@ -620,13 +622,18 @@ extern int re_exec (const char *);
# define _Restrict_
# endif
#endif
-/* For [restrict], use glibc's __restrict_arr if available.
- Otherwise, GCC 3.1 (not in C++ mode) and C99 support [restrict]. */
+/* For the ISO C99 syntax
+ array_name[restrict]
+ use glibc's __restrict_arr if available.
+ Otherwise, GCC 3.1 and clang support this syntax (but not in C++ mode).
+ Other ISO C99 compilers support it as well. */
#ifndef _Restrict_arr_
# ifdef __restrict_arr
# define _Restrict_arr_ __restrict_arr
-# elif ((199901L <= __STDC_VERSION__ || 3 < __GNUC__ + (1 <= __GNUC_MINOR__)) \
- && !defined __GNUG__)
+# elif ((199901L <= __STDC_VERSION__ \
+ || 3 < __GNUC__ + (1 <= __GNUC_MINOR__) \
+ || __clang_major__ >= 3) \
+ && !defined __cplusplus)
# define _Restrict_arr_ _Restrict_
# else
# define _Restrict_arr_