bug-gnu-utils
[Top][All Lists]
Advanced

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

Re: [Mingw-users] Re: More patch 2.5.9 hacking


From: Manu
Subject: Re: [Mingw-users] Re: More patch 2.5.9 hacking
Date: Sun, 26 Oct 2003 00:09:43 +0200

Paul Eggert wrote:


> "Eli Zaretskii" <address@hidden> writes:
> 
> > This seems to indicate that some header where you have a prototype of
> > mkdir (which on your system takes 1 argument) was seen by the
> > compiler _after_ config.h, and thus it was processed as the prototype
> > of fixed_mkdir.
> 
> Yes; the header is <unistd.h>, which apparently includes <io.h>.
> 
> Perhaps we can work around the problem on mingw by defining our own
> unistd.h, which looks like this:
> 
> #include "/path/to/mingw's/unistd.h"
> #define mkdir(d, m) ((mkdir) (d))
> 
> That way, we wouldn't have to modify the existing source code or .m4
> files at all.

If MinGW developers accept the following changes to MinGW's unistd.h,
it would definitely fix that problem, in a very clean way:

<unistd.h>
/*
 * This file is part of the Mingw32 package.
 *
 * unistd.h maps (roughly) to io.h
 */

#ifndef __STRICT_ANSI__
#include <io.h>
#include <process.h>

#ifndef mkdir
# define mkdir(name, mode) ((mkdir) (name))
#endif

#endif

</unistd.h>

Since unistd.h is not a standard header under Windows,
adding a bit more of Unix inside shouldn't bring the chaos,
it would fix a very common and so boring problem, then
porters will concentrate their efforts on something more
_consistent_.

Manu.






reply via email to

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