Use sigsetjmp() in setjmp_t tool if available
authorIvan Maidanski <ivmai@mail.ru>
Thu, 23 Mar 2017 08:09:40 +0000 (11:09 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Thu, 23 Mar 2017 08:09:40 +0000 (11:09 +0300)
* tools/setjmp_t.c (main): Replace jmp_buf, setjmp(), longjmp() to
JMP_BUF, SETJMP(), LONGJMP(), respectively; cast result of SETJMP() to
void type.

tools/setjmp_t.c

index b3bb86d..2b4c4dc 100644 (file)
@@ -80,7 +80,7 @@ int main(void)
 {
     volatile word sp;
     unsigned ps = GETPAGESIZE();
-    jmp_buf b;
+    JMP_BUF b;
     register int x = (int)strlen("a");  /* 1, slightly disguised */
     static volatile int y = 0;
 
@@ -109,7 +109,7 @@ int main(void)
     x = 2*x-1;
     printf("\n");
     x = 2*x-1;
-    setjmp(b);
+    (void)SETJMP(b);
     if (y == 1) {
       if (x == 2) {
         printf("Setjmp-based generic mark_regs code probably won't work.\n");
@@ -123,7 +123,7 @@ int main(void)
     }
     y++;
     x = 2;
-    if (y == 1) longjmp(b,1);
+    if (y == 1) LONGJMP(b, 1);
     printf("Some GC internal configuration stuff: \n");
     printf("\tWORDSZ = %lu, ALIGNMENT = %d, GC_GRANULE_BYTES = %d\n",
            (unsigned long)WORDSZ, ALIGNMENT, GC_GRANULE_BYTES);