summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2009-07-05 19:22:28 -0700
committerH. Peter Anvin <hpa@zytor.com>2009-07-05 19:22:28 -0700
commit84280bbf8878573af3c88970397889ad7f240564 (patch)
treef20478ce42136a691b7e9e095c9baec86ac5414c
parent86eb8b057f6e5a9daf5c2f36420bbf245836d2ac (diff)
downloadnasm-84280bbf8878573af3c88970397889ad7f240564.tar.gz
Change noreturn macro to no_return to avoid header file problems
Change the "noreturn" macro to "no_return", to avoid problems with system header files which use __attribute__((noreturn)) rather than __attribute__((__noreturn__)) as is appropriate for system headers. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
-rw-r--r--compiler.h4
-rw-r--r--nasmlib.c2
-rw-r--r--nasmlib.h2
3 files changed, 4 insertions, 4 deletions
diff --git a/compiler.h b/compiler.h
index 312b027a..d96ebcb4 100644
--- a/compiler.h
+++ b/compiler.h
@@ -174,9 +174,9 @@ char *strsep(char **, const char *);
* How to tell the compiler that a function doesn't return
*/
#ifdef __GNUC__
-# define noreturn void __attribute__((noreturn))
+# define no_return void __attribute__((noreturn))
#else
-# define noreturn void
+# define no_return void
#endif
#endif /* NASM_COMPILER_H */
diff --git a/nasmlib.c b/nasmlib.c
index 2dd3a658..6314dc64 100644
--- a/nasmlib.c
+++ b/nasmlib.c
@@ -205,7 +205,7 @@ char *nasm_strndup(const char *s, size_t len)
return p;
}
-noreturn nasm_assert_failed(const char *file, int line, const char *msg)
+no_return nasm_assert_failed(const char *file, int line, const char *msg)
{
nasm_malloc_error(ERR_FATAL, "assertion %s failed at %s:%d",
msg, file, line);
diff --git a/nasmlib.h b/nasmlib.h
index 0cad760e..8abec1cb 100644
--- a/nasmlib.h
+++ b/nasmlib.h
@@ -171,7 +171,7 @@ char *nasm_strndup_log(const char *, int, const char *, size_t);
/*
* NASM assert failure
*/
-noreturn nasm_assert_failed(const char *, int, const char *);
+no_return nasm_assert_failed(const char *, int, const char *);
#define nasm_assert(x) \
do { \
if (unlikely(!(x))) \