Let us try this again, leave the never-interactive option for the lexers.

Set never-interactive option in lexers so that Flex doesn't use isatty() function from unistd.
Define YY_NO_UNISTD_H when no unistd.h is detected.
Remove attempt to fix isatty error on Windows introduced in  2f780609.
cherry picked from commit c046bb88e5
master
Buginator 2011-03-17 19:52:33 -04:00
parent ab118527f0
commit 31502ccdce
9 changed files with 8 additions and 9 deletions

View File

@ -123,10 +123,7 @@ extern UDWORD HashStringIgnoreCase( const char *String );
struct timezone;
extern int gettimeofday(struct timeval* tv, struct timezone* tz);
extern "C" int isatty(int); // Apparently flex declares isatty with C++ linkage on Windows. Don't ask why. Declaring here instead.
#endif
extern "C" int isatty(int); // Apparently flex declares isatty with C++ linkage on Windows. Don't ask why. Declaring here instead.
static inline WZ_DECL_CONST const char * bool2string(bool var)
{

View File

@ -80,7 +80,7 @@ extern void res_set_debug(int bdebug);
%}
%option yylineno noyywrap nounput
%option yylineno noyywrap nounput never-interactive
%option prefix="res_"
%x COMMENT

View File

@ -84,7 +84,7 @@ extern void strres_set_debug(int bdebug);
%}
%option yylineno noyywrap nounput
%option yylineno noyywrap nounput never-interactive
%option prefix="strres_"
%x COMMENT

View File

@ -84,7 +84,7 @@ extern void audp_set_extra(YY_EXTRA_TYPE user_defined);
%}
%option yylineno noyywrap nounput
%option yylineno noyywrap nounput never-interactive
%option prefix="audp_"
%x COMMENT

View File

@ -80,6 +80,7 @@ static SDWORD playerIndex;
%option prefix="chat_"
%option nounput
%option case-insensitive
%option never-interactive
%%

View File

@ -458,6 +458,7 @@ static void pushInclude(const char *pIncludePath)
%option prefix="scr_"
%option nounput
%option yylineno
%option never-interactive
%x COMMENT
%x SLCOMMENT

View File

@ -87,7 +87,7 @@ extern void lev_set_extra(YY_EXTRA_TYPE user_defined);
%}
%option yylineno noyywrap nounput
%option yylineno noyywrap nounput never-interactive
%option prefix="lev_"
%x COMMENT

View File

@ -79,7 +79,7 @@ extern void message_set_debug(int bdebug);
%}
%option yylineno noyywrap nounput
%option yylineno noyywrap nounput never-interactive
%option prefix="message_"
%x COMMENT

View File

@ -92,7 +92,7 @@ extern void scrv_set_extra(YY_EXTRA_TYPE user_defined);
%}
%option yylineno noyywrap nounput
%option yylineno noyywrap nounput never-interactive
%option warn nodefault
%option prefix="scrv_"