make-w32
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: w32 unistd.h


From: Eli Zaretskii
Subject: Re: w32 unistd.h
Date: Fri, 29 Apr 2005 12:55:21 +0300

> Date: Fri, 29 Apr 2005 11:11:08 +0200
> From: Alessandro Vesely <address@hidden>
> CC: address@hidden
> 
> > Instead of adding more ugly conditionals,
> 
> E.g., to clarify, avoid replacing
> 
>    #ifndef HAVE_UNISTD_H
>    extern int chdir ();
>    #endif
> 
> with
> 
>    #if !defined(HAVE_UNISTD_H) && !defined(WINDOWS32)
>    extern int chdir ();
>    #endif

Yes, precisely.

> > I think it will be much cleaner to provide a minimal
> > w32-specific unistd.h, which will simply copy the prototypes of the
> > functions used by Make from Windows system header files.  Then we
> > could define HAVE_UNISTD_H on Windows and be done with that.
> 
> Agreed.
> 
> IMHO an empty unistd.h should do. In facts, the functions declared
> are either not used or declared in some other winows header. It may
> be enough to `touch win32/include/unistd.h' in the win32 config.

Someone will have to try this empty unistd.h trick and report any
remaining problems.  Could Jerker or someone else with MSC installed
please create an empty w32/include/unistd.h, add a definition of
HAVE_UNISTD_H to config.h.W32, and try building Make?

> The declarations there, as in the example above, are not prototypes.

That's because they are for platforms that don't support prototypes,
so only the return type is declared.

> Thus the compiler should issue a warning only if the program calls
> those functions without having a prototype from some other include.

That could be so, but without checking each declaration, we cannot be
sure.  I suggested above to try compiling with nothing in unistd.h; an
alternative would be to search, for each of these functions, for its
prototype in Microsoft headers and then verify that these headers are
included in the source files which use those functions.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]