diff options
Diffstat (limited to 'development/ieee-pilot/gencode.diff')
-rw-r--r-- | development/ieee-pilot/gencode.diff | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/development/ieee-pilot/gencode.diff b/development/ieee-pilot/gencode.diff new file mode 100644 index 0000000000000..0f99436789639 --- /dev/null +++ b/development/ieee-pilot/gencode.diff @@ -0,0 +1,38 @@ +diff --git a/gencode.c b/gencode.c +index 0909641..4d4ec8b 100644 +--- a/gencode.c ++++ b/gencode.c +@@ -529,8 +529,11 @@ void solhook(char *s) { + vp->v.label.addr <= ftell(yyin) && + vp->v.label.addr >= + ftell(yyin) - (int)strlen(s)) { +- (void)fprintf(yyout, "plt_%s:\n", +- vp->name); ++ static char *last_emitted; ++ if(last_emitted != vp->name) { ++ (void)fprintf(yyout, "plt_%s:\n", vp->name); ++ last_emitted = vp->name; ++ } + } + } + +@@ -1227,6 +1230,10 @@ int execfile(char *t) { + (void)fprintf(yyout, "/* %s -- generated C code for %s */\n", + outfile, source); + (void)fputs("#include <stdio.h>\n", yyout); ++ (void)fputs("#include <string.h>\n", yyout); ++ (void)fputs("#include <unistd.h>\n", yyout); ++ (void)fputs("#include <stdlib.h>\n", yyout); ++ (void)fputs("extern char *gets(char *s);\n", yyout); + (void)fputs("#include \"pilot.h\"\n", yyout); + + /* generate declarations for all non-system variables */ +@@ -1256,7 +1263,7 @@ int execfile(char *t) { + (void)fputs(PASS2, stderr); + } + +- (void)fputs("\nmain()\n{\n do_scrinit();\n", yyout); ++ (void)fputs("\nint main(int argc, char **argv)\n{\n do_scrinit();\n", yyout); + indent = 1; + } + |