diff options
author | NAKAMURA Takumi <geek4civic@gmail.com> | 2025-01-10 19:22:46 +0900 |
---|---|---|
committer | NAKAMURA Takumi <geek4civic@gmail.com> | 2025-01-10 19:22:46 +0900 |
commit | 8b02a27fc607ebc54c5a811188b3cea5063564e7 (patch) | |
tree | c1ca7d4acca553301204ebb83383aa87cb59311a /libc/include/__llvm-libc-common.h | |
parent | 694a772457b2999b7bd68625a16bf0755e95dcdb (diff) | |
parent | 397ac44f623f891d8f05d6673a95984ac0a26671 (diff) | |
download | llvm-users/chapuni/cov/merge/mcdcsort.zip llvm-users/chapuni/cov/merge/mcdcsort.tar.gz llvm-users/chapuni/cov/merge/mcdcsort.tar.bz2 |
Merge branch 'main' into users/chapuni/cov/merge/mcdcsortusers/chapuni/cov/merge/mcdcsort
Diffstat (limited to 'libc/include/__llvm-libc-common.h')
-rw-r--r-- | libc/include/__llvm-libc-common.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/libc/include/__llvm-libc-common.h b/libc/include/__llvm-libc-common.h index d9d70af..c63eb13 100644 --- a/libc/include/__llvm-libc-common.h +++ b/libc/include/__llvm-libc-common.h @@ -50,7 +50,14 @@ #define __END_C_DECLS #undef __restrict -#define __restrict restrict // C99 and above support the restrict keyword. +#if __STDC_VERSION__ >= 199901L +// C99 and above support the restrict keyword. +#define __restrict restrict +#elif !defined(__GNUC__) +// GNU-compatible compilers accept the __ spelling in all modes. +// Otherwise, omit the qualifier for pure C89 compatibility. +#define __restrict +#endif #undef _Noreturn #if __STDC_VERSION__ >= 201112L |