-CC = gcc34
-CFLAGS = -Os -ffast-math -march=pentium4 -Wall -fomit-frame-pointer
+CC = gcc
+CFLAGS = -g -Wall
LIBS = -lm
STRIP = strip
f: $(OBJS)
$(CC) $(LIBS) -o $@ $(OBJS)
- $(STRIP) $@
+# $(STRIP) $@
clean:
rm -f $(OBJS)
\r
+ native:\r
\r
+- fix error postoning -- not all errors thrown by i/o code are\r
+ postponed\r
- sbuf-hashcode\r
- vector-hashcode\r
- irc: stack underflow?\r
DEFER: add-write-io-task
DEFER: write-fd-8
DEFER: add-copy-io-task
+DEFER: pending-io-error
DEFER: next-io-task
IN: math
add-write-io-task
write-fd-8
add-copy-io-task
+ pending-io-error
next-io-task
room
os-env
dup wait-to-accept accept-fd ;
: blocking-copy ( in out -- )
- [ add-copy-io-task (yield) ] callcc0 2drop ;
+ [ add-copy-io-task (yield) ] callcc0
+ pending-io-error pending-io-error ;
general_error(ERROR_IO,io_error);
}
}
+
+void primitive_pending_io_error(void)
+{
+ pending_io_error(untag_port(dpop()));
+}
void postpone_io_error(PORT* port, const char* func);
void io_error(const char* func);
void pending_io_error(PORT* port);
+void primitive_pending_io_error(void);
primitive_add_write_io_task,
primitive_write_8,
primitive_add_copy_io_task,
+ primitive_pending_io_error,
primitive_next_io_task,
primitive_room,
primitive_os_env,
extern XT primitives[];
-#define PRIMITIVE_COUNT 147
+#define PRIMITIVE_COUNT 148
CELL primitive_to_xt(CELL primitive);
{
CELL buf_capacity;
- pending_io_error(port);
-
if(port->type != PORT_WRITE)
general_error(ERROR_INCOMPATIBLE_PORT,tag_object(port));
{
PORT* port = untag_port(dpop());
FIXNUM len = to_fixnum(dpop());
+ pending_io_error(port);
dpush(tag_boolean(can_write(port,len)));
}
{
char c = (char)ch;
+ pending_io_error(port);
+
if(!can_write(port,1))
io_error(__FUNCTION__);
{
char* c_str;
+ pending_io_error(port);
+
/* Note this ensures the buffer is large enough to fit the string */
if(!can_write(port,str->capacity))
io_error(__FUNCTION__);