mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-15 04:43:53 +00:00
sys/cdefs.h: add __noexcept and __noexcept_if
These macros provide the C++11 noexcept and noexcept(...) keywords if we're compiling in a C++11 environment. Otherwise, they expand to an empty string. This will be used to add the required noexcept specifier to several libc functions as required in C++11. MFC after: 2 weeks Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1085
This commit is contained in:
parent
0e867a4911
commit
02b0d4b688
|
@ -358,6 +358,17 @@
|
|||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* noexcept keyword added in C++11.
|
||||
*/
|
||||
#if defined(__cplusplus) && __cplusplus >= 201103L
|
||||
#define __noexcept noexcept
|
||||
#define __noexcept_if(__c) noexcept(__c)
|
||||
#else
|
||||
#define __noexcept
|
||||
#define __noexcept_if(__c)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* We use `__restrict' as a way to define the `restrict' type qualifier
|
||||
* without disturbing older software that is unaware of C99 keywords.
|
||||
|
|
Loading…
Reference in a new issue