@@ -1,8 +1,8 @@ diff -uNr tcc-0.9.26.orig/libtcc.c tcc-0.9.26-1tclio/libtcc.c --- tcc-0.9.26.orig/libtcc.c 2013-02-15 08:24:00.000000000 -0600 -+++ tcc-0.9.26-1tclio/libtcc.c 2014-05-01 20:13:50.626814210 -0500 ++++ tcc-0.9.26-1tclio/libtcc.c 2014-05-01 21:14:22.272599405 -0500 @@ -669,7 +669,7 @@ bf->line_num = 1; bf->ifndef_macro = 0; bf->ifdef_stack_ptr = s1->ifdef_stack_ptr; - bf->fd = -1; @@ -95,11 +95,11 @@ if (size <= 0) { tcc_error_noabort("could not read header"); goto the_end; diff -uNr tcc-0.9.26.orig/tcc.h tcc-0.9.26-1tclio/tcc.h --- tcc-0.9.26.orig/tcc.h 2013-02-15 08:24:00.000000000 -0600 -+++ tcc-0.9.26-1tclio/tcc.h 2014-05-01 19:55:39.093986611 -0500 ++++ tcc-0.9.26-1tclio/tcc.h 2014-05-01 21:14:22.294602204 -0500 @@ -429,7 +429,7 @@ typedef struct BufferedFile { uint8_t *buf_ptr; uint8_t *buf_end; - int fd; @@ -154,11 +154,11 @@ ST_FUNC int pe_output_file(TCCState * s1, const char *filename); ST_FUNC int pe_putimport(TCCState *s1, int dllindex, const char *name, addr_t value); ST_FUNC SValue *pe_getimport(SValue *sv, SValue *v2); diff -uNr tcc-0.9.26.orig/tcccoff.c tcc-0.9.26-1tclio/tcccoff.c --- tcc-0.9.26.orig/tcccoff.c 2013-02-15 08:24:00.000000000 -0600 -+++ tcc-0.9.26-1tclio/tcccoff.c 2014-05-01 20:02:37.695836363 -0500 ++++ tcc-0.9.26-1tclio/tcccoff.c 2014-05-01 21:14:22.295602331 -0500 @@ -858,10 +858,11 @@ return 0; } -ST_FUNC int tcc_load_coff(TCCState * s1, int fd) @@ -186,11 +186,11 @@ if (!f) { tcc_error("Unable to open .out file for input"); } diff -uNr tcc-0.9.26.orig/tccelf.c tcc-0.9.26-1tclio/tccelf.c --- tcc-0.9.26.orig/tccelf.c 2013-02-15 08:24:00.000000000 -0600 -+++ tcc-0.9.26-1tclio/tccelf.c 2014-05-01 20:14:26.278515126 -0500 ++++ tcc-0.9.26-1tclio/tccelf.c 2014-05-01 21:14:22.301603094 -0500 @@ -2334,13 +2334,13 @@ return ret; } -static void *load_data(int fd, unsigned long file_offset, unsigned long size) @@ -321,11 +321,11 @@ /* test CPU specific stuff */ if (ehdr.e_ident[5] != ELFDATA2LSB || diff -uNr tcc-0.9.26.orig/tccpe.c tcc-0.9.26-1tclio/tccpe.c --- tcc-0.9.26.orig/tccpe.c 2013-02-15 08:24:00.000000000 -0600 -+++ tcc-0.9.26-1tclio/tccpe.c 2014-05-01 20:09:11.572909155 -0500 ++++ tcc-0.9.26-1tclio/tccpe.c 2014-05-01 21:14:22.302603222 -0500 @@ -1505,10 +1505,10 @@ /* ------------------------------------------------------------- */ -static int read_mem(int fd, unsigned offset, void *buffer, unsigned len) @@ -388,11 +388,11 @@ { int ret = -1; char buf[10]; diff -uNr tcc-0.9.26.orig/tccpp.c tcc-0.9.26-1tclio/tccpp.c --- tcc-0.9.26.orig/tccpp.c 2013-02-15 08:24:00.000000000 -0600 -+++ tcc-0.9.26-1tclio/tccpp.c 2014-05-01 20:12:26.967021662 -0500 ++++ tcc-0.9.26-1tclio/tccpp.c 2014-05-01 22:25:10.373511188 -0500 @@ -360,13 +360,13 @@ int len; /* only tries to read if really end of buffer */ if (bf->buf_ptr >= bf->buf_end) { - if (bf->fd != -1) { @@ -405,5 +405,14 @@ - len = read(bf->fd, bf->buffer, len); + len = Tcl_Read(bf->fd, bf->buffer, len); if (len < 0) len = 0; } else { +@@ -1484,7 +1484,7 @@ + goto include_done; + } + +- if (tcc_open(s1, buf1) < 0) ++ if (tcc_open(s1, buf1) == NULL) + include_trynext: + continue; +