diff options
Diffstat (limited to 'sys/cmd/cc/pp.c')
-rw-r--r-- | sys/cmd/cc/pp.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/cmd/cc/pp.c b/sys/cmd/cc/pp.c index 30bb3d4..8de4792 100644 --- a/sys/cmd/cc/pp.c +++ b/sys/cmd/cc/pp.c @@ -62,7 +62,7 @@ defmacro(Lexer *lx, string name, string macro) { Sym *mac; - printf("DEFINING MACRO %s, ON LINE %d\n", name, lx->pos.line); + printf("DEFINING MACRO %s = %s, ON LINE %d\n", name, macro+1, lx->pos.line); mac = define(&lx->sym, name, Smacro); mac->macro = macro; @@ -108,12 +108,14 @@ opand(Lexer *lx) case Alit: switch (tok.kind & ~Vmask) { - case Vint: + case Vint: case Vlong: case Vvlong: return tok.val.i; + case Vint | Vun: case Vlong | Vun: case Vvlong | Vun: + return tok.val.ui; case Vchar: return tok.val.c; default: - errorat(lx->pos, "invalid literal of type '%d' in conditional macro", tok.kind & ~Vmask); + errorat(lx->pos, "invalid literal of type '%s' in conditional macro", tokens[tok.kind & ~Vmask]); return 0; } |