Eric Blake <[EMAIL PROTECTED]> writes: > +#if ! HAVE_DECL_MKDIR > +# if HAVE_IO_H > +# include <io.h> > +# endif > +# define mkdir ((int (*)()) _mkdir) > +#endif
Surely this won't work if ! HAVE_DECL_MKDIR && ! HAVE_IO_H, since _mkdir will be undefined in that case. Also, older Unix systems lack a mkdir declaration, but have mkdir (it may not fit the prototype, though, so you shouldn't declare it without checking). Also the "#define" gives me the heebie-jeebies, since it relies on undefined behavior (passing the wrong number of arguments to a C function). How about something like this instead? #if ! HAVE_DECL_MKDIR && HAVE_IO_H # include <io.h> static int mkdir (char const *name, mode_t mode) { return _mkdir (name); } #endif Other than that, it looks good to me; thanks.