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>
diff --git a/include/compiler.h b/include/compiler.h
index 2c4e6e3..061b344 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 @@
/*
* 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