mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-07-05 12:16:37 +02:00
fixing non-threaded (and plan9) build
This commit is contained in:
parent
acbeeddfa0
commit
8ee3699095
3 changed files with 9 additions and 5 deletions
|
@ -1200,9 +1200,9 @@ enum sexp_context_globals {
|
|||
|
||||
#define sexp_read_char(x, p) (sexp_port_buf(p) ? ((sexp_port_offset(p) < sexp_port_size(p)) ? sexp_port_buf(p)[sexp_port_offset(p)++] : sexp_buffered_read_char(x, p)) : getc(sexp_port_stream(p)))
|
||||
#define sexp_push_char(x, c, p) ((c!=EOF) && (sexp_port_buf(p) ? (sexp_port_buf(p)[--sexp_port_offset(p)] = ((char)(c))) : ungetc(c, sexp_port_stream(p))))
|
||||
#define sexp_write_char(x, c, p) (sexp_port_buf(p) ? ((sexp_port_offset(p) < sexp_port_size(p)) ? ((((sexp_port_buf(p))[sexp_port_offset(p)++]) = (char)(c)), SEXP_VOID) : sexp_buffered_write_char(x, c, p)) : (putc(c, sexp_port_stream(p)), SEXP_VOID))
|
||||
#define sexp_write_string(x, s, p) (sexp_port_buf(p) ? sexp_buffered_write_string(x, s, p) : (fputs(s, sexp_port_stream(p)), SEXP_VOID))
|
||||
#define sexp_flush(x, p) (sexp_port_buf(p) ? sexp_buffered_flush(x, p) : (fflush(sexp_port_stream(p)), SEXP_VOID))
|
||||
#define sexp_write_char(x, c, p) (sexp_port_buf(p) ? ((sexp_port_offset(p) < sexp_port_size(p)) ? ((((sexp_port_buf(p))[sexp_port_offset(p)++]) = (char)(c)), 0) : sexp_buffered_write_char(x, c, p)) : putc(c, sexp_port_stream(p)))
|
||||
#define sexp_write_string(x, s, p) (sexp_port_buf(p) ? sexp_buffered_write_string(x, s, p) : fputs(s, sexp_port_stream(p)))
|
||||
#define sexp_flush(x, p) (sexp_port_buf(p) ? sexp_buffered_flush(x, p) : fflush(sexp_port_stream(p)))
|
||||
|
||||
SEXP_API int sexp_buffered_read_char (sexp ctx, sexp p);
|
||||
SEXP_API int sexp_buffered_write_char (sexp ctx, int c, sexp p);
|
||||
|
|
6
sexp.c
6
sexp.c
|
@ -1825,9 +1825,13 @@ sexp sexp_write_one (sexp ctx, sexp obj, sexp out) {
|
|||
sexp sexp_write_op (sexp ctx, sexp self, sexp_sint_t n, sexp obj, sexp out) {
|
||||
sexp res;
|
||||
sexp_assert_type(ctx, sexp_oportp, SEXP_OPORT, out);
|
||||
#if SEXP_USE_GREEN_THREADS
|
||||
sexp_maybe_block_output_port(ctx, out);
|
||||
#endif
|
||||
res = sexp_write_one(ctx, obj, out);
|
||||
#if SEXP_USE_GREEN_THREADS
|
||||
sexp_maybe_unblock_port(ctx, out);
|
||||
#endif
|
||||
return res;
|
||||
}
|
||||
|
||||
|
@ -1849,8 +1853,10 @@ sexp sexp_flush_output_op (sexp ctx, sexp self, sexp_sint_t n, sexp out) {
|
|||
sexp_assert_type(ctx, sexp_oportp, SEXP_OPORT, out);
|
||||
res = sexp_flush(ctx, out);
|
||||
if (res == EOF) {
|
||||
#if SEXP_USE_GREEN_THREADS
|
||||
if (sexp_port_stream(out) && ferror(sexp_port_stream(out)) && (errno == EAGAIN))
|
||||
return sexp_global(ctx, SEXP_G_IO_BLOCK_ERROR);
|
||||
#endif
|
||||
return SEXP_FALSE;
|
||||
}
|
||||
return SEXP_TRUE;
|
||||
|
|
2
vm.c
2
vm.c
|
@ -840,8 +840,6 @@ static sexp sexp_print_vm_profile (sexp ctx, sexp self, sexp_sint_t n) {
|
|||
#define sexp_ensure_stack(n)
|
||||
#endif
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
sexp sexp_apply (sexp ctx, sexp proc, sexp args) {
|
||||
unsigned char *ip;
|
||||
sexp bc, cp, *stack = sexp_stack_data(sexp_context_stack(ctx));
|
||||
|
|
Loading…
Add table
Reference in a new issue