From 93a74d422446cef722964845b328f884ad804979 Mon Sep 17 00:00:00 2001 From: Costa Vitor Date: Mon, 1 Jun 2009 20:05:04 -0500 Subject: [PATCH] SWI-Stream should define S__checkpasteeof #102 --- include/SWI-Stream.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/SWI-Stream.h b/include/SWI-Stream.h index d8ae028f3..ca3f5c04e 100644 --- a/include/SWI-Stream.h +++ b/include/SWI-Stream.h @@ -224,9 +224,12 @@ PL_EXPORT_DATA(IOSTREAM) S__iob[3]; /* Libs standard streams */ #define Sgetchar() Sgetc(Sinput) #define Sputchar(c) Sputc((c), Soutput) +#define S__checkpasteeof(s,c) \ + if ( (c)==-1 && (s)->flags & (SIO_FEOF|SIO_FERR) ) \ + ((s)->flags |= SIO_FEOF2) #define S__updatefilepos_getc(s, c) \ ((s)->position ? S__fupdatefilepos_getc((s), (c)) \ - : (c)) + : S__fcheckpasteeof((s), (c))) #define Snpgetc(s) ((s)->bufp < (s)->limitp ? (int)(*(s)->bufp++)&0xff \ : S__fillbuf(s))