Include only needed headers in programs/winhelp

Francois Gouget fgouget at
Sun Dec 2 17:13:46 CST 2001

On Sun, 2 Dec 2001, James Juran wrote:
> <unistd.h> is only included in lex.yy.c, which is generated by flex from
> macro.lex.l.  Flex includes <unistd.h> to get the definition of
> isatty().  The original compilation error was in compiling lex.yy.c,
> which includes unistd.h and macro.h.  macro.h included windows.h, which
> included winsock.h, which created the conflict on the gethostname()
> prototype.

   I sent another mail on the same subject just before discovering this
one. You can ignore it.

> So it seems the real conflict is in using flex in Winelib applications
> that (directly or indirectly) include windows.h on systems with glibc >=
> 2.2.3.  Since I would think that flex wouldn't be used to port a real
> Windows application to Wine, I would think this isn't a significant
> problem.

   Isn't flex available on Windows? Or maybe it's not exactly flex
just a look alike lexer. I guess even if flex exists on Windows then it
does not call isatty.

> Unless someone knows a way to keep flex from including unistd.h, I think
> this patch is still necessary.

   It seems like we should have a better solution. Maybe something like
what we do for select.

Francois Gouget         fgouget at
    I haven't lost my mind, it's backed up on tape around here somewhere...

More information about the wine-devel mailing list