Allow compiling with Flex < 2.5.9, r5679 and patch #1089 broke this

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5692 4a71c877-e1ca-e34f-864e-861f7616d084
master
Giel van Schijndel 2008-07-28 13:34:00 +00:00
parent 7f768ba83e
commit 231866a510
2 changed files with 2 additions and 43 deletions

View File

@ -39,27 +39,7 @@
#define YYLMAX 255
#endif
/* Older GNU Flex versions don't define yyget_extra(), yyset_extra(),
* yyget_text() and yyget_lineno().
* (and neither define a subminor version)
*/
#if !defined(YY_FLEX_SUBMINOR_VERSION) || (YY_FLEX_SUBMINOR_VERSION < 9)
# define yyget_extra chat_get_extra
# define yyset_extra chat_set_extra
# define yyget_lineno chat_get_lineno
# define yyget_text chat_get_text
extern int yyget_lineno(void);
int yyget_lineno()
{
return yylineno;
}
extern char* yyget_text(void);
char* yyget_text()
{
return yytext;
}
#elif defined(YY_FLEX_SUBMINOR_VERSION) && YY_FLEX_SUBMINOR_VERSION == 33
#if defined(YY_FLEX_SUBMINOR_VERSION) && YY_FLEX_SUBMINOR_VERSION == 33
extern int chat_get_lineno(void);
extern FILE *chat_get_in(void);
extern FILE *chat_get_out(void);

View File

@ -37,28 +37,7 @@
#define YYLMAX 255
#endif
/* Older GNU Flex versions don't define yyget_extra(), yyset_extra(),
* yyget_text() and yyget_lineno().
* (and neither define a subminor version)
*/
#if !defined(YY_FLEX_SUBMINOR_VERSION) || (YY_FLEX_SUBMINOR_VERSION < 9)
# define yyget_extra scr_get_extra
# define yyset_extra scr_set_extra
# define yyget_lineno scr_get_lineno
# define yyget_text scr_get_text
extern void yyset_extra(YY_EXTRA_TYPE user_defined);
extern int yyget_lineno(void);
int yyget_lineno()
{
return yylineno;
}
extern char* yyget_text(void);
char* yyget_text()
{
return yytext;
}
#elif defined(YY_FLEX_SUBMINOR_VERSION) && YY_FLEX_SUBMINOR_VERSION == 33
#if defined(YY_FLEX_SUBMINOR_VERSION) && YY_FLEX_SUBMINOR_VERSION == 33
extern int scr_get_lineno(void);
extern FILE *scr_get_in(void);
extern FILE *scr_get_out(void);