# HG changeset patch # User Bruno Haible # Date 1261562354 -3600 # Node ID 3607500d45237eeefeca500a54d15fa0ee22a9db # Parent 0c2e471e00e6d3e7614cea87d9e7e9830d1eb9f8 unistd: Ensure getcwd gets declared before being overridden. diff --git a/ChangeLog b/ChangeLog --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-12-23 Bruno Haible + + unistd: Ensure getcwd gets declared before being overridden. + * lib/unistd.in.h: Conditionally include . + 2009-12-22 Bruno Haible wchar: Diagnose broken combination of glibc and gcc versions and flags. diff --git a/lib/unistd.in.h b/lib/unistd.in.h --- a/lib/unistd.in.h +++ b/lib/unistd.in.h @@ -39,8 +39,14 @@ /* mingw fails to declare _exit in . */ /* mingw, BeOS, Haiku declare environ in , not in . */ +/* Solaris declares getcwd not only in but also in . */ #include +/* mingw declares getcwd in , not in . */ +#if @GNULIB_GETCWD@ && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) +# include +#endif + #if ((@GNULIB_WRITE@ && @REPLACE_WRITE@ && @GNULIB_UNISTD_H_SIGPIPE@) \ || (@GNULIB_READLINK@ && (!@HAVE_READLINK@ || @REPLACE_READLINK@)) \ || (@GNULIB_READLINKAT@ && !@HAVE_READLINKAT@))