1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 03:40:34 +02:00

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'.
This commit is contained in:
Neil Jerram 2009-08-05 16:13:28 +01:00
parent d5ed380ec8
commit a4dbe1ac3d
6 changed files with 26 additions and 17 deletions

View file

@ -312,7 +312,7 @@ unblock_from_queue (SCM queue)
var 't'
// save registers.
SCM_FLUSH_REGISTER_WINDOWS; // sparc only
setjmp (t->regs); // here's most of the magic
SCM_I_SETJMP (t->regs); // here's most of the magic
... and returns.
@ -366,7 +366,7 @@ unblock_from_queue (SCM queue)
t->top = SCM_STACK_PTR (&t);
// save registers.
SCM_FLUSH_REGISTER_WINDOWS;
setjmp (t->regs);
SCM_I_SETJMP (t->regs);
res = func(data);
scm_enter_guile (t);
@ -425,7 +425,7 @@ suspend (void)
t->top = SCM_STACK_PTR (&t);
/* save registers. */
SCM_FLUSH_REGISTER_WINDOWS;
setjmp (t->regs);
SCM_I_SETJMP (t->regs);
return t;
}