[MonoError] Add error checking macro
[mono.git] / mono / utils / mono-error-internals.h
index d16f9ef660245c8b944665b45f97c4f012c05f3d..cf90f7ef74fa7ea8c759cf3828487635feef9db6 100644 (file)
@@ -39,6 +39,9 @@ typedef struct {
 
 #define is_ok(error) ((error)->error_code == MONO_ERROR_NONE)
 
+#define return_if_nok (error) do { if (!mono_error_ok (error)) return; } while (0)
+#define return_val_if_nok (error,val) do { if (!mono_error_ok (error)) return val; } while (0)
+
 void
 mono_error_assert_ok_pos (MonoError *error, const char* filename, int lineno);