[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:
parent
a957cedea9
commit
0b91d77bf4
@ -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
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user