[Liboil-commit] 2 commits - configure.ac liboil/c liboil/liboilfault.c

David Schleef ds at kemper.freedesktop.org
Tue Feb 19 01:11:26 PST 2008


 configure.ac         |    1 +
 liboil/c/swab.c      |    2 +-
 liboil/liboilfault.c |   11 ++++++++++-
 3 files changed, 12 insertions(+), 2 deletions(-)

New commits:
commit 1b9a9cb481fefa51302d85f7b59a561006876508
Author: David Schleef <ds at ginger.bigkitten.com>
Date:   Tue Feb 19 01:13:21 2008 -0800

    Add test for sigsetjmp/siglongjmp

diff --git a/configure.ac b/configure.ac
index 208c8f2..0ddf776 100644
--- a/configure.ac
+++ b/configure.ac
@@ -137,6 +137,7 @@ AC_CHECK_HEADERS([inttypes.h])
 
 AC_CHECK_FUNCS([gettimeofday])
 AC_CHECK_FUNCS([sigaction])
+AC_CHECK_FUNCS([sigsetjmp])
 
 AC_CHECK_LIBM
 AC_SUBST(LIBM)
diff --git a/liboil/liboilfault.c b/liboil/liboilfault.c
index 0bbcd85..8876a90 100644
--- a/liboil/liboilfault.c
+++ b/liboil/liboilfault.c
@@ -55,6 +55,7 @@ static void
 illegal_instruction_handler (int num)
 {
   if (in_try_block) {
+#ifdef HAVE_SIGSETJMP
 #if 0
     /* alternate method of siglongjmp() */
     sigset_t set;
@@ -62,8 +63,12 @@ illegal_instruction_handler (int num)
     sigaddset (&set, SIGILL);
     sigprocmask (SIG_UNBLOCK, &set, NULL);
     longjmp (jump_env, 1);
-#endif
+#else
     siglongjmp (jump_env, 1);
+#endif
+#else
+    longjmp (jump_env, 1);
+#endif
   } else {
     abort ();
   }
@@ -117,7 +122,11 @@ oil_fault_check_try (void (*func) (void *), void *priv)
   int ret;
 
   in_try_block = 1;
+#ifdef HAVE_SIGSETJMP
   ret = sigsetjmp (jump_env, 1);
+#else
+  ret = setjmp (jump_env);
+#endif
   if (!ret) {
     func (priv);
   }
commit e0e21d0a039ec91302f86482456bfc5432d031e0
Author: David Schleef <ds at ginger.bigkitten.com>
Date:   Mon Feb 18 19:20:06 2008 -0800

    Some implementations of swab have bad prototypes.  Workaround.

diff --git a/liboil/c/swab.c b/liboil/c/swab.c
index 2e7d994..dac86b0 100644
--- a/liboil/c/swab.c
+++ b/liboil/c/swab.c
@@ -40,7 +40,7 @@
 static void
 swab_u16_libc (uint16_t *d, const uint16_t *s, int n)
 {
-  swab (s, d, n*2);
+  swab ((void *)s, (void *)d, n*2);
 }
 OIL_DEFINE_IMPL (swab_u16_libc, swab_u16);
 


More information about the Liboil-commit mailing list