Subject: bug#14495: unistd.h problem in t/lex-header.sh

From: Stefano Lattarini <[email-masked]>
Date: Wed, 29 May 2013 11:06:55 +0200

On 05/29/2013 10:39 AM, Peter Rosin wrote:
> On 2013-05-29 02:08, Peter Rosin wrote:
>> Hi!
>>
>> When t/lex-header.sh tries to compile main.c on the master branch, it fails
>> like this snippet below, since MSVC does not have unistd.h. I suppose main.c
>> should add
>>
>> 	#define YY_NO_UNISTD_H 1
>>
>> before it includes mylex.h? Or is this something else? I know very little
>> about lexers...
> 
> The problem is the same on the micro branch (87e49f4f040c8ab).
> 
We had already solved a similar issue one, in the very Automake test suite.
Let me see if I can find the reference ...  Oh wait, no need to, we have
registered the learned lesson in t/README already:

* When writing input for lex, include the following in the definitions
  section:

    %{
    #define YY_NO_UNISTD_H 1
    %}

  to accommodate non-ANSI systems, since GNU flex generates code that
  includes unistd.h otherwise.

And peeking in the Git history, I see you already fixed a similar
problem about an year ago, in commit v1.11-2058-g6f4b08d.

Can you try a fix on those lines?

Thanks,
  Stefano