]> Savannah Git Hosting - gnulib.git/commitdiff
Use __restrict also on clang.
authorBruno Haible <bruno@clisp.org>
Sun, 16 Aug 2020 16:44:53 +0000 (18:44 +0200)
committerBruno Haible <bruno@clisp.org>
Sun, 16 Aug 2020 16:44:53 +0000 (18:44 +0200)
* lib/argp.h (__restrict): Don't define as a macro on clang >= 3.
* lib/glob.in.h (_Restrict_): Use __restrict on clang >= 3.
* lib/unitypes.in.h (_UC_RESTRICT): Likewise.

ChangeLog
lib/argp.h
lib/glob.in.h
lib/unitypes.in.h

index b97fcf77cd50266a7ef72f27721858298463b70c..46a0d6c5aec4c2da6d72a1e15906ec02ea292fec 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2020-08-16  Bruno Haible  <bruno@clisp.org>
+
+       Use __restrict also on clang.
+       * lib/argp.h (__restrict): Don't define as a macro on clang >= 3.
+       * lib/glob.in.h (_Restrict_): Use __restrict on clang >= 3.
+       * lib/unitypes.in.h (_UC_RESTRICT): Likewise.
+
 2020-08-16  Bruno Haible  <bruno@clisp.org>
 
        pthread-spin: Use GCC built-ins also on clang.
index 808c900b785fee0ee9ac3ea268451f9f5af8f749..c71dd963d86ec85e8f241e15a8cd73a39ec17988 100644 (file)
@@ -39,7 +39,8 @@
    Other compilers use __restrict, __restrict__, and _Restrict, and
    'configure' might #define 'restrict' to those words.  */
 #ifndef __restrict
-# if ! (2 < __GNUC__ || (2 == __GNUC__ && 95 <= __GNUC_MINOR__))
+# if ! (2 < __GNUC__ || (2 == __GNUC__ && 95 <= __GNUC_MINOR__) \
+        || __clang_major__ >= 3)
 #  if 199901L <= __STDC_VERSION__
 #   define __restrict restrict
 #  else
index 7061a253a0996a90ef1871e106ddc421237497e4..d1c0733fa99859c629b68eb39cf4afb606abfe4c 100644 (file)
@@ -45,7 +45,9 @@
    '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
index b11326dacbd5d605e7ccac2e08e3c14f686bc136..63d0fe3ad6e5ee655534cbf2d10e6478f3a59e38 100644 (file)
@@ -47,7 +47,9 @@ typedef uint32_t ucs4_t;
    pass a pointer to a different object in the specified pointer argument
    than in the other pointer arguments.  */
 #ifndef _UC_RESTRICT
-# if defined __restrict || 2 < __GNUC__ + (95 <= __GNUC_MINOR__)
+# if defined __restrict \
+     || 2 < __GNUC__ + (95 <= __GNUC_MINOR__) \
+     || __clang_major__ >= 3
 #  define _UC_RESTRICT __restrict
 # elif 199901L <= __STDC_VERSION__ || defined restrict
 #  define _UC_RESTRICT restrict