From c4c4124473c187b5c4642611390897666c3d3970 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Fri, 28 Mar 2014 11:59:41 -0700 Subject: [PATCH] misc/sys/cdefs.h: Add _Noreturn macro for pre-C11 compilers 2014-07-02 Will Newton Paul Eggert * misc/sys/cdefs.h (_Noreturn): New macro, for pre-C11 compilers. --- ChangeLog | 5 +++++ misc/sys/cdefs.h | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/ChangeLog b/ChangeLog index 7401bf2..934c47c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2014-07-02 Will Newton + Paul Eggert + + * misc/sys/cdefs.h (_Noreturn): New macro, for pre-C11 compilers. + 2014-07-02 Siddhesh Poyarekar * resolv/gethnamaddr.c: Add comment warning that the file is diff --git a/misc/sys/cdefs.h b/misc/sys/cdefs.h index 4d958ea..a5c3224 100644 --- a/misc/sys/cdefs.h +++ b/misc/sys/cdefs.h @@ -382,6 +382,14 @@ # define __glibc_likely(cond) (cond) #endif +#if !defined _Noreturn && __STDC_VERSION__ < 201112 && !__GNUC_PREREQ (4,7) +# if __GNUC_PREREQ (2,8) +# define _Noreturn __attribute__ ((__noreturn__)) +# else +# define _Noreturn +# endif +#endif + #include #if defined __LONG_DOUBLE_MATH_OPTIONAL && defined __NO_LONG_DOUBLE_MATH -- 2.7.4