mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2025-01-01 00:18:15 +01:00
Make the yacc skeleton aware of C++. It was previously broken in the
YYDEBUG case (getenv() declared wrong).
This commit is contained in:
parent
55e50ace1e
commit
ec9b6b00a2
@ -120,13 +120,24 @@ char *body[] =
|
|||||||
"#define YYREJECT goto yyabort",
|
"#define YYREJECT goto yyabort",
|
||||||
"#define YYACCEPT goto yyaccept",
|
"#define YYACCEPT goto yyaccept",
|
||||||
"#define YYERROR goto yyerrlab",
|
"#define YYERROR goto yyerrlab",
|
||||||
|
"/* cfront 1.2 defines \"c_plusplus\" instead of \"__cplusplus\" */",
|
||||||
|
"#ifdef c_plusplus",
|
||||||
|
"#ifndef __cplusplus",
|
||||||
|
"#define __cplusplus",
|
||||||
|
"#endif",
|
||||||
|
"#endif",
|
||||||
|
"#ifdef __cplusplus",
|
||||||
|
"extern \"C\" { char *getenv(const char *); }",
|
||||||
|
"#else",
|
||||||
|
"extern char *getenv();",
|
||||||
|
"#endif",
|
||||||
|
"",
|
||||||
"int",
|
"int",
|
||||||
"yyparse()",
|
"yyparse()",
|
||||||
"{",
|
"{",
|
||||||
" register int yym, yyn, yystate;",
|
" register int yym, yyn, yystate;",
|
||||||
"#if YYDEBUG",
|
"#if YYDEBUG",
|
||||||
" register char *yys;",
|
" register char *yys;",
|
||||||
" extern char *getenv();",
|
|
||||||
"",
|
"",
|
||||||
" if (yys = getenv(\"YYDEBUG\"))",
|
" if (yys = getenv(\"YYDEBUG\"))",
|
||||||
" {",
|
" {",
|
||||||
|
Loading…
Reference in New Issue
Block a user