scc

simple C compiler
git clone git://git.2f30.org/scc
Log | Files | Refs | README | LICENSE

commit eb30e9795a8b09179fac633a02d866428b7adb78
parent dd90c975dcfd14bc186b498f92c69df2b7b04121
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Mon,  6 Feb 2017 14:21:03 +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().

Diffstat:
Mcc1/code.c | 8+++++++-
Mcc1/main.c | 1+
2 files changed, 8 insertions(+), 1 deletion(-)

diff --git 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 @@ -57,6 +57,7 @@ main(int argc, char *argv[]) atexit(clean); ilex(); icpp(); + icode(); ARGBEGIN { case 'D':