summaryrefslogtreecommitdiffstats
path: root/usr.bin/yacc
diff options
context:
space:
mode:
authorjoerg <joerg@FreeBSD.org>1996-09-03 08:00:26 +0000
committerjoerg <joerg@FreeBSD.org>1996-09-03 08:00:26 +0000
commitae3ee69e4d6ffc742843c089be115179086c73f0 (patch)
tree16b122a284f786c2e6582b04fcc3a8873a3d1e9e /usr.bin/yacc
parent2b8eb49135acef777909d3179be9eee1bb7916d7 (diff)
downloadFreeBSD-src-ae3ee69e4d6ffc742843c089be115179086c73f0.zip
FreeBSD-src-ae3ee69e4d6ffc742843c089be115179086c73f0.tar.gz
Make the yacc skeleton aware of C++. It was previously broken in the
YYDEBUG case (getenv() declared wrong).
Diffstat (limited to 'usr.bin/yacc')
-rw-r--r--usr.bin/yacc/skeleton.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/usr.bin/yacc/skeleton.c b/usr.bin/yacc/skeleton.c
index fba6508..06af6fc 100644
--- a/usr.bin/yacc/skeleton.c
+++ b/usr.bin/yacc/skeleton.c
@@ -120,13 +120,24 @@ char *body[] =
"#define YYREJECT goto yyabort",
"#define YYACCEPT goto yyaccept",
"#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",
"yyparse()",
"{",
" register int yym, yyn, yystate;",
"#if YYDEBUG",
" register char *yys;",
- " extern char *getenv();",
"",
" if (yys = getenv(\"YYDEBUG\"))",
" {",
OpenPOWER on IntegriCloud