unistd: Refine workaround from 2009-12-23 against Cygwin bug.
authorBruno Haible <bruno@clisp.org>
Wed, 27 Oct 2010 00:59:47 +0000 (02:59 +0200)
committerBruno Haible <bruno@clisp.org>
Wed, 27 Oct 2010 00:59:47 +0000 (02:59 +0200)
* lib/unistd.in.h: Don't include <stdio.h> and <fcntl.h>, except on
Cygwin and mingw.
Suggested by Eric Blake.

ChangeLog
lib/unistd.in.h

index d02876da13a3dd3a4396bd37a63781d80a6e4ddb..457ef20dbf181a268c082230e90abe26c0afed15 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2010-10-26  Bruno Haible  <bruno@clisp.org>
+
+       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.
+
 2010-10-26  Bruno Haible  <bruno@clisp.org>
 
        stdio: Work around compilation error due to renameat() on Solaris 10.
index 2221b5d8aecd82d565a59048d8ff9bdcce012335..ea74d63110febb2e39a17e70068ad76fde84cd99 100644 (file)
 /* 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