[hackers] [scc] [cc1] Fix code.c in linux || Roberto E. Vargas Caballero

From: <git_AT_suckless.org>
Date: Mon, 6 Feb 2017 16:47:18 +0100 (CET)

commit eb30e9795a8b09179fac633a02d866428b7adb78
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
AuthorDate: Mon Feb 6 14:21:03 2017 +0100
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
CommitDate: Mon Feb 6 14:21:03 2017 +0100

    [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().

diff --git a/cc1/code.c b/cc1/code.c
index 8f9b0fc..ceea7bd 100644
--- a/cc1/code.c
+++ b/cc1/code.c
_AT_@ -137,7 +137,13 @@ void (*opcode[])(unsigned, void *) = {
         [OTYP] = emittype,
 };
 
-static FILE *outfp = stdout;
+static FILE *outfp;
+
+void
+icode(void)
+{
+ outfp = stdout;
+}
 
 void
 freetree(Node *np)
diff --git a/cc1/main.c b/cc1/main.c
index 02cd4b9..6304901 100644
--- a/cc1/main.c
+++ b/cc1/main.c
_AT_@ -57,6 +57,7 @@ main(int argc, char *argv[])
         atexit(clean);
         ilex();
         icpp();
+ icode();
 
         ARGBEGIN {
         case 'D':
Received on Mon Feb 06 2017 - 16:47:18 CET

This archive was generated by hypermail 2.3.0 : Mon Feb 06 2017 - 16:48:19 CET