openbsd-ports/lang/mono/patches/patch-mono_mini_exceptions-arm_c
robert d3f436429f - update to the latest stable version: 2.6.3
- move to autoconf
- regen patches

ok ajacoutot@, jasper@
2010-03-20 17:16:44 +00:00

74 lines
1.8 KiB
Plaintext

$OpenBSD: patch-mono_mini_exceptions-arm_c,v 1.2 2010/03/20 17:16:44 robert Exp $
--- mono/mini/exceptions-arm.c.orig Sat Mar 20 18:01:34 2010
+++ mono/mini/exceptions-arm.c Sat Mar 20 18:03:17 2010
@@ -12,7 +12,9 @@
#include <glib.h>
#include <signal.h>
#include <string.h>
+#if HAVE_UCONTEXT_H
#include <ucontext.h>
+#endif
#include <mono/arch/arm/arm-codegen.h>
#include <mono/metadata/appdomain.h>
@@ -80,6 +82,7 @@ typedef struct ucontext {
* We define our own version here and use it instead.
*/
+#ifdef MONO_ARCH_USE_SIGACTION
#if __APPLE__
#define my_ucontext ucontext_t
#else
@@ -97,6 +100,7 @@ typedef struct my_ucontext {
*/
} my_ucontext;
#endif
+#endif
/*
* arch_get_restore_context:
@@ -467,6 +471,7 @@ mono_arch_find_jit_info_ext (MonoDomain *domain, MonoJ
void
mono_arch_sigctx_to_monoctx (void *sigctx, MonoContext *mctx)
{
+#ifdef MONO_ARCH_USE_SIGACTION
#if BROKEN_LINUX
g_assert_not_reached ();
#else
@@ -477,11 +482,13 @@ mono_arch_sigctx_to_monoctx (void *sigctx, MonoContext
memcpy (&mctx->regs, &UCONTEXT_REG_R0 (my_uc), sizeof (gulong) * 16);
#endif
mctx->ebp = mctx->regs [ARMREG_FP];
+#endif
}
void
mono_arch_monoctx_to_sigctx (MonoContext *mctx, void *ctx)
{
+#ifdef MONO_ARCH_USE_SIGACTION
#if BROKEN_LINUX
g_assert_not_reached ();
#else
@@ -492,6 +499,7 @@ mono_arch_monoctx_to_sigctx (MonoContext *mctx, void *
/* The upper registers are not guaranteed to be valid */
memcpy (&UCONTEXT_REG_R0 (my_uc), &mctx->regs, sizeof (gulong) * 12);
#endif
+#endif
}
/*
@@ -516,11 +524,13 @@ mono_arch_handle_exception (void *ctx, gpointer obj, g
gpointer
mono_arch_ip_from_context (void *sigctx)
{
+#ifdef MONO_ARCH_USE_SIGACTION
#if BROKEN_LINUX
g_assert_not_reached ();
#else
my_ucontext *my_uc = sigctx;
return (void*) UCONTEXT_REG_PC (my_uc);
+#endif
#endif
}