Mingw 64 added <direct.h> as a place that declared getcwd. It is
a non-standard header, but since we already include it in the
replacement for <sys/stat.h>, we must also include it in the
replacement for <unistd.h> to avoid compilation problems.
* lib/unistd.in.h (includes) [mingw]: Include <direct.h> for
getcwd.
Reported by Marc-André Lureau.
Signed-off-by: Eric Blake <eblake@redhat.com>
2011-08-17 Eric Blake <eblake@redhat.com>
+ getcwd: fix compilation on mingw64
+ * lib/unistd.in.h (includes) [mingw]: Include <direct.h> for
+ getcwd.
+ Reported by Marc-André Lureau.
+
pipe2: silence compiler warning
* lib/pipe2.c (pipe2): Hide label if it is not used.
/* mingw declares getcwd in <io.h>, not in <unistd.h>. */
#if ((@GNULIB_GETCWD@ || defined GNULIB_POSIXCHECK) \
&& ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__))
-# include <io.h>
+# include <io.h> /* mingw32, mingw64 */
+# include <direct.h> /* mingw64 */
#endif
/* AIX and OSF/1 5.1 declare getdomainname in <netdb.h>, not in <unistd.h>.