diff options
Diffstat (limited to 'include/sys/cdefs.h')
-rw-r--r-- | include/sys/cdefs.h | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/include/sys/cdefs.h b/include/sys/cdefs.h index a4359a05c..656548c52 100644 --- a/include/sys/cdefs.h +++ b/include/sys/cdefs.h @@ -58,9 +58,15 @@ # define __NTH(fct) __attribute__ ((__nothrow__ __LEAF)) fct # else # if defined __cplusplus && __GNUC_PREREQ (2,8) -# define __THROW throw () -# define __THROWNL throw () -# define __NTH(fct) __LEAF_ATTR fct throw () +/* Dynamic exception specification is deprecated since C++11, so + we only use it when compiling for an earlier standard. */ +# if __cplusplus < 201103UL +# define __THROW throw () +# else +# define __THROW noexcept +# endif +# define __THROWNL __THROW +# define __NTH(fct) __LEAF_ATTR fct __THROW # else # define __THROW # define __THROWNL @@ -314,7 +320,7 @@ inline semantics, unless -fgnu89-inline is used. For -std=gnu99, forcing gnu_inline attribute does not change behavior, but may silence spurious warnings (such as in GCC 4.2). */ -#if !defined __cplusplus || __GNUC_PREREQ (4,3) +#if !defined __cplusplus || __GNUC_PREREQ (4,3) || __CLANG_PREREQ(8,0) # if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__ || defined __cplusplus # define __extern_inline extern __inline __attribute__ ((__gnu_inline__)) # if __GNUC_PREREQ (4,3) @@ -330,6 +336,17 @@ # endif #endif +/* Undefine (also defined in libc-symbols.h). */ +#undef __attribute_copy__ +#if __GNUC_PREREQ (9, 0) +/* Copies attributes from the declaration or type referenced by + the argument. */ +# define __attribute_copy__(arg) __attribute__ ((__copy__ (arg))) +#else +# define __attribute_copy__(arg) +#endif + + /* GCC 4.3 and above allow passing all anonymous arguments of an __extern_always_inline function to some other vararg function. */ #if __GNUC_PREREQ (4,3) |