bug fix: #if defined(...) did not work properly

This commit is contained in:
ceriel 1990-01-15 17:01:36 +00:00
parent 018558cb9e
commit b5135607b4

View file

@ -76,31 +76,38 @@ replace(idef)
} }
if (mac->mc_flag & FUNC) { if (mac->mc_flag & FUNC) {
struct idf *param; struct idf *param;
extern struct idf *GetIdentifier(); char *nam;
extern char *GetIdentifier();
extern struct idf *str2idf();
UnknownIdIsZero = 0; UnknownIdIsZero = 0;
param = GetIdentifier(); nam = GetIdentifier();
if (nam) {
param = findidf(nam);
}
else param = 0;
UnknownIdIsZero = 1; UnknownIdIsZero = 1;
if (c == '(') { if (c == '(') {
LoadChar(c); LoadChar(c);
c = skipspaces(c, 0); c = skipspaces(c, 0);
if (c != ')') error(") missing"); if (c != ')') error(") missing");
} }
if (! param) { if (! nam) {
error("identifier missing"); error("identifier missing");
} }
repl = new_mlist(); repl = new_mlist();
if (param && param->id_macro) if (param && param->id_macro)
reptext = "1"; reptext = "1 ";
else else
reptext = "0"; reptext = "0 ";
InsertText(reptext, 1); InsertText(reptext, 2);
InputLevel++; InputLevel++;
repl->m_level = InputLevel; repl->m_level = InputLevel;
repl->next = ReplList; repl->next = ReplList;
ReplList = repl; ReplList = repl;
repl->m_mac = mac; repl->m_mac = mac;
if (nam) free(nam);
return 1; return 1;
} }
actpars = getactuals(idef); /* get act.param. list */ actpars = getactuals(idef); /* get act.param. list */