shithub: scc

Download patch

ref: 45d979a0af4019cce0298bd6cb26a54273ef4169
parent: 335eb0c1602243c85248fe1ba52666913ee0b357
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Mon Feb 6 09:21:03 EST 2017

[cc1] Fix code.c in linux

Stdout isn't a constant in linux, but it is in NetBSD.
The best option is to put a icode() function in the same
way that we have ilex() and icpp().

--- a/cc1/code.c
+++ b/cc1/code.c
@@ -137,7 +137,13 @@
 	[OTYP] = emittype,
 };
 
-static FILE *outfp = stdout;
+static FILE *outfp;
+
+void
+icode(void)
+{
+	outfp = stdout;
+}
 
 void
 freetree(Node *np)
--- a/cc1/main.c
+++ b/cc1/main.c
@@ -57,6 +57,7 @@
 	atexit(clean);
 	ilex();
 	icpp();
+	icode();
 
 	ARGBEGIN {
 	case 'D':