#include "mono/utils/mono-counters.h"
#include "mono/utils/mono-hwcap.h"
#include "mono/utils/mono-logger-internals.h"
+#include "mono/utils/w32handle.h"
#include "mini.h"
#include "jit.h"
if (exc) {
mono_unhandled_exception (exc);
mono_invoke_unhandled_exception_hook (exc);
- return 1;
+ g_assert_not_reached ();
}
return res;
} else {
int res = mono_runtime_run_main_checked (method, argc, argv, &error);
- mono_error_raise_exception (&error); /* FIXME don't raise here */
+ if (!is_ok (&error)) {
+ MonoException *ex = mono_error_convert_to_exception (&error);
+ if (ex) {
+ mono_unhandled_exception (&ex->object);
+ mono_invoke_unhandled_exception_hook (&ex->object);
+ g_assert_not_reached ();
+ }
+ }
return res;
}
}
#define error_if_aot_unsupported()
#endif
-#ifdef HOST_WIN32
-BOOL APIENTRY DllMain (HMODULE module_handle, DWORD reason, LPVOID reserved)
-{
- if (!mono_gc_dllmain (module_handle, reason, reserved))
- return FALSE;
-
- switch (reason)
- {
- case DLL_PROCESS_ATTACH:
- mono_install_runtime_load (mini_init);
- break;
- case DLL_PROCESS_DETACH:
- if (coree_module_handle)
- FreeLibrary (coree_module_handle);
- break;
- case DLL_THREAD_DETACH:
- mono_thread_info_detach ();
- break;
-
- }
- return TRUE;
-}
-#endif
-
static gboolean enable_debugging;
/*
} else if (strcmp (argv [i], "--llvmonly") == 0) {
mono_aot_only = TRUE;
mono_llvm_only = TRUE;
+ } else if (strcmp (argv [i], "--hybrid-aot") == 0) {
} else if (strcmp (argv [i], "--print-vtable") == 0) {
mono_print_vtable = TRUE;
} else if (strcmp (argv [i], "--stats") == 0) {
mono_counters_init ();
+#ifndef HOST_WIN32
+ mono_w32handle_init ();
+#endif
+
/* Set rootdir before loading config */
mono_set_rootdir ();