Fix for building lex scanners on Windows when scanner is generated by flex 2.5.35...
authorabv <abv@opencascade.com>
Wed, 9 Apr 2014 10:26:37 +0000 (14:26 +0400)
committerbugmaster <bugmaster@opencascade.com>
Wed, 9 Apr 2014 11:07:37 +0000 (15:07 +0400)
src/ExprIntrp/ExprIntrp.lex
src/StepFile/step.lex

index 5374288..1685364 100644 (file)
@@ -49,6 +49,9 @@ int yywrap()
 #include <stdlib.h>
 #include <io.h>
 
+// 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
index f6571e1..ada8492 100644 (file)
@@ -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