This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH 1/2] misc/sys/cdefs.h: Add _Noreturn macro for pre-C11 compilers


From: Paul Eggert <eggert@cs.ucla.edu>

2014-03-28  Paul Eggert  <eggert@cs.ucla.edu>

	* misc/sys/cdefs.h (_Noreturn): New macro, for pre-C11 compilers.
---
 misc/sys/cdefs.h | 8 ++++++++
 1 file changed, 8 insertions(+)

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 <bits/wordsize.h>
 
 #if defined __LONG_DOUBLE_MATH_OPTIONAL && defined __NO_LONG_DOUBLE_MATH
-- 
1.9.3


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]