Hi Eric,

> I concur with the idea of this patch

OK, committed.

> but wonder if we need to tighten  
> up lib/unistd.in.h to only include <stdio.h> on Cygwin, so as to avoid 
> difficult analysis of whether the circular inclusions between our 
> replacement <stdio.h> and <unistd.h> would negatively affect Solaris 10.

Good point. Yes, too many #includes like this can lead to parse errors
in particular situations (even when all gnulib self-tests compile), and
it's a pain to analyze this kind of failure. I'm applying this:


2010-10-26  Bruno Haible  <[email protected]>

        unistd: Refine workaround from 2009-12-23 against Cygwin bug.
        * lib/unistd.in.h: Don't include <stdio.h> and <fcntl.h>, except on
        Cygwin and mingw.
        Suggested by Eric Blake.

--- lib/unistd.in.h.orig        Wed Oct 27 02:59:10 2010
+++ lib/unistd.in.h     Wed Oct 27 02:57:11 2010
@@ -61,14 +61,16 @@
 /* Cygwin 1.7.1 declares symlinkat in <stdio.h>, not in <unistd.h>.  */
 /* But avoid namespace pollution on glibc systems.  */
 #if (!(defined SEEK_CUR && defined SEEK_END && defined SEEK_SET) \
-     || (@GNULIB_SYMLINKAT@ || defined GNULIB_POSIXCHECK)) \
+     || ((@GNULIB_SYMLINKAT@ || defined GNULIB_POSIXCHECK) \
+         && defined __CYGWIN__)) \
     && ! defined __GLIBC__
 # include <stdio.h>
 #endif
 
 /* Cygwin 1.7.1 declares unlinkat in <fcntl.h>, not in <unistd.h>.  */
 /* But avoid namespace pollution on glibc systems.  */
-#if (@GNULIB_UNLINKAT@ || defined GNULIB_POSIXCHECK) && ! defined __GLIBC__
+#if (@GNULIB_UNLINKAT@ || defined GNULIB_POSIXCHECK) && defined __CYGWIN__ \
+    && ! defined __GLIBC__
 # include <fcntl.h>
 #endif
 

Reply via email to