commit eb30e9795a8b09179fac633a02d866428b7adb78
Author:     Roberto E. Vargas Caballero <[email protected]>
AuthorDate: Mon Feb 6 14:21:03 2017 +0100
Commit:     Roberto E. Vargas Caballero <[email protected]>
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
@@ -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
@@ -57,6 +57,7 @@ main(int argc, char *argv[])
        atexit(clean);
        ilex();
        icpp();
+       icode();
 
        ARGBEGIN {
        case 'D':

Reply via email to