]> Savannah Git Hosting - gnulib.git/commitdiff
glob: Fix compilation error in C++ mode.
authorBruno Haible <bruno@clisp.org>
Thu, 15 Mar 2018 22:56:03 +0000 (23:56 +0100)
committerBruno Haible <bruno@clisp.org>
Thu, 15 Mar 2018 22:56:03 +0000 (23:56 +0100)
* lib/glob.in.h (_Restrict_): Define, like in regex.h and spawn.in.h.

ChangeLog
lib/glob.in.h

index 7c8d6bbbc6b74f60ebe8e805921388f58cfd4c81..45628e09be04a9b6be5bf06c6d37d084a920ddc4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2018-03-15  Bruno Haible  <bruno@clisp.org>
+
+       glob: Fix compilation error in C++ mode.
+       * lib/glob.in.h (_Restrict_): Define, like in regex.h and spawn.in.h.
+
 2018-03-15  Bruno Haible  <bruno@clisp.org>
 
        host-cpu-c-abi: Support for RISC-V CPU.
index 4d71ef8650197a6a59d5ddade5ee54e0a8327388..cc3f48c43a73dfe9acb069121648c57d9fe406cf 100644 (file)
 # define __USE_GNU    1
 #endif
 
+/* 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__)
+#  define _Restrict_ __restrict
+# else
+#  define _Restrict_
+# endif
+#endif
+
 
 #define glob rpl_glob
 #define globfree rpl_globfree