[MonoError] Add error checking macro
authorLudovic Henry <ludovic@xamarin.com>
Tue, 2 Feb 2016 14:15:10 +0000 (14:15 +0000)
committerLudovic Henry <ludovic@xamarin.com>
Tue, 2 Feb 2016 14:27:44 +0000 (14:27 +0000)
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);