From ae3ee69e4d6ffc742843c089be115179086c73f0 Mon Sep 17 00:00:00 2001 From: joerg Date: Tue, 3 Sep 1996 08:00:26 +0000 Subject: [PATCH] Make the yacc skeleton aware of C++. It was previously broken in the YYDEBUG case (getenv() declared wrong). --- usr.bin/yacc/skeleton.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/usr.bin/yacc/skeleton.c b/usr.bin/yacc/skeleton.c index fba6508f01eb..06af6fcb890f 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\"))", " {",