diff options
author | Neil Jerram <neil@ossau.uklinux.net> | 2009-08-05 16:13:28 +0100 |
---|---|---|
committer | Neil Jerram <neil@ossau.uklinux.net> | 2009-08-21 23:29:08 +0100 |
commit | a4dbe1ac3dacf365263023c4fe1cd6ffb4a894b7 (patch) | |
tree | c2ac7763ec1dd7ed02196ef1e4c29565a7b21683 /libguile/throw.c | |
parent | d5ed380ec83a2f42cacc40697717679bf03e6857 (diff) | |
download | guile-a4dbe1ac3dacf365263023c4fe1cd6ffb4a894b7.tar.gz |
Avoid clash with system setjmp/longjmp on IA64
Problem was that if an application includes both libguile.h and the
system's setjmp.h, and is compiled on IA64, it gets compile errors
because of jmp_buf, setjmp and longjmp being multiply defined.
* libguile/__scm.h (__ia64__): Define scm_i_jmp_buf, SCM_I_SETJMP and
SCM_I_LONGJMP instead of jmp_buf, setjmp and longjmp.
(all other platforms): Map scm_i_jmp_buf, SCM_I_SETJMP and
SCM_I_LONGJMP to jmp_buf, setjmp and longjmp.
* libguile/continuations.c (scm_make_continuation): Use `SCM_I_SETJMP'
instead of `setjmp'.
(copy_stack_and_call): Use `SCM_I_LONJMP' instead of `longjmp'.
(scm_ia64_longjmp): Use type `scm_i_jmp_buf' instead of `jmp_buf'.
* libguile/continuations.h (scm_t_contregs): Use type `scm_i_jmp_buf'
instead of `jmp_buf'.
* libguile/threads.c (suspend): Use `SCM_I_SETJMP' instead of
`setjmp'.
* libguile/threads.h (scm_i_thread): Use type `scm_i_jmp_buf' instead
of `jmp_buf'.
* libguile/throw.c (JBJMPBUF, make_jmpbuf, jmp_buf_and_retval): Use
type `scm_i_jmp_buf' instead of `jmp_buf'.
(scm_c_catch): Use `SCM_I_SETJMP' instead of `setjmp'.
(scm_ithrow): Use `SCM_I_LONGJMP' instead of `longjmp'.
Diffstat (limited to 'libguile/throw.c')
-rw-r--r-- | libguile/throw.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libguile/throw.c b/libguile/throw.c index b48bea1d1..4413efadf 100644 --- a/libguile/throw.c +++ b/libguile/throw.c @@ -59,7 +59,7 @@ static scm_t_bits tc16_jmpbuffer; #define DEACTIVATEJB(x) \ (SCM_SET_CELL_WORD_0 ((x), (SCM_CELL_WORD_0 (x) & ~(1L << 16L)))) -#define JBJMPBUF(OBJ) ((jmp_buf *) SCM_CELL_WORD_1 (OBJ)) +#define JBJMPBUF(OBJ) ((scm_i_jmp_buf *) SCM_CELL_WORD_1 (OBJ)) #define SETJBJMPBUF(x, v) (SCM_SET_CELL_WORD_1 ((x), (scm_t_bits) (v))) #define SCM_JBDFRAME(x) ((scm_t_debug_frame *) SCM_CELL_WORD_2 (x)) #define SCM_SETJBDFRAME(x, v) (SCM_SET_CELL_WORD_2 ((x), (scm_t_bits) (v))) @@ -81,7 +81,7 @@ make_jmpbuf (void) { SCM answer; SCM_NEWSMOB2 (answer, tc16_jmpbuffer, 0, 0); - SETJBJMPBUF(answer, (jmp_buf *)0); + SETJBJMPBUF(answer, (scm_i_jmp_buf *)0); DEACTIVATEJB(answer); return answer; } @@ -91,7 +91,7 @@ make_jmpbuf (void) struct jmp_buf_and_retval /* use only on the stack, in scm_catch */ { - jmp_buf buf; /* must be first */ + scm_i_jmp_buf buf; /* must be first */ SCM throw_tag; SCM retval; }; @@ -194,7 +194,7 @@ scm_c_catch (SCM tag, pre_unwind.lazy_catch_p = 0; SCM_SETJBPREUNWIND(jmpbuf, &pre_unwind); - if (setjmp (jbr.buf)) + if (SCM_I_SETJMP (jbr.buf)) { SCM throw_tag; SCM throw_args; @@ -884,7 +884,7 @@ scm_ithrow (SCM key, SCM args, int noreturn SCM_UNUSED) jbr->throw_tag = key; jbr->retval = args; scm_i_set_last_debug_frame (SCM_JBDFRAME (jmpbuf)); - longjmp (*JBJMPBUF (jmpbuf), 1); + SCM_I_LONGJMP (*JBJMPBUF (jmpbuf), 1); } /* Otherwise, it's some random piece of junk. */ |