aboutsummaryrefslogtreecommitdiff
path: root/sys/cmd/cc/cc.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/cmd/cc/cc.c')
-rw-r--r--sys/cmd/cc/cc.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/cmd/cc/cc.c b/sys/cmd/cc/cc.c
index cb37af4..fcb9217 100644
--- a/sys/cmd/cc/cc.c
+++ b/sys/cmd/cc/cc.c
@@ -253,6 +253,12 @@ init(void)
C.lxr = (Lexer){ 0 };
C.lxr.b = C.lxr.buf;
+
+ /* predefine macros */
+ dodefine(&C.lxr, "__LINE__");
+ dodefine(&C.lxr, "__FILE__");
+ C.lxr.macline = (uintptr)lookup(&C.lxr.sym, "__LINE__");
+ C.lxr.macfile = (uintptr)lookup(&C.lxr.sym, "__FILE__");
}
error