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 d02876d..457ef20 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 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.
        * lib/stdio.in.h: Include <unistd.h> on Solaris.
        * lib/renameat.c: Don't include <unistd.h> here.
index 2221b5d..ea74d63 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