mirror of
https://github.com/intel/llvm.git
synced 2026-01-26 12:26:52 +08:00
[libc] Use __attribute__((__nothrow__)) for __NOEXCEPT in C (#114653)
Consistent with glibc headers, where `noexcept` is used in C++ (or `throw()` in older C++ which llvm-libc doesn't support) in the public function declarations, `__attribute__((__nothrow__))` is used in C for compilers that support it.
This commit is contained in:
@@ -53,7 +53,11 @@
|
||||
#define __restrict restrict // C99 and above support the restrict keyword.
|
||||
|
||||
#undef __NOEXCEPT
|
||||
#ifdef __GNUC__
|
||||
#define __NOEXCEPT __attribute__((__nothrow__))
|
||||
#else
|
||||
#define __NOEXCEPT
|
||||
#endif
|
||||
|
||||
#endif // __cplusplus
|
||||
|
||||
|
||||
Reference in New Issue
Block a user