From: Peter Johnson Date: Sun, 7 May 2006 02:35:50 +0000 (-0000) Subject: * errwarn.c (yasm_error_matches): Make real function, fix a bug with checking X-Git-Tag: v0.5.0~9^2~11 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2f1e7fa171e15f567a417f9dc67797fc05476340;p=yasm * errwarn.c (yasm_error_matches): Make real function, fix a bug with checking against YASM_ERROR_GENERAL errors. * errwarn.h (yasm_error_matches): Remove #defined function. svn path=/trunk/yasm/; revision=1525 --- diff --git a/libyasm/errwarn.c b/libyasm/errwarn.c index ca0dd90f..44c73e89 100644 --- a/libyasm/errwarn.c +++ b/libyasm/errwarn.c @@ -257,6 +257,16 @@ yasm_error_clear(void) yasm_exrefstr = NULL; } +int +yasm_error_matches(yasm_error_class eclass) +{ + if (yasm_eclass == YASM_ERROR_NONE) + return eclass == YASM_ERROR_NONE; + if (yasm_eclass == YASM_ERROR_GENERAL) + return eclass == YASM_ERROR_GENERAL; + return (yasm_eclass & eclass) == eclass; +} + void yasm_error_set_va(yasm_error_class eclass, const char *format, va_list va) { diff --git a/libyasm/errwarn.h b/libyasm/errwarn.h index 97853afd..1a9e82f2 100644 --- a/libyasm/errwarn.h +++ b/libyasm/errwarn.h @@ -131,9 +131,6 @@ int yasm_error_matches(yasm_error_class eclass); #ifndef YASM_DOXYGEN extern yasm_error_class yasm_eclass; #define yasm_error_occurred() yasm_eclass -#define yasm_error_matches(eclass) (yasm_eclass != YASM_ERROR_NONE && \ - ((eclass) == YASM_ERROR_GENERAL || \ - (yasm_eclass & (eclass)) == (eclass))) #endif /** Set the error indicator (va_list version). Has no effect if the error