summaryrefslogtreecommitdiff
path: root/libguile/throw.c
diff options
context:
space:
mode:
Diffstat (limited to 'libguile/throw.c')
-rw-r--r--libguile/throw.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/libguile/throw.c b/libguile/throw.c
index b48bea1d1..cf6ea4a49 100644
--- a/libguile/throw.c
+++ b/libguile/throw.c
@@ -23,6 +23,7 @@
#endif
#include <stdio.h>
+#include <unistdio.h>
#include "libguile/_scm.h"
#include "libguile/async.h"
#include "libguile/smob.h"
@@ -59,7 +60,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 +82,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 +92,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 +195,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;
@@ -744,8 +745,12 @@ scm_ithrow (SCM key, SCM args, int noreturn SCM_UNUSED)
*/
fprintf (stderr, "throw from within critical section.\n");
if (scm_is_symbol (key))
- fprintf (stderr, "error key: %s\n", scm_i_symbol_chars (key));
-
+ {
+ if (scm_i_is_narrow_symbol (key))
+ fprintf (stderr, "error key: %s\n", scm_i_symbol_chars (key));
+ else
+ ulc_fprintf (stderr, "error key: %llU\n", scm_i_symbol_wide_chars (key));
+ }
for (; scm_is_pair (s); s = scm_cdr (s), i++)
{
@@ -884,7 +889,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. */