diff options
| author | Quentin Carbonneaux | 2015-03-09 12:15:43 -0400 |
|---|---|---|
| committer | Quentin Carbonneaux | 2015-03-09 12:15:43 -0400 |
| commit | 170e1f9248884b855e1c278f978a6a35b0faf84e (patch) | |
| tree | 63b30e4cbb879a7b1023d594a9e2307e6ff7af18 | |
| parent | baffac8b22758f2ea150eedfc10ad28f73e99c26 (diff) | |
add default definition of YYSTYPE in .tab.h
| -rw-r--r-- | myacc.c | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -692,9 +692,12 @@ tblout() } aout("yytrns", o, m); if (fhdr) { - fprintf(fhdr, "int yyparse(void);\n"); - fprintf(fhdr, "extern YYSTYPE yylval;\n"); - fprintf(fhdr, "#endif\n"); + fputs("int yyparse(void);\n", fhdr); + fputs("#ifndef YYSTYPE\n", fhdr); + fputs("#define YYSTYPE int\n", fhdr); + fputs("#endif\n", fhdr); + fputs("extern YYSTYPE yylval;\n", fhdr); + fputs("#endif\n", fhdr); } free(o); } |
