diff options
author | H. Peter Anvin <hpa@zytor.com> | 2019-08-28 19:02:47 -0700 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2019-08-28 19:02:47 -0700 |
commit | a73ccfebcc9f60e6f2234cbf10cf7551279524d3 (patch) | |
tree | 33b64566bc2d0d3bd203b5045245aea480937ef8 /include | |
parent | 6a4353c4c29274fb2df6ca712fad70b8701c9187 (diff) | |
download | nasm-a73ccfebcc9f60e6f2234cbf10cf7551279524d3.tar.gz |
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 'include')
-rw-r--r-- | include/error.h | 10 | ||||
-rw-r--r-- | include/nasm.h | 3 |
2 files changed, 4 insertions, 9 deletions
diff --git a/include/error.h b/include/error.h index 07bd5c7d..3bfe30a6 100644 --- a/include/error.h +++ b/include/error.h @@ -72,17 +72,9 @@ fatal_func printf_func(2, 3) nasm_panicf(errflags flags, const char *fmt, ...); fatal_func nasm_panic_from_macro(const char *file, int line); #define panic() nasm_panic_from_macro(__FILE__, __LINE__); -typedef void (*vefunc) (errflags severity, const char *fmt, va_list ap); -extern vefunc nasm_verror; +void nasm_verror(errflags severity, const char *fmt, va_list ap); fatal_func nasm_verror_critical(errflags severity, const char *fmt, va_list ap); -static inline vefunc nasm_set_verror(vefunc ve) -{ - vefunc old_verror = nasm_verror; - nasm_verror = ve; - return old_verror; -} - /* * These are the error severity codes which get passed as the first * argument to an efunc. diff --git a/include/nasm.h b/include/nasm.h index 9bd42a75..2a207a03 100644 --- a/include/nasm.h +++ b/include/nasm.h @@ -391,6 +391,9 @@ struct preproc_ops { /* Unwind the macro stack when printing an error message */ void (*error_list_macros)(errflags severity); + + /* Return true if an error message should be suppressed */ + bool (*suppress_error)(errflags severity); }; extern const struct preproc_ops nasmpp; |