]> granicus.if.org Git - yasm/commitdiff
* errwarn.c (yasm_error_matches): Make real function, fix a bug with checking
authorPeter Johnson <peter@tortall.net>
Sun, 7 May 2006 02:35:50 +0000 (02:35 -0000)
committerPeter Johnson <peter@tortall.net>
Sun, 7 May 2006 02:35:50 +0000 (02:35 -0000)
against YASM_ERROR_GENERAL errors.
* errwarn.h (yasm_error_matches): Remove #defined function.

svn path=/trunk/yasm/; revision=1525

libyasm/errwarn.c
libyasm/errwarn.h

index ca0dd90fa259468c81b56e72761ee764f131256a..44c73e89629d34357d72f6bf79e89172e288fd9e 100644 (file)
@@ -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)
 {
index 97853afdc200afc9d1b9d8faf8d580a7c0d22359..1a9e82f2aeefec6673734259da8acf6307bd70f2 100644 (file)
@@ -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