summaryrefslogtreecommitdiff
path: root/lib/spawn.in.h
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2020-02-23 14:24:04 +0100
committerBruno Haible <bruno@clisp.org>2020-02-23 14:24:44 +0100
commite76aacf4675af4aa9591b0a0e9879b375780bd8b (patch)
tree54fd31c218c5659ea8bad127b080a8fafa8f420b /lib/spawn.in.h
parent46b3b6881a8a677c7a577ec4182b2eb4d5aa230c (diff)
downloadgnulib-e76aacf4675af4aa9591b0a0e9879b375780bd8b.tar.gz
glob, spawn: Use improved '_Restrict_' definition.
* lib/glob.in.h (_Restrict_): Use same definition as in lib/regex.h. * lib/spawn.in.h (_Restrict_, _Restrict_arr_): Likewise.
Diffstat (limited to 'lib/spawn.in.h')
-rw-r--r--lib/spawn.in.h22
1 files changed, 11 insertions, 11 deletions
diff --git a/lib/spawn.in.h b/lib/spawn.in.h
index 4878acb8f8..c4dd01aa35 100644
--- a/lib/spawn.in.h
+++ b/lib/spawn.in.h
@@ -43,28 +43,28 @@
# define __THROW
#endif
-/* GCC 2.95 and later have "__restrict"; C99 compilers have
+/* For plain 'restrict', use glibc's __restrict if defined.
+ Otherwise, GCC 2.95 and later have "__restrict"; C99 compilers have
"restrict", and "configure" may have defined "restrict".
Other compilers use __restrict, __restrict__, and _Restrict, and
'configure' might #define 'restrict' to those words, so pick a
different name. */
#ifndef _Restrict_
-# if 199901L <= __STDC_VERSION__
-# define _Restrict_ restrict
-# elif 2 < __GNUC__ || (2 == __GNUC__ && 95 <= __GNUC_MINOR__)
+# if defined __restrict || 2 < __GNUC__ + (95 <= __GNUC_MINOR__)
# define _Restrict_ __restrict
+# elif 199901L <= __STDC_VERSION__ || defined restrict
+# define _Restrict_ restrict
# else
# define _Restrict_
# endif
#endif
-/* gcc 3.1 and up support the [restrict] syntax. Don't trust
- sys/cdefs.h's definition of __restrict_arr, though, as it
- mishandles gcc -ansi -pedantic. */
+/* For [restrict], use glibc's __restrict_arr if available.
+ Otherwise, GCC 3.1 (not in C++ mode) and C99 support [restrict]. */
#ifndef _Restrict_arr_
-# if ((199901L <= __STDC_VERSION__ \
- || ((3 < __GNUC__ || (3 == __GNUC__ && 1 <= __GNUC_MINOR__)) \
- && !defined __STRICT_ANSI__)) \
- && !defined __GNUG__)
+# ifdef __restrict_arr
+# define _Restrict_arr_ __restrict_arr
+# elif ((199901L <= __STDC_VERSION__ || 3 < __GNUC__ + (1 <= __GNUC_MINOR__)) \
+ && !defined __GNUG__)
# define _Restrict_arr_ _Restrict_
# else
# define _Restrict_arr_