Allow (warning-less) compilation with Flex 2.5.33

Patch #1089 by Bertrand Coconnier <bcoconni>

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5679 4a71c877-e1ca-e34f-864e-861f7616d084
master
Giel van Schijndel 2008-07-27 13:34:58 +00:00
parent 04f5392dd2
commit 5f496b5b33
7 changed files with 125 additions and 0 deletions

View File

@ -62,6 +62,16 @@ char* yyget_text()
}
#elif defined(YY_FLEX_SUBMINOR_VERSION) && YY_FLEX_SUBMINOR_VERSION == 33
extern YY_EXTRA_TYPE yyget_extra(void);
extern int res_get_lineno(void);
extern FILE *res_get_in(void);
extern FILE *res_get_out(void);
extern int res_get_leng(void);
extern char *res_get_text(void);
extern void res_set_lineno(int line_number);
extern void res_set_in(FILE* in_str);
extern void res_set_out(FILE* out_str);
extern int res_get_debug(void);
extern void res_set_debug(int bdebug);
#endif
%}

View File

@ -66,6 +66,16 @@ char* yyget_text()
}
#elif defined(YY_FLEX_SUBMINOR_VERSION) && YY_FLEX_SUBMINOR_VERSION == 33
extern YY_EXTRA_TYPE yyget_extra(void);
extern int strres_get_lineno(void);
extern FILE *strres_get_in(void);
extern FILE *strres_get_out(void);
extern int strres_get_leng(void);
extern char *strres_get_text(void);
extern void strres_set_lineno(int line_number);
extern void strres_set_in(FILE* in_str);
extern void strres_set_out(FILE* out_str);
extern int strres_get_debug(void);
extern void strres_set_debug(int bdebug);
#endif
%}

View File

@ -64,6 +64,18 @@ char* yyget_text()
}
#elif defined(YY_FLEX_SUBMINOR_VERSION) && YY_FLEX_SUBMINOR_VERSION == 33
extern YY_EXTRA_TYPE yyget_extra(void);
extern int audp_get_lineno(void);
extern FILE *audp_get_in(void);
extern FILE *audp_get_out(void);
extern int audp_get_leng(void);
extern char *audp_get_text(void);
extern void audp_set_lineno(int line_number);
extern void audp_set_in(FILE* in_str);
extern void audp_set_out(FILE* out_str);
extern int audp_get_debug(void);
extern void audp_set_debug(int bdebug);
extern int audp_lex_destroy(void);
extern void audp_set_extra(YY_EXTRA_TYPE user_defined);
#endif
%}

View File

@ -39,6 +39,40 @@
#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
extern int chat_get_lineno(void);
extern FILE *chat_get_in(void);
extern FILE *chat_get_out(void);
extern int chat_get_leng(void);
extern char *chat_get_text(void);
extern void chat_set_lineno(int line_number);
extern void chat_set_in(FILE* in_str);
extern void chat_set_out(FILE* out_str);
extern int chat_get_debug(void);
extern void chat_set_debug(int bdebug);
extern int chat_lex_destroy(void);
#endif
/* Pointer to the input buffer */
static const char *pInputBuffer = NULL;
static const char *pEndBuffer = NULL;

View File

@ -37,6 +37,41 @@
#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
extern int scr_get_lineno(void);
extern FILE *scr_get_in(void);
extern FILE *scr_get_out(void);
extern int scr_get_leng(void);
extern char *scr_get_text(void);
extern void scr_set_lineno(int line_number);
extern void scr_set_in(FILE* in_str);
extern void scr_set_out(FILE* out_str);
extern int scr_get_debug(void);
extern void scr_set_debug(int bdebug);
extern int scr_lex_destroy(void);
#endif
/* Store for any string values */
static char aText[TEXT_BUFFERS][YYLMAX];
static UDWORD currText=0;

View File

@ -66,6 +66,18 @@ char* yyget_text()
}
#elif defined(YY_FLEX_SUBMINOR_VERSION) && YY_FLEX_SUBMINOR_VERSION == 33
extern YY_EXTRA_TYPE yyget_extra(void);
extern int lev_get_lineno(void);
extern FILE *lev_get_in(void);
extern FILE *lev_get_out(void);
extern int lev_get_leng(void);
extern char *lev_get_text(void);
extern void lev_set_lineno(int line_number);
extern void lev_set_in(FILE* in_str);
extern void lev_set_out(FILE* out_str);
extern int lev_get_debug(void);
extern void lev_set_debug(int bdebug);
extern int lev_lex_destroy(void);
extern void lev_set_extra(YY_EXTRA_TYPE user_defined);
#endif
%}

View File

@ -76,6 +76,18 @@ char* yyget_text()
}
#elif defined(YY_FLEX_SUBMINOR_VERSION) && YY_FLEX_SUBMINOR_VERSION == 33
extern YY_EXTRA_TYPE yyget_extra(void);
extern int scrv_get_lineno(void);
extern FILE *scrv_get_in(void);
extern FILE *scrv_get_out(void);
extern int scrv_get_leng(void);
extern char *scrv_get_text(void);
extern void scrv_set_lineno(int line_number);
extern void scrv_set_in(FILE* in_str);
extern void scrv_set_out(FILE* out_str);
extern int scrv_get_debug(void);
extern void scrv_set_debug(int bdebug);
extern int scrv_lex_destroy(void);
extern void scrv_set_extra(YY_EXTRA_TYPE user_defined);
#endif
%}