Symbols called 'eof' conflict with Windows io.h.

This commit is contained in:
David Given 2022-07-16 19:40:11 +02:00
parent 496424acf6
commit f30bf70832
2 changed files with 7 additions and 7 deletions

View file

@ -45,7 +45,7 @@ extern const char* modulename;
extern int paramsize; extern int paramsize;
extern struct hshtab hshtab[HSHSIZ]; extern struct hshtab hshtab[HSHSIZ];
extern int hshused; extern int hshused;
extern int eof; extern int ateof;
extern int peekc; extern int peekc;
extern const char* ctab; extern const char* ctab;
extern struct hshtab *bsym; extern struct hshtab *bsym;

View file

@ -22,7 +22,7 @@ int string_part;
int paramsize; int paramsize;
struct hshtab hshtab[HSHSIZ]; struct hshtab hshtab[HSHSIZ];
int hshused; int hshused;
int eof; int ateof;
int peekc; int peekc;
const char* ctab; const char* ctab;
struct hshtab *bsym; struct hshtab *bsym;
@ -129,7 +129,7 @@ main(int argc, char *argv[])
string_part = 0; string_part = 0;
code_part = C_getid(); code_part = C_getid();
C_beginpart(code_part); C_beginpart(code_part);
while (!eof) { while (!ateof) {
extdef(); extdef();
blkend(); blkend();
} }
@ -368,12 +368,12 @@ symbol(void)
c = peekc; c = peekc;
peekc = 0; peekc = 0;
} else } else
if (eof) if (ateof)
return EOFC; return EOFC;
else else
c = getchar(); c = getchar();
if (c==EOF) { if (c==EOF) {
eof++; ateof++;
return(EOFC); return(EOFC);
} }
@ -453,7 +453,7 @@ loop:
} }
} }
} }
eof++; ateof++;
error("Nonterminated comment"); error("Nonterminated comment");
return EOFC; return EOFC;
@ -820,7 +820,7 @@ stmt:
if ((o = symbol()) == LBRACE) { if ((o = symbol()) == LBRACE) {
if (d) if (d)
blkhed(); blkhed();
while (!eof) { while (!ateof) {
if ((o = symbol()) == RBRACE) if ((o = symbol()) == RBRACE)
goto bend; goto bend;
pushsym(o); pushsym(o);