diff options
author | Ivan Maidanski <ivmai@mail.ru> | 2017-03-23 11:09:40 +0300 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2017-03-23 11:09:40 +0300 |
commit | 403d2f839b6b0b4ed2327411002cc1d6ba3fceca (patch) | |
tree | 2b1ed07ab00cbda4501be481699400723c8b3d9f /tools/setjmp_t.c | |
parent | 12bdc8bf767469bb678fc0eab78807f637773871 (diff) | |
download | bdwgc-403d2f839b6b0b4ed2327411002cc1d6ba3fceca.tar.gz |
Use sigsetjmp() in setjmp_t tool if available
* tools/setjmp_t.c (main): Replace jmp_buf, setjmp(), longjmp() to
JMP_BUF, SETJMP(), LONGJMP(), respectively; cast result of SETJMP() to
void type.
Diffstat (limited to 'tools/setjmp_t.c')
-rw-r--r-- | tools/setjmp_t.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/setjmp_t.c b/tools/setjmp_t.c index b3bb86da..2b4c4dc8 100644 --- a/tools/setjmp_t.c +++ b/tools/setjmp_t.c @@ -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); |