shithub: scc

Download patch

ref: c5eea59cb17fc33ed9857467c0f62560ee437a0e
parent: 9b4c6ff2e6afee8e2a97f96f21ab894c859e867e
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Sat May 9 15:45:42 EDT 2015

Add pragma directive to cc1

--- a/cc1/cpp.c
+++ b/cc1/cpp.c
@@ -49,6 +49,14 @@
 	error("#include expects \"FILENAME\" or <FILENAME>");
 }
 
+static char *
+pragma(char *s)
+{
+	while (*s)
+		++s;
+	return s;
+}
+
 char *
 preprocessor(char *p)
 {
@@ -56,10 +64,12 @@
 	unsigned short n;
 	static char **bp, *cmds[] = {
 		"include",
+		"pragma",
 		NULL
 	};
 	static char *(*funs[])(char *) = {
-		include
+		include,
+		pragma
 	};
 
 	while (isspace(*p))