From f58f9b92cb67b4f1e20d49d0faa48fb515334b64 Mon Sep 17 00:00:00 2001 From: abv Date: Wed, 9 Apr 2014 14:26:37 +0400 Subject: [PATCH] Fix for building lex scanners on Windows when scanner is generated by flex 2.5.35 on Linux --- src/ExprIntrp/ExprIntrp.lex | 3 +++ src/StepFile/step.lex | 8 +++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/ExprIntrp/ExprIntrp.lex b/src/ExprIntrp/ExprIntrp.lex index 53742889fe..1685364e46 100644 --- a/src/ExprIntrp/ExprIntrp.lex +++ b/src/ExprIntrp/ExprIntrp.lex @@ -49,6 +49,9 @@ int yywrap() #include #include +// Avoid includion of unistd.h if parser is generated on Linux (flex 2.5.35) +#define YY_NO_UNISTD_H + // disable MSVC warnings in flex 2.89 code #pragma warning(disable:4131 4244 4273 4127) #endif diff --git a/src/StepFile/step.lex b/src/StepFile/step.lex index f6571e1295..ada8492b97 100644 --- a/src/StepFile/step.lex +++ b/src/StepFile/step.lex @@ -40,9 +40,15 @@ void rec_typarg(int argtype); void resultat () /* Resultat alloue dynamiquement, "jete" une fois lu */ { if (modcom == 0) rec_restext(yytext,yyleng); } -// disable MSVC warnings in flex code +// MSVC specifics #ifdef _MSC_VER + +// disable MSVC warnings in flex code #pragma warning(disable:4131 4244 4273 4267 4127) + +// Avoid includion of unistd.h if parser is generated on Linux (flex 2.5.35) +#define YY_NO_UNISTD_H + #endif // disable GCC warnings in flex code