> From: l...@gnu.org (Ludovic Courtès) > Cc: m...@netris.org, guile-user@gnu.org > Date: Sun, 16 Jun 2013 21:50:40 +0200 > > > Please find the changes to do this below. I removed most of the > > HAVE_POSIX ifdef's, as they are no longer needed. > > Sorry I had overlooked this one. It looks nice!
Thanks. > We would need the copyright to be assigned to the FSF before it can be > committed. How does that sound? If you’re willing to do so, I can send > you the paperwork off-line. Please do. > > --- libguile/filesys.c~0 2013-04-09 09:52:31.000000000 +0300 > > +++ libguile/filesys.c 2013-06-12 13:41:31.244477700 +0300 > > @@ -112,7 +112,12 @@ > > > > /* Some more definitions for the native Windows port. */ > > #ifdef __MINGW32__ > > -# define fsync(fd) _commit (fd) > > +# define fsync(fd) _commit (fd) > > +# define WIN32_LEAN_AND_MEAN > > What does that mean? :-) It prevents the compiler from fetching too much from the windows.h header, thus minimizing the possibility of conflicts with other headers and macros. > > +# include <windows.h> > > +/* FIXME: Should use 'link' module from gnulib. */ > > +# define link(f1,f2) CreateHardLink(f2, f1, NULL) > > +# define HAVE_LINK 1 > > Let’s do it then, and remove that part of the patch. Right. > > -#ifdef HAVE_POSIX > > - > > Note that HAVE_POSIX really means --enable-posix. Since this patch > keeps that option, it should probably keep the #ifdefs. That would be a > topic for a separate patch. What is the purpose of --enable-posix? I thought it could be removed, once you accepted the changes to the sources. > > +#ifdef HAVE_FORK > > pid = fork (); > > +#elif defined(__MINGW32__) > > + { > > + int save_stdin = -1, save_stdout = -1; > > + int errno_save; > > + > > + if (reading) > > [...] > > Could this MinGW-specific code be moved to a separate function? Yes. But there are still non-FORK parts of the patch elsewhere in this function that are needed. > I think the patch also needs something like this: > > --- a/configure.ac > +++ b/configure.ac > @@ -760,7 +760,7 @@ AC_CHECK_FUNCS([DINFINITY DQNAN cexp chsize clog clog10 > ctermid \ > sched_setaffinity sendfile]) > > AM_CONDITIONAL([BUILD_ICE_9_POPEN], > - [test "x$enable_posix" = "xyes" && test "x$ac_cv_func_fork" = "xyes"]) > + [test "x$enable_posix" = "xyes"]) Right you are.