aboutsummaryrefslogtreecommitdiffstats
path: root/rdoff/rdoff.c
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2019-08-28 19:02:47 -0700
committerH. Peter Anvin <hpa@zytor.com>2019-08-28 19:02:47 -0700
commita73ccfebcc9f60e6f2234cbf10cf7551279524d3 (patch)
tree33b64566bc2d0d3bd203b5045245aea480937ef8 /rdoff/rdoff.c
parent6a4353c4c29274fb2df6ca712fad70b8701c9187 (diff)
downloadnasm-a73ccfebcc9f60e6f2234cbf10cf7551279524d3.tar.gz
nasm-a73ccfebcc9f60e6f2234cbf10cf7551279524d3.tar.xz
nasm-a73ccfebcc9f60e6f2234cbf10cf7551279524d3.zip
error: replace nasm_verror() indirection with preproc callback
Since pp_error_list_macros() was introduced, the only need for pp_verror() is to suppress error messages in certain contexts. Replace this function with a preprocessor callback, preproc->pp_suppress_error(), so we can drop the nasm_verror() function pointer entirely. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'rdoff/rdoff.c')
-rw-r--r--rdoff/rdoff.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/rdoff/rdoff.c b/rdoff/rdoff.c
index bdba82ae..77f2b42f 100644
--- a/rdoff/rdoff.c
+++ b/rdoff/rdoff.c
@@ -228,23 +228,24 @@ int rdf_errno = 0;
/* ========================================================================
* Hook for nasm_error() to work
* ======================================================================== */
-fatal_func nasm_verror_critical(errflags severity, const char *fmt, va_list val)
+void nasm_verror(errflags severity, const char *fmt, va_list val)
{
+ severity &= ERR_MASK;
+
vfprintf(stderr, fmt, val);
- exit((severity & ERR_MASK) - ERR_FATAL + 2);
+ if (severity >= ERR_FATAL)
+ exit(severity - ERR_FATAL + 1);
}
-static void rdoff_verror(errflags severity, const char *fmt, va_list val)
+fatal_func nasm_verror_critical(errflags severity, const char *fmt, va_list val)
{
- if ((severity & ERR_MASK) >= ERR_FATAL)
- nasm_verror_critical(severity, fmt, val);
- else
- vfprintf(stderr, fmt, val);
+ nasm_verror(severity, fmt, val);
+ abort();
}
void rdoff_init(void)
{
- nasm_set_verror(rdoff_verror);
+
}
/* ========================================================================