diff options
author | NAKAMURA Takumi <geek4civic@gmail.com> | 2025-01-09 17:50:40 +0900 |
---|---|---|
committer | NAKAMURA Takumi <geek4civic@gmail.com> | 2025-01-09 17:50:40 +0900 |
commit | fea7da1b00cc97d742faede2df96c7d327950f49 (patch) | |
tree | 4de1d6b4ddc69f4f32daabb11ad5c71ab0cf895e /libc/include/__llvm-libc-common.h | |
parent | 9b99dde0d47102625d93c5d1cbbc04951025a6c9 (diff) | |
parent | 0aa930a41f2d1ebf1fa90ec42da8f96d15a4dcbb (diff) | |
download | llvm-users/chapuni/cov/single/nextcount.zip llvm-users/chapuni/cov/single/nextcount.tar.gz llvm-users/chapuni/cov/single/nextcount.tar.bz2 |
Merge branch 'users/chapuni/cov/single/nextcount-base' into users/chapuni/cov/single/nextcountusers/chapuni/cov/single/nextcount
Diffstat (limited to 'libc/include/__llvm-libc-common.h')
-rw-r--r-- | libc/include/__llvm-libc-common.h | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/libc/include/__llvm-libc-common.h b/libc/include/__llvm-libc-common.h index d54ee7b..c63eb13 100644 --- a/libc/include/__llvm-libc-common.h +++ b/libc/include/__llvm-libc-common.h @@ -50,7 +50,24 @@ #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 +// In C11 and later, _Noreturn is a keyword. +#elif defined(__GNUC__) +// GNU-compatible compilers have an equivalent attribute. +#define _Noreturn __attribute__((__noreturn__)) +#else +#define _Noreturn +#endif #undef __NOEXCEPT #ifdef __GNUC__ |