Skip to content

Commit 0c622d7

Browse files
authored
[libc] Add _Returns_twice to C++ code (#153602)
Fixes issue with `<csetjmp>` which requires `_Returns_twice` but in C++ mode
1 parent da05208 commit 0c622d7

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

libc/include/__llvm-libc-common.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,13 @@
4747
#define __NOEXCEPT throw()
4848
#endif
4949

50+
#undef _Returns_twice
51+
#if __cplusplus >= 201103L
52+
#define _Returns_twice [[gnu::returns_twice]]
53+
#else
54+
#define _Returns_twice __attribute__((returns_twice))
55+
#endif
56+
5057
// This macro serves as a generic cast implementation for use in both C and C++,
5158
// similar to `__BIONIC_CAST` in Android.
5259
#undef __LLVM_LIBC_CAST

0 commit comments

Comments
 (0)