Skip to content

Commit 04f5b24

Browse files
committed
Windows fix for lexer (#646)
Option "never-interactive" prevents flex from emitting calls to isatty, which is not always present on Windows. This is fine because we never use the lexer in interactive mode anyway.
1 parent 83c5bbe commit 04f5b24

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

src/liboslcomp/osllex.l

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4141
%option noyywrap
4242
%option nounput noinput
4343

44+
/* never-interactive fixes a Windows compatibility problem where the
45+
* lexer emits isatty calls that don't exist.
46+
*/
47+
%option never-interactive
48+
4449
/* Option 'prefix' creates a C++ lexer with the given prefix, so that
4550
* we can link with other flex-generated lexers in the same application
4651
* without name conflicts.

src/liboslexec/osolex.l

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4242
%option noyywrap
4343
%option nounput noinput
4444

45+
/* never-interactive fixes a Windows compatibility problem where the
46+
* lexer emits isatty calls that don't exist.
47+
*/
48+
%option never-interactive
49+
4550
/* Option 'prefix' creates a C++ lexer with the given prefix, so that
4651
* we can link with other flex-generated lexers in the same application
4752
* without name conflicts.

0 commit comments

Comments
 (0)