Merge pull request #986 from ninjarobot/patch-1
[mono.git] / mono / mini / mini-windows.c
index 2ab8aa1367b8fcfd4abd15757aa78aa6a0b6ece4..46a317c4fc460009c139ed1a4101ec62f986910b 100644 (file)
@@ -38,7 +38,7 @@
 #include <mono/utils/mono-math.h>
 #include <mono/utils/mono-compiler.h>
 #include <mono/utils/mono-counters.h>
-#include <mono/utils/mono-logger.h>
+#include <mono/utils/mono-logger-internal.h>
 #include <mono/utils/mono-mmap.h>
 #include <mono/utils/dtrace.h>
 
 
 #include "jit-icalls.h"
 
+gboolean mono_win_chained_exception_needs_run;
+
 void
 mono_runtime_install_handlers (void)
 {
+#ifndef MONO_CROSS_COMPILE
        win32_seh_init();
        win32_seh_set_handler(SIGFPE, mono_sigfpe_signal_handler);
        win32_seh_set_handler(SIGILL, mono_sigill_signal_handler);
        win32_seh_set_handler(SIGSEGV, mono_sigsegv_signal_handler);
        if (mini_get_debug_options ()->handle_sigint)
                win32_seh_set_handler(SIGINT, mono_sigint_signal_handler);
+#endif
 }
 
 void
 mono_runtime_cleanup_handlers (void)
 {
+#ifndef MONO_CROSS_COMPILE
        win32_seh_cleanup();
+#endif
+}
+
+
+/* mono_chain_signal:
+ *
+ *   Call the original signal handler for the signal given by the arguments, which
+ * should be the same as for a signal handler. Returns TRUE if the original handler
+ * was called, false otherwise.
+ */
+gboolean
+SIG_HANDLER_SIGNATURE (mono_chain_signal)
+{
+       mono_win_chained_exception_needs_run = TRUE;
+       return TRUE;
 }
 
 static HANDLE win32_main_thread;
@@ -114,3 +134,11 @@ void
 mono_runtime_shutdown_stat_profiler (void)
 {
 }
+
+gboolean
+mono_thread_state_init_from_handle (MonoThreadUnwindState *tctx, MonoNativeThreadId thread_id, MonoNativeThreadHandle thread_handle)
+{
+       g_error ("Windows systems haven't been ported to support mono_thread_state_init_from_handle");
+       return FALSE;
+}
+