From: Joel E. Denny Date: Wed, 7 Jun 2006 21:17:35 +0000 (+0000) Subject: * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng X-Git-Tag: v2.3b~373 X-Git-Url: https://git.saurik.com/bison.git/commitdiff_plain/9e6688995eda7d08bc189537cde8d2a856d76bda * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng and yytext if they're already #define'd. * src/flex-scanner.h, src/location.h: Move #include "system.h" to... * src/scan-code-c.c: ... here. * src/scan-code.l, src/scan-gram.l: ... and here. Also #include . --- diff --git a/ChangeLog b/ChangeLog index a90a8a27..3e6f1afa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2006-06-07 Joel E. Denny + + * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng + and yytext if they're already #define'd. + * src/flex-scanner.h, src/location.h: Move #include "system.h" to... + * src/scan-code-c.c: ... here. + * src/scan-code.l, src/scan-gram.l: ... and here. Also #include + . + 2006-06-07 Joel E. Denny Get Bison to build again when configured with --enable-gcc-warnings. diff --git a/src/flex-scanner.h b/src/flex-scanner.h index 1580bea8..07fd74dd 100644 --- a/src/flex-scanner.h +++ b/src/flex-scanner.h @@ -24,8 +24,6 @@ # error "FLEX_PREFIX not defined" #endif -#include "system.h" - /* Pacify "gcc -Wmissing-prototypes" when flex 2.5.31 is used. */ int FLEX_PREFIX (get_lineno) (void); FILE *FLEX_PREFIX (get_in) (void); @@ -44,9 +42,13 @@ int FLEX_PREFIX (lex_destroy) (void); /* It seems to be a nice "feature" of Flex that one cannot use yytext, yyleng etc. when a prefix is given, since there is no longer a #define, but rather the token is actually changed in the output. - */ -#define yyleng FLEX_PREFIX (leng) -#define yytext FLEX_PREFIX (text) + However, this is not true for Flex 2.5.4. */ +#ifndef yyleng +# define yyleng FLEX_PREFIX (leng) +#endif +#ifndef yytext +# define yytext FLEX_PREFIX (text) */ +#endif /* OBSTACK_FOR_STRING -- Used to store all the characters that we need to keep (to construct ID, STRINGS etc.). Use the following macros to diff --git a/src/location.h b/src/location.h index c3232050..542c6320 100644 --- a/src/location.h +++ b/src/location.h @@ -21,7 +21,6 @@ #ifndef LOCATION_H_ # define LOCATION_H_ -# include "system.h" # include "uniqstr.h" /* A boundary between two characters. */ diff --git a/src/scan-code-c.c b/src/scan-code-c.c index fd608569..4a018f85 100644 --- a/src/scan-code-c.c +++ b/src/scan-code-c.c @@ -1,2 +1,3 @@ #include +#include "system.h" #include "scan-code.c" diff --git a/src/scan-code.l b/src/scan-code.l index 2d128bfc..94a8eeb5 100644 --- a/src/scan-code.l +++ b/src/scan-code.l @@ -24,6 +24,9 @@ %option prefix="code_" outfile="lex.yy.c" %{ +#include +#include "system.h" + /* Work around a bug in flex 2.5.31. See Debian bug 333231 . */ #undef code_wrap diff --git a/src/scan-gram.l b/src/scan-gram.l index 36673c46..f2da5501 100644 --- a/src/scan-gram.l +++ b/src/scan-gram.l @@ -24,6 +24,9 @@ %option prefix="gram_" outfile="lex.yy.c" %{ +#include +#include "system.h" + /* Work around a bug in flex 2.5.31. See Debian bug 333231 . */ #undef gram_wrap