diff options
author | Shawn Landden <shawn@churchofgit.com> | 2013-12-16 08:53:53 -0800 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2013-12-17 21:51:24 +0100 |
commit | 919ce0b7affc6fbd68598b709faf477f56c22ac1 (patch) | |
tree | b629e38d0718c37d4e8e12d5f476851ad903476e /src/shared/macro.h | |
parent | 73020ab241866dce79b80cbebcaae537470c7086 (diff) |
_noreturn_ --> noreturn for C11 compat
also define noreturn w/o <stdnoreturn.h>
Diffstat (limited to 'src/shared/macro.h')
-rw-r--r-- | src/shared/macro.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/shared/macro.h b/src/shared/macro.h index 2b5b3fdfe0..79bee0396c 100644 --- a/src/shared/macro.h +++ b/src/shared/macro.h @@ -30,7 +30,6 @@ #define _printf_(a,b) __attribute__ ((format (printf, a, b))) #define _alloc_(...) __attribute__ ((alloc_size(__VA_ARGS__))) #define _sentinel_ __attribute__ ((sentinel)) -#define _noreturn_ __attribute__((noreturn)) #define _unused_ __attribute__ ((unused)) #define _destructor_ __attribute__ ((destructor)) #define _pure_ __attribute__ ((pure)) @@ -300,7 +299,8 @@ do { \ _found; \ }) -/* Define C11 thread_local attribute even on older compilers */ +/* Define C11 thread_local attribute even on older gcc compiler + * version */ #ifndef thread_local /* * Don't break on glibc < 2.16 that doesn't define __STDC_NO_THREADS__ @@ -313,4 +313,14 @@ do { \ #endif #endif +/* Define C11 noreturn without <stdnoreturn.h> and even on older gcc + * compiler versions */ +#ifndef noreturn +#if __STDC_VERSION__ >= 201112L +#define noreturn _Noreturn +#else +#define noreturn __attribute__((noreturn)) +#endif +#endif + #include "log.h" |