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: Earnie Boyd
Subject: Re: [Mingw-users] Re: More patch 2.5.9 hacking
Date: Sat, 25 Oct 2003 17:27:08 -0400
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.2.1) Gecko/20021130

Manu wrote:
Eli Zaretskii wrote:
[...]

I didn't mean to patch the library, I meant to write a substitute for
it.  For example, you write a function called fixed_mkdir that does
the right thing with the second argument, then say

 #define mkdir fixed_mkdir

in some header included by all the sources except the one that
defines fixed_mkdir's code.


I'm missing something or this doesn't work:

I experimentally added "#define mkdir fixed_mkdir" in config.h.
Then:
util.c: In function `makedirs':
util.c:885: too many arguments to function `fixed_mkdir'
make: *** [util.o] Error 1

If I change it to:
"#define mkdir(name, mode) ((fixed_mkdir) (name, mode))",
Then:
gcc -c  -DHAVE_CONFIG_H -Ded_PROGRAM=\"ed\" -I. -I. -g -O2 addext.c
In file included from C:/DEV/MSYS/1.0/mingw/include/unistd.h:9,
                 from addext.c:49:
C:/DEV/MSYS/1.0/mingw/include/io.h:145:39: macro "mkdir" requires 2 arguments, 
but only 1 given
make: *** [addext.o] Error 1

Same problem if I move it to common.h.


You've defined mkdir before you included the io.h header. You could try setting _NO_OLDNAMES to avoid it, but that would most likely cause you other unwanted results. Your best bet is to create the mkdir definition after you've included unistd.h.

Earnie
--
http://www.mingw.org
Powered by SourceForge <http://sourceforge.net/projects/mingw>





reply via email to

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