dotgnu-libjit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Libjit-developers] __int64 on cygwin


From: Paul Brannan
Subject: Re: [Libjit-developers] __int64 on cygwin
Date: Sat, 09 Feb 2008 10:46:59 -0500
User-agent: Thunderbird 2.0.0.9 (Windows/20071031)

One more try:

CC=gcc CXX=g++ ac_cv_func__setjmp=no ./configure

Seems that the _setjmp function is not declared in any header files on cygwin, so you can't take its address.

It's unclear to me why _setjmp is preferred over setjmp in the first place, other than that setjmp is likely to be a macro. In that case it makes more sense to create a wrapper for setjmp instead, though I suppose this could have performance implications.

An alternate solution would be to change configure.in to check if it is possible to take the address of _setjmp, though I believe the following solution is more portable.

Paul


--- jit-insn.c.bk       2008-02-09 10:36:06.781250000 -0500
+++ jit-insn.c  2008-02-09 10:39:32.937500000 -0500
@@ -7097,6 +7097,24 @@
        return func->builder->thrown_exception;
 }

+#if defined(HAVE_SIGSETJMP)
+
+/* Wrapper for sigsetjmp in case it is implemented as a macro */
+static int call_sigsetjmp(sigjmp_buf env, int savesigs)
+{
+  return setjmp(env);
+}
+
+#else
+
+/* Wrapper for setjmp in case it is implemented as a macro */
+static int call_setjmp(jmp_buf env)
+{
+  return setjmp(env);
+}
+
+#endif
+
 /*
  * Initialize the "setjmp" setup block that is needed to catch exceptions
  * thrown back to this level of execution.  The block looks like this:
@@ -7197,15 +7215,9 @@
        }
        args[0] = jit_insn_address_of(func, func->builder->setjmp_value);
args[1] = jit_value_create_nint_constant(func, jit_type_sys_int, 1);
-#if defined(HAVE___SIGSETJMP)
        value = jit_insn_call_native
-               (func, "__sigsetjmp", (void *)__sigsetjmp,
+               (func, "sigsetjmp", (void *)call_sigsetjmp,
                 type, args, 2, JIT_CALL_NOTHROW);
-#else
-       value = jit_insn_call_native
-               (func, "sigsetjmp", (void *)sigsetjmp,
-                type, args, 2, JIT_CALL_NOTHROW);
-#endif
        jit_type_free(type);
        if(!value)
        {
@@ -7221,14 +7233,8 @@
        }
        args[0] = jit_insn_address_of(func, func->builder->setjmp_value);

-#if defined(HAVE__SETJMP)
        value = jit_insn_call_native
- (func, "_setjmp", (void *)_setjmp, type, args, 1, JIT_CALL_NOTHROW);
-
-#else
-       value = jit_insn_call_native
- (func, "setjmp", (void *)setjmp, type, args, 1, JIT_CALL_NOTHROW);
-#endif
+ (func, "setjmp", (void *)call_setjmp, type, args, 1, JIT_CALL_NOTHROW);

        jit_type_free(type);
        if(!value)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]