[Mesa-dev] [PATCH 6/9] util: Add a NORETURN macro
Jason Ekstrand
jason at jlekstrand.net
Thu Aug 17 17:22:20 UTC 2017
---
configure.ac | 1 +
src/util/macros.h | 6 ++++++
2 files changed, 7 insertions(+)
diff --git a/configure.ac b/configure.ac
index e3babd3..9e152b8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -245,6 +245,7 @@ AX_GCC_FUNC_ATTRIBUTE([visibility])
AX_GCC_FUNC_ATTRIBUTE([warn_unused_result])
AX_GCC_FUNC_ATTRIBUTE([weak])
AX_GCC_FUNC_ATTRIBUTE([alias])
+AX_GCC_FUNC_ATTRIBUTE([noreturn])
AM_CONDITIONAL([GEN_ASM_OFFSETS], test "x$GEN_ASM_OFFSETS" = xyes)
diff --git a/src/util/macros.h b/src/util/macros.h
index a9a52a1..ab946d5 100644
--- a/src/util/macros.h
+++ b/src/util/macros.h
@@ -171,6 +171,12 @@ do { \
#define ATTRIBUTE_RETURNS_NONNULL
#endif
+#ifdef HAVE_FUNC_ATTRIBUTE_NORETURN
+#define NORETURN __attribute__((__noreturn__))
+#else
+#define NORETURN
+#endif
+
#ifdef __cplusplus
/**
* Macro function that evaluates to true if T is a trivially
--
2.5.0.400.gff86faf
More information about the mesa-dev
mailing list