Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions libc/include/__llvm-libc-common.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@
#define __NOEXCEPT throw()
#endif

#undef _Returns_twice
#define _Returns_twice [[gnu::returns_twice]]

#else // not __cplusplus

#undef __BEGIN_C_DECLS
Expand Down Expand Up @@ -80,6 +83,9 @@
#define __NOEXCEPT
#endif

#undef _Returns_twice
#define _Returns_twice __attribute__((returns_twice))

#endif // __cplusplus

#endif // LLVM_LIBC_COMMON_H
2 changes: 2 additions & 0 deletions libc/include/setjmp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,7 @@ functions:
standards:
- stdc
return_type: int
attributes:
- _Returns_twice
arguments:
- type: jmp_buf
3 changes: 2 additions & 1 deletion libc/src/setjmp/setjmp_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ namespace LIBC_NAMESPACE_DECL {
#ifdef LIBC_COMPILER_IS_GCC
[[gnu::nothrow]]
#endif
int setjmp(jmp_buf buf);
[[gnu::returns_twice]] int
setjmp(jmp_buf buf);

} // namespace LIBC_NAMESPACE_DECL

Expand Down
Loading