summaryrefslogtreecommitdiff
path: root/include/compiler.h
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@linux.intel.com>2016-12-20 02:29:58 -0800
committerH. Peter Anvin <hpa@linux.intel.com>2016-12-20 02:29:58 -0800
commitabd28c9ab953031be826b4bdd1b60cf855c4524c (patch)
tree1945a2b61676e250c5579c6d6d60e54f8c4fa2a5 /include/compiler.h
parentfd610f27d6814b321b2d4420d23cf43664abcaf0 (diff)
downloadnasm-abd28c9ab953031be826b4bdd1b60cf855c4524c.tar.gz
If we have new features introduced by C11, use them
Instead of using hacks or compiler-specific features, if we have standard features as defined in ISO C11, use them. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'include/compiler.h')
-rw-r--r--include/compiler.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/include/compiler.h b/include/compiler.h
index 2c4e6e3f..061b3441 100644
--- a/include/compiler.h
+++ b/include/compiler.h
@@ -77,6 +77,7 @@
# include "nasmint.h"
#endif
+#include <assert.h>
#include <stddef.h>
#include <stdarg.h>
#include <stdio.h>
@@ -208,7 +209,10 @@ char *strsep(char **, const char *);
/*
* How to tell the compiler that a function doesn't return
*/
-#ifdef HAVE_FUNC_ATTRIBUTE_NORETURN
+#ifdef HAVE_STDNORETURN_H
+# include <stdnoreturn.h>
+# define no_return noreturn void
+#elif defined(HAVE_FUNC_ATTRIBUTE_NORETURN)
# define no_return void __attribute__((noreturn))
#else
# define no_return void