diff options
| author | William Huynh <William.Huynh@arm.com> | 2025-08-19 09:28:23 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-08-19 09:28:23 +0100 |
| commit | 0c622d72fc8a311fa879ee2e49478563bf56d7fa (patch) | |
| tree | 0076aa4217390581fa185df26b2cbdbd8ccb46ad /libc/include | |
| parent | da05208bfb6abde863882767e34d175aa170246b (diff) | |
[libc] Add _Returns_twice to C++ code (#153602)
Fixes issue with `<csetjmp>` which requires `_Returns_twice` but in C++
mode
Diffstat (limited to 'libc/include')
| -rw-r--r-- | libc/include/__llvm-libc-common.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libc/include/__llvm-libc-common.h b/libc/include/__llvm-libc-common.h index c6fd33a55532..1fe3f4d2aea9 100644 --- a/libc/include/__llvm-libc-common.h +++ b/libc/include/__llvm-libc-common.h @@ -47,6 +47,13 @@ #define __NOEXCEPT throw() #endif +#undef _Returns_twice +#if __cplusplus >= 201103L +#define _Returns_twice [[gnu::returns_twice]] +#else +#define _Returns_twice __attribute__((returns_twice)) +#endif + // This macro serves as a generic cast implementation for use in both C and C++, // similar to `__BIONIC_CAST` in Android. #undef __LLVM_LIBC_CAST |
