[loader] Add mono_class_set_type_load_failure ()
[mono.git] / mono / metadata / marshal.c
index d12e345ca26f4f399373e70077e13595d9a9160d..f25fd94f18bee418233e9c1716615bc560d9333c 100644 (file)
 #include <string.h>
 #include <errno.h>
 
+#if defined(HOST_WIN32)
+#include <objbase.h>
+#endif
+
 /* #define DEBUG_RUNTIME_CODE */
 
 #define OPDEF(a,b,c,d,e,f,g,h,i,j) \
@@ -9365,7 +9369,7 @@ mono_marshal_get_synchronized_wrapper (MonoMethod *method)
 #endif
 
        if (method->klass->valuetype && !(method->flags & MONO_METHOD_ATTR_STATIC)) {
-               mono_class_set_failure (method->klass, MONO_EXCEPTION_TYPE_LOAD, NULL);
+               mono_class_set_type_load_failure (method->klass, "");
 #ifndef DISABLE_JIT
                /* This will throw the type load exception when the wrapper is compiled */
                mono_mb_emit_byte (mb, CEE_LDNULL);
@@ -10531,7 +10535,7 @@ mono_marshal_alloc (gulong size, MonoError *error)
 #else
        res = g_try_malloc ((gulong)size);
        if (!res)
-               mono_error_set_out_of_memory (error, "Could not allocate %i bytes", size);
+               mono_error_set_out_of_memory (error, "Could not allocate %lu bytes", size);
 #endif
        return res;
 }