X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/bedf57f515d42455aa4cca5209dcbcaaa071eaab..1c02d4bfbf0e9f1cf7a0a972a7ce98b68590aed2:/data/yacc.c diff --git a/data/yacc.c b/data/yacc.c index 577a60f5..945d0960 100644 --- a/data/yacc.c +++ b/data/yacc.c @@ -262,6 +262,9 @@ b4_syncline([@oline@], [@ofile@])[ # ifndef YYSTACK_ALLOC_MAXIMUM # define YYSTACK_ALLOC_MAXIMUM ((YYSIZE_T) -1) # endif +# ifdef __cplusplus +extern "C" { +# endif # ifndef YYMALLOC # define YYMALLOC malloc # if (! defined (malloc) && ! defined (YYINCLUDED_STDLIB_H) \ @@ -276,6 +279,9 @@ void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ void free (void *); /* INFRINGES ON USER NAME SPACE */ # endif # endif +# ifdef __cplusplus +} +# endif # endif #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */ @@ -853,18 +859,19 @@ b4_c_function_def([yyparse], [int], b4_parse_param) #endif ]]) m4_ifdef([b4_initial_action], [ -m4_pushdef([b4_at_dollar], [yylloc])dnl -m4_pushdef([b4_dollar_dollar], [yylval])dnl +m4_pushdef([b4_at_dollar], [m4_define([b4_at_dollar_used])yylloc])dnl +m4_pushdef([b4_dollar_dollar], [m4_define([b4_dollar_dollar_used])yylval])dnl /* User initialization code. */ b4_initial_action m4_popdef([b4_dollar_dollar])dnl m4_popdef([b4_at_dollar])dnl /* Line __line__ of yacc.c. */ -b4_syncline([@oline@], [@ofile@])])dnl -[ - yyvsp[0] = yylval; -]b4_location_if([[ yylsp[0] = yylloc; -]]) +b4_syncline([@oline@], [@ofile@]) +])dnl +m4_ifdef([b4_dollar_dollar_used],[[ yyvsp[0] = yylval; +]])dnl +m4_ifdef([b4_at_dollar_used], [[ yylsp[0] = yylloc; +]])dnl [ goto yysetstate; /*------------------------------------------------------------. @@ -1157,7 +1164,7 @@ yyerrlab: } yyf = _(yyformat); - yysize1 = yysize + strlen (yyf); + yysize1 = yysize + yystrlen (yyf); yysize_overflow |= yysize1 < yysize; yysize = yysize1;