From 8d8458032da8555e5dc562cf93336d9cebf5d482 Mon Sep 17 00:00:00 2001 From: cuz Date: Fri, 26 Jul 2002 19:27:55 +0000 Subject: [PATCH] Fixed a bug git-svn-id: svn://svn.cc65.org/cc65/trunk@1371 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- src/cc65/expr.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/cc65/expr.c b/src/cc65/expr.c index dfebf8adc..cf4499dac 100644 --- a/src/cc65/expr.c +++ b/src/cc65/expr.c @@ -855,6 +855,14 @@ static int primary (ExprDesc* lval) return k; } + /* If we run into an identifier in preprocessing mode, we assume that this + * is an undefined macro and replace it by a constant value of zero. + */ + if (Preprocessing && CurTok.Tok == TOK_IDENT) { + MakeConstIntExpr (lval, 0); + return 0; + } + /* All others may only be used if the expression evaluation is not called * recursively by the preprocessor. */ -- 2.39.5