Skip to content

Commit 9f9b44c

Browse files
author
ESL
committed
fixes needed for Wasm build
1 parent 3fa772b commit 9f9b44c

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

siof.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -835,7 +835,7 @@ static int iportpeekc(obj o) {
835835
}
836836
/* closed input ports */
837837
static void cifree(void *p) {}
838-
static void ciclose(void *p) {}
838+
static int ciclose(void *p) { return 0; }
839839
static int cigetch(void *p) { return EOF; }
840840
static int ciungetch(int c) { return c; }
841841
static cxtype_iport_t cxt_iport_closed = {
@@ -857,8 +857,8 @@ sifile_t *sialloc(char *p, void *base) {
857857
extern sifile_t *sialloc(char *p, void *base);
858858
static void sifree(sifile_t *fp) {
859859
assert(fp); if (fp->base) free(fp->base); free(fp); }
860-
static void siclose(sifile_t *fp) {
861-
assert(fp); if (fp->base) free(fp->base); fp->base = NULL; fp->p = ""; }
860+
static int siclose(sifile_t *fp) {
861+
assert(fp); if (fp->base) free(fp->base); fp->base = NULL; fp->p = ""; return 0; }
862862
static int sigetch(sifile_t *fp) {
863863
int c; assert(fp && fp->p); if (!(c = *(fp->p))) return EOF; ++(fp->p); return c; }
864864
static int siungetch(int c, sifile_t *fp) {
@@ -876,8 +876,8 @@ bvifile_t *bvialloc(unsigned char *p, unsigned char *e, void *base) {
876876
extern bvifile_t *bvialloc(unsigned char *p, unsigned char *e, void *base);
877877
static void bvifree(bvifile_t *fp) {
878878
assert(fp); if (fp->base) free(fp->base); free(fp); }
879-
static void bviclose(bvifile_t *fp) {
880-
assert(fp); if (fp->base) free(fp->base); fp->base = NULL; fp->p = fp->e = (unsigned char *)""; }
879+
static int bviclose(bvifile_t *fp) {
880+
assert(fp); if (fp->base) free(fp->base); fp->base = NULL; fp->p = fp->e = (unsigned char *)""; return 0; }
881881
static int bvigetch(bvifile_t *fp) {
882882
assert(fp && fp->p && fp->e); return (fp->p >= fp->e) ? EOF : (0xff & *(fp->p)++); }
883883
static int bviungetch(int c, bvifile_t *fp) {
@@ -926,7 +926,7 @@ static void oportflush(obj o) {
926926
}
927927
/* closed output ports */
928928
static void cofree(void *p) {}
929-
static void coclose(void *p) {}
929+
static int coclose(void *p) { return 0; }
930930
static int coputch(int c, void *p) { return EOF; }
931931
static int coflush(void *p) { return EOF; }
932932
static cxtype_oport_t cxt_oport_closed = {
@@ -65700,6 +65700,7 @@ case 2263: /* clo k */
6570065700
r += 1; /* shift reg. wnd */
6570165701
s_loop_v28786: /* k port */
6570265702
(void)(oportputcircular((cx__2311250), (cx__2Acurrent_2Doutput_2Dport_2A), 1));
65703+
(void)(oportflush((cx__2Acurrent_2Doutput_2Dport_2A)));
6570365704
hreserve(hbsz(1+1), 2); /* 2 live regs */
6570465705
*--hp = r[1];
6570565706
*--hp = obj_from_case(2263);

0 commit comments

Comments
 (0)