From 5fb07775a1458defbd958fd4d1b59a49a49a57bf Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Fri, 26 Oct 2012 10:31:55 +0200 Subject: [PATCH] yacc.c: do not define location support when not using locations * data/yacc.c (YYLLOC_DEFAULT, YYRHSLOC): Don't define when not using locations. --- data/yacc.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/data/yacc.c b/data/yacc.c index faf1d786..1b3dc752 100644 --- a/data/yacc.c +++ b/data/yacc.c @@ -769,10 +769,9 @@ while (YYID (0)) #define YYTERROR 1 #define YYERRCODE 256 +]b4_locations_if([[ ]b4_yylloc_default_define[ #define YYRHSLOC(Rhs, K) ((Rhs)[K]) -]b4_locations_if([[ - /* YY_LOCATION_PRINT -- Print the location on the stream. This macro was not mandated originally: define only if we know @@ -787,18 +786,14 @@ while (YYID (0)) # else # define YY_LOCATION_PRINT(File, Loc) ((void) 0) # endif -#endif]], [[ - - -/* This macro is provided for backward compatibility. */ - +#endif]], +[[/* This macro is provided for backward compatibility. */ #ifndef YY_LOCATION_PRINT # define YY_LOCATION_PRINT(File, Loc) ((void) 0) #endif]])[ /* YYLEX -- calling `yylex' with the right arguments. */ - #ifdef YYLEX_PARAM # define YYLEX yylex (]b4_pure_if([&yylval[]b4_locations_if([, &yylloc]), ])[YYLEX_PARAM) #else -- 2.50.0