This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH 1/2] misc/sys/cdefs.h: Add _Noreturn macro for pre-C11 compilers
- From: Will Newton <will dot newton at linaro dot org>
- To: libc-alpha at sourceware dot org
- Date: Mon, 23 Jun 2014 17:12:25 +0100
- Subject: [PATCH 1/2] misc/sys/cdefs.h: Add _Noreturn macro for pre-C11 compilers
- Authentication-results: sourceware.org; auth=none
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