func_attr: Support "noreturn" attribute

This commit is contained in:
James McCoy 2017-04-20 01:10:44 -04:00
parent edfe0980f1
commit 77f8aebf41

View File

@ -89,6 +89,10 @@
# undef FUNC_ATTR_NONNULL_RET # undef FUNC_ATTR_NONNULL_RET
#endif #endif
#ifdef FUNC_ATTR_NORETURN
# undef FUNC_ATTR_NORETURN
#endif
#ifndef DID_REAL_ATTR #ifndef DID_REAL_ATTR
# define DID_REAL_ATTR # define DID_REAL_ATTR
# ifdef __GNUC__ # ifdef __GNUC__
@ -107,6 +111,7 @@
# define REAL_FATTR_UNUSED __attribute__((unused)) # define REAL_FATTR_UNUSED __attribute__((unused))
# define REAL_FATTR_NONNULL_ALL __attribute__((nonnull)) # define REAL_FATTR_NONNULL_ALL __attribute__((nonnull))
# define REAL_FATTR_NONNULL_ARG(...) __attribute__((nonnull(__VA_ARGS__))) # define REAL_FATTR_NONNULL_ARG(...) __attribute__((nonnull(__VA_ARGS__)))
# define REAL_FATTR_NORETURN __attribute__((noreturn))
# ifdef __clang__ # ifdef __clang__
// clang only // clang only
@ -176,6 +181,10 @@
# ifndef REAL_FATTR_NONNULL_RET # ifndef REAL_FATTR_NONNULL_RET
# define REAL_FATTR_NONNULL_RET # define REAL_FATTR_NONNULL_RET
# endif # endif
# ifndef REAL_FATTR_NORETURN
# define REAL_FATTR_NORETURN
# endif
#endif #endif
#ifdef DEFINE_FUNC_ATTRIBUTES #ifdef DEFINE_FUNC_ATTRIBUTES
@ -196,6 +205,7 @@
# define FUNC_ATTR_NONNULL_ALL REAL_FATTR_NONNULL_ALL # define FUNC_ATTR_NONNULL_ALL REAL_FATTR_NONNULL_ALL
# define FUNC_ATTR_NONNULL_ARG(...) REAL_FATTR_NONNULL_ARG(__VA_ARGS__) # define FUNC_ATTR_NONNULL_ARG(...) REAL_FATTR_NONNULL_ARG(__VA_ARGS__)
# define FUNC_ATTR_NONNULL_RET REAL_FATTR_NONNULL_RET # define FUNC_ATTR_NONNULL_RET REAL_FATTR_NONNULL_RET
# define FUNC_ATTR_NORETURN REAL_FATTR_NORETURN
#elif !defined(DO_NOT_DEFINE_EMPTY_ATTRIBUTES) #elif !defined(DO_NOT_DEFINE_EMPTY_ATTRIBUTES)
# define FUNC_ATTR_MALLOC # define FUNC_ATTR_MALLOC
# define FUNC_ATTR_ALLOC_SIZE(x) # define FUNC_ATTR_ALLOC_SIZE(x)
@ -209,4 +219,5 @@
# define FUNC_ATTR_NONNULL_ALL # define FUNC_ATTR_NONNULL_ALL
# define FUNC_ATTR_NONNULL_ARG(...) # define FUNC_ATTR_NONNULL_ARG(...)
# define FUNC_ATTR_NONNULL_RET # define FUNC_ATTR_NONNULL_RET
# define FUNC_ATTR_NORETURN
#endif #endif