make-w32
[Top][All Lists]
Advanced

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

Re: w32 unistd.h


From: Alessandro Vesely
Subject: Re: w32 unistd.h
Date: Fri, 29 Apr 2005 11:11:08 +0200

Eli Zaretskii wrote:
> [...]
> Right now, we are talking about getting Make to compile without
> compiler errors and with minimum (ideally, zero) amount of warnings.
> I suggested to craft a w32/include/unistd.h as a means to that end.
> This is because Make's sources test for HAVE_UNISTD_H and if that
> header is not available, they provide prototypes for the functions
> declared on unistd.h.  However, the prototypes provided are okay for
> Posix platforms, not for Windows.  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


> 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.

The declarations there, as in the example above, are not prototypes.
Thus the compiler should issue a warning only if the program calls
those functions without having a prototype from some other include.
(Of course, one cannot declare them __stdcall when there is __cdecl
in the prototype.) Anyway, avoiding those unneeded declarations makes
for a cleaner compile.

> What I cannot figure out is whether you agree or disagree with this
> suggestion, and if the latter, what are your reasons for the
> disagreement.

Sorry, I though you meant something else... yes, that would be an
entirely different project.




reply via email to

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