From ddb2f6734c1ebbaa6ad51d8456d6e1287c6630c2 Mon Sep 17 00:00:00 2001 From: Ludovic Henry Date: Tue, 2 Feb 2016 14:15:10 +0000 Subject: [PATCH] [MonoError] Add error checking macro --- mono/utils/mono-error-internals.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mono/utils/mono-error-internals.h b/mono/utils/mono-error-internals.h index d16f9ef6602..cf90f7ef74f 100644 --- a/mono/utils/mono-error-internals.h +++ b/mono/utils/mono-error-internals.h @@ -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); -- 2.11.4.GIT