mirror of
https://github.com/netwide-assembler/nasm.git
synced 2025-04-12 18:40:23 +08:00
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>
This commit is contained in:
parent
86eb8b057f
commit
84280bbf88
@ -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 */
|
||||
|
@ -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);
|
||||
|
@ -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))) \
|
||||
|
Loading…
x
Reference in New Issue
Block a user