Do not use '#endif/#else xxx'; it is not allowed for ANSI C
This commit is contained in:
@@ -68,8 +68,8 @@
|
||||
#ifndef ASLD
|
||||
#ifndef RELOCATION
|
||||
separate linker only possible if relocation info produced
|
||||
#endif RELOCATION
|
||||
#endif ASLD
|
||||
#endif /* RELOCATION */
|
||||
#endif /* ASLD */
|
||||
|
||||
#ifndef DEBUG
|
||||
#define DEBUG 1
|
||||
@@ -124,7 +124,7 @@ _include <signal.h>
|
||||
#else
|
||||
#define PASS_SYMB 1
|
||||
#define PASS_RELO 1
|
||||
#endif THREE_PASS
|
||||
#endif /* THREE_PASS */
|
||||
|
||||
#ifdef ASLD
|
||||
#define RELOMOVE(a,b) /* empty */
|
||||
|
||||
@@ -42,11 +42,11 @@ extern short dflag; /* -d option (list mode) */
|
||||
#ifdef ASLD
|
||||
#ifdef RELOCATION
|
||||
extern short rflag; /* -r option (relocation info) */
|
||||
#endif RELOCATION
|
||||
#endif /* RELOCATION */
|
||||
#else
|
||||
#define rflag 1
|
||||
extern valu_t relonami;
|
||||
#endif ASLD
|
||||
#endif /* ASLD */
|
||||
|
||||
#ifdef THREE_PASS
|
||||
extern short bflag; /* -b option (no optimizations) */
|
||||
|
||||
@@ -96,7 +96,7 @@ static item_t *last_it, *o_it;
|
||||
else if (listtemp) { listflag = listtemp; listeoln = 1; }
|
||||
#else
|
||||
#define LISTLINE(n) /* empty */
|
||||
#endif LISTING
|
||||
#endif /* LISTING */
|
||||
|
||||
#ifdef ASLD
|
||||
#define RELODONE /* empty */
|
||||
|
||||
@@ -93,8 +93,8 @@ char **argv;
|
||||
#ifdef RELOCATION
|
||||
#ifdef ASLD
|
||||
rflag = 1;
|
||||
#endif ASLD
|
||||
#endif RELOCATION
|
||||
#endif /* ASLD */
|
||||
#endif /* RELOCATION */
|
||||
break;
|
||||
case 'b':
|
||||
#ifdef THREE_PASS
|
||||
@@ -115,7 +115,7 @@ char **argv;
|
||||
#ifdef RELOCATION
|
||||
if (rflag)
|
||||
sflag |= SYM_SCT;
|
||||
#endif RELOCATION
|
||||
#endif /* RELOCATION */
|
||||
pass_1(argc, argv);
|
||||
#ifdef THREE_PASS
|
||||
pass_23(PASS_2);
|
||||
@@ -304,7 +304,7 @@ needed()
|
||||
#endif
|
||||
return(need);
|
||||
}
|
||||
#endif ASLD
|
||||
#endif /* ASLD */
|
||||
|
||||
parse(s)
|
||||
char *s;
|
||||
@@ -423,7 +423,7 @@ pass_23(n)
|
||||
machstart(n);
|
||||
#ifndef ASLD
|
||||
newmodule(modulename);
|
||||
#endif ASLD
|
||||
#endif /* ASLD */
|
||||
ffreopen(temppath, tempfile);
|
||||
yyparse();
|
||||
commfinish();
|
||||
@@ -534,12 +534,12 @@ commfinish()
|
||||
0,
|
||||
load(ip)
|
||||
);
|
||||
#else not ASLD
|
||||
#else /* not ASLD */
|
||||
#ifdef THREE_PASS
|
||||
if (pass == PASS_2) {
|
||||
cp->c_size -= sp->s_gain;
|
||||
}
|
||||
#endif THREE_PASS
|
||||
#endif /* THREE_PASS */
|
||||
}
|
||||
if (pass == PASS_1) cp->c_size = ip->i_valu;
|
||||
if (PASS_SYMB) {
|
||||
@@ -553,7 +553,7 @@ commfinish()
|
||||
cp->c_size
|
||||
);
|
||||
}
|
||||
#endif not ASLD
|
||||
#endif /* not ASLD */
|
||||
}
|
||||
if (PASS_SYMB == 0)
|
||||
return;
|
||||
@@ -578,7 +578,7 @@ commfinish()
|
||||
(valu_t)0
|
||||
);
|
||||
}
|
||||
#endif not ASLD
|
||||
#endif /* not ASLD */
|
||||
/*
|
||||
* produce symbol table entries for sections
|
||||
*/
|
||||
|
||||
@@ -26,7 +26,7 @@ register int typ;
|
||||
typ = S_VAR;
|
||||
else if (pass == PASS_2 && (ip->i_type & S_TYP) == S_UND)
|
||||
ip->i_type |= typ;
|
||||
#endif THREE_PASS
|
||||
#endif /* THREE_PASS */
|
||||
if (typ == S_UND)
|
||||
serror("illegal equate");
|
||||
if (pass == PASS_3)
|
||||
@@ -40,7 +40,7 @@ register item_t *ip;
|
||||
register flag;
|
||||
#ifdef GENLAB
|
||||
static char genlab[] = GENLAB;
|
||||
#endif GENLAB
|
||||
#endif /* GENLAB */
|
||||
|
||||
if (pass == PASS_1) {
|
||||
/* printf("declare %s: %o\n", ip->i_name, typ); */
|
||||
@@ -59,12 +59,12 @@ register item_t *ip;
|
||||
flag = SYM_LOC;
|
||||
#else
|
||||
flag = SYM_EXT|SYM_LOC; /* S_EXT not stable in PASS_1 */
|
||||
#endif THREE_PASS
|
||||
#endif /* THREE_PASS */
|
||||
#ifdef GENLAB
|
||||
if (!(flag & SYM_EXT) &&
|
||||
strncmp(ip->i_name, genlab, sizeof(genlab)-1) == 0)
|
||||
flag = SYM_LAB;
|
||||
#endif GENLAB
|
||||
#endif /* GENLAB */
|
||||
if (sflag & flag)
|
||||
newsymb(
|
||||
ip->i_name,
|
||||
|
||||
@@ -167,7 +167,7 @@ listline(textline)
|
||||
listcolm = 0;
|
||||
listflag = listtemp;
|
||||
}
|
||||
#endif LISTING
|
||||
#endif /* LISTING */
|
||||
|
||||
/* ---------- code optimization ---------- */
|
||||
|
||||
|
||||
@@ -247,14 +247,14 @@ if (Debug)
|
||||
#ifdef MAXSPLIT
|
||||
sret = split(tp,&tokexp[i],ply,toplevel);
|
||||
if (sret==0) {
|
||||
#endif MAXSPLIT
|
||||
#endif /* MAXSPLIT */
|
||||
totalcost += stackupto(tp,ply,toplevel);
|
||||
CHKCOST();
|
||||
break;
|
||||
#ifdef MAXSPLIT
|
||||
}
|
||||
i += sret;
|
||||
#endif MAXSPLIT
|
||||
#endif /* MAXSPLIT */
|
||||
} else
|
||||
i += 1;
|
||||
tp--;
|
||||
|
||||
@@ -41,7 +41,7 @@ extern int pathash[256]; /* Indices into previous */
|
||||
extern c1_t c1coercs[]; /* coercions type 1 */
|
||||
#ifdef MAXSPLIT
|
||||
extern c2_t c2coercs[]; /* coercions type 2 */
|
||||
#endif MAXSPLIT
|
||||
#endif /* MAXSPLIT */
|
||||
extern c3_t c3coercs[]; /* coercions type 3 */
|
||||
extern struct reginfo **reglist[]; /* lists of registers per property */
|
||||
|
||||
|
||||
@@ -548,7 +548,7 @@ bss(n,t,b) full n; {
|
||||
if (b==0
|
||||
#ifdef BSS_INIT
|
||||
|| (t==sp_cstx && argval==BSS_INIT)
|
||||
#endif BSS_INIT
|
||||
#endif /* BSS_INIT */
|
||||
) {
|
||||
switchseg(SEGBSS);
|
||||
newlbss(labstr,n);
|
||||
|
||||
@@ -163,7 +163,7 @@ chkregs() {
|
||||
for(j=0;j<nregvar[i];j++)
|
||||
inctcount(rvnumbers[i][j]);
|
||||
}
|
||||
#endif REGVARS
|
||||
#endif /* REGVARS */
|
||||
for (rp=machregs;rp<machregs+NREGS;rp++) {
|
||||
assert(rp->r_refcount==rp->r_tcount);
|
||||
rp->r_tcount=0;
|
||||
|
||||
@@ -135,6 +135,6 @@ unlinkregs() {
|
||||
}
|
||||
}
|
||||
|
||||
#endif REGVARS
|
||||
#endif /* REGVARS */
|
||||
|
||||
/* nothing after this */
|
||||
|
||||
@@ -332,7 +332,7 @@ instsize(tinstno,tp) token_p tp; {
|
||||
return(tokens[inp->in_info[0]].t_size);
|
||||
}
|
||||
}
|
||||
#endif MAXSPLIT
|
||||
#endif /* MAXSPLIT */
|
||||
|
||||
tref(tp,amount) register token_p tp; {
|
||||
register i;
|
||||
@@ -389,7 +389,7 @@ found:
|
||||
fakestack[stackheight++] = savestack[i];
|
||||
return(cp->c2_nsplit);
|
||||
}
|
||||
#endif MAXSPLIT
|
||||
#endif /* MAXSPLIT */
|
||||
|
||||
unsigned docoerc(tp,cp,ply,toplevel,forced) token_p tp; c3_p cp; {
|
||||
token_t savestack[MAXSAVE];
|
||||
|
||||
@@ -27,4 +27,4 @@ typedef char * string;
|
||||
#define word long
|
||||
#ifndef WRD_FMT
|
||||
#define WRD_FMT "%ld"
|
||||
#endif WRD_FMT
|
||||
#endif /* WRD_FMT */
|
||||
|
||||
@@ -138,7 +138,7 @@ EXTEND *e1,*e2;
|
||||
*lp <<= count;
|
||||
}
|
||||
}
|
||||
#else USE_DIVIDE
|
||||
#else /* USE_DIVIDE */
|
||||
|
||||
u[4] = (e1->m2 & 1) << 15;
|
||||
b64_rsft(&(e1->m1));
|
||||
|
||||
@@ -295,14 +295,14 @@ if (Debug)
|
||||
#ifdef MAXSPLIT
|
||||
sret = split(tp,&tokexp[i],ply,toplevel);
|
||||
if (sret==0) {
|
||||
#endif MAXSPLIT
|
||||
#endif /* MAXSPLIT */
|
||||
totalcost += stackupto(tp,ply,toplevel);
|
||||
CHKCOST();
|
||||
break;
|
||||
#ifdef MAXSPLIT
|
||||
}
|
||||
i += sret;
|
||||
#endif MAXSPLIT
|
||||
#endif /* MAXSPLIT */
|
||||
} else
|
||||
i += 1;
|
||||
tp--;
|
||||
|
||||
@@ -42,7 +42,7 @@ extern int pathash[256]; /* Indices into previous */
|
||||
extern c1_t c1coercs[]; /* coercions type 1 */
|
||||
#ifdef MAXSPLIT
|
||||
extern c2_t c2coercs[]; /* coercions type 2 */
|
||||
#endif MAXSPLIT
|
||||
#endif /* MAXSPLIT */
|
||||
extern c3_t c3coercs[]; /* coercions type 3 */
|
||||
extern struct reginfo **reglist[]; /* lists of registers per property */
|
||||
|
||||
|
||||
@@ -588,7 +588,7 @@ bss(n,t,b) full n; {
|
||||
if (b==0
|
||||
#ifdef BSS_INIT
|
||||
|| (t==sp_cstx && argval==BSS_INIT)
|
||||
#endif BSS_INIT
|
||||
#endif /* BSS_INIT */
|
||||
) {
|
||||
switchseg(SEGBSS);
|
||||
newlbss(labstr,n);
|
||||
|
||||
@@ -205,7 +205,7 @@ chkregs() {
|
||||
for(j=0;j<nregvar[i];j++)
|
||||
inctcount(rvnumbers[i][j]);
|
||||
}
|
||||
#endif REGVARS
|
||||
#endif /* REGVARS */
|
||||
for (rp=machregs+1;rp<machregs+NREGS;rp++) {
|
||||
assert(rp->r_refcount==rp->r_tcount);
|
||||
rp->r_tcount=0;
|
||||
|
||||
@@ -145,6 +145,6 @@ unlinkregs() {
|
||||
}
|
||||
}
|
||||
|
||||
#endif REGVARS
|
||||
#endif /* REGVARS */
|
||||
|
||||
/* nothing after this */
|
||||
|
||||
@@ -415,7 +415,7 @@ instsize(tinstno,tp) token_p tp; {
|
||||
return(tokens[inp->in_info[0]].t_size);
|
||||
}
|
||||
}
|
||||
#endif MAXSPLIT
|
||||
#endif /* MAXSPLIT */
|
||||
|
||||
tref(tp,amount) register token_p tp; {
|
||||
register i;
|
||||
@@ -530,7 +530,7 @@ found:
|
||||
rest_stack();
|
||||
return(cp->c2_nsplit);
|
||||
}
|
||||
#endif MAXSPLIT
|
||||
#endif /* MAXSPLIT */
|
||||
|
||||
unsigned docoerc(tp,cp,ply,toplevel,forced) token_p tp; register c3_p cp; {
|
||||
unsigned cost;
|
||||
|
||||
@@ -27,4 +27,4 @@ typedef char * string;
|
||||
#define word long
|
||||
#ifndef WRD_FMT
|
||||
#define WRD_FMT "%ld"
|
||||
#endif WRD_FMT
|
||||
#endif /* WRD_FMT */
|
||||
|
||||
Reference in New Issue
Block a user