unistd: Ensure getcwd gets declared before being overridden.
authorBruno Haible <bruno@clisp.org>
Wed, 23 Dec 2009 09:59:14 +0000 (10:59 +0100)
committerBruno Haible <bruno@clisp.org>
Wed, 23 Dec 2009 09:59:14 +0000 (10:59 +0100)
ChangeLog
lib/unistd.in.h

index dc63d2886ffb3c6f3448f361372cdc257735047e..8ec7958c54fe8166993da38b5dbf955ac8d6d2b1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-12-23  Bruno Haible  <bruno@clisp.org>
+
+       unistd: Ensure getcwd gets declared before being overridden.
+       * lib/unistd.in.h: Conditionally include <io.h>.
+
 2009-12-22  Bruno Haible  <bruno@clisp.org>
 
        wchar: Diagnose broken combination of glibc and gcc versions and flags.
index f37c7baffe3e4df2d99dca65e2c18274240368d0..a3a49ed60e62ad9578f32ff4804960a5232cc9f9 100644 (file)
 
 /* mingw fails to declare _exit in <unistd.h>.  */
 /* mingw, BeOS, Haiku declare environ in <stdlib.h>, not in <unistd.h>.  */
+/* Solaris declares getcwd not only in <unistd.h> but also in <stdlib.h>.  */
 #include <stdlib.h>
 
+/* mingw declares getcwd in <io.h>, not in <unistd.h>.  */
+#if @GNULIB_GETCWD@ && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)
+# include <io.h>
+#endif
+
 #if ((@GNULIB_WRITE@ && @REPLACE_WRITE@ && @GNULIB_UNISTD_H_SIGPIPE@)   \
      || (@GNULIB_READLINK@ && (!@HAVE_READLINK@ || @REPLACE_READLINK@)) \
      || (@GNULIB_READLINKAT@ && !@HAVE_READLINKAT@))