[mono-error] Fix error_init macro to work with MonoError pointers.
[mono.git] / mono / utils / mono-error-internals.h
index 63607a8fb89eb962ba99887b2941a5963cd6a7ed..23bd0648157e60c71ce4a416d5a59eafc17a1063 100644 (file)
@@ -33,8 +33,8 @@ typedef struct {
 } MonoErrorInternal;
 
 #define error_init(error) do { \
-       (error)->error_code = MONO_ERROR_NONE;  \
-       (error)->flags = 0;     \
+       ((MonoErrorInternal*)(error))->error_code = MONO_ERROR_NONE;    \
+       ((MonoErrorInternal*)(error))->flags = 0;       \
 } while (0);
 
 #define is_ok(error) ((error)->error_code == MONO_ERROR_NONE)