shithub: scc

Download patch

ref: 9df23af867a4a59f14bc0d2903bf4dfc686bfa9a
parent: 2d6aaa2a9cb928a69bdef0ed307fe8ea85389b72
author: Quentin Rameau <quinq@fifth.space>
date: Tue Jun 28 15:05:29 EDT 2016

[cpp] define keywords before defining macros

--- a/cc1/cpp.c
+++ b/cc1/cpp.c
@@ -81,6 +81,8 @@
 		{NULL, 0, 0}
 	};
 
+	keywords(keys, NS_CPPCLAUSES);
+
 	t = time(NULL);
 	tm = localtime(&t);
 	strftime(sdate, sizeof(sdate), "-1#\"%b %d %Y\"", tm);
@@ -87,7 +89,6 @@
 	strftime(stime, sizeof(stime), "-1#\"%H:%M:%S\"", tm);
 	defmacro("__DATE__")->u.s = sdate;
 	defmacro("__TIME__")->u.s = stime;
-
 	defmacro("__STDC_VERSION__")->u.s = "-1#199409L";
 	symline = defmacro("__LINE__");
 	symfile = defmacro("__FILE__");
@@ -94,7 +95,6 @@
 
 	for (bp = list; *bp; ++bp)
 		defmacro(*bp)->u.s = "-1#1";
-	keywords(keys, NS_CPPCLAUSES);
 }
 
 static void