From a2073a897a3b11f89ab6c7e6ccad143a11f2e9d8 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Wed, 21 Sep 2011 23:19:44 +0200 Subject: [PATCH] opendir: Avoid compilation error on mingw. * lib/opendir.c: Include always. Include as well. * modules/opendir (Depends-on): Add unistd. --- ChangeLog | 6 ++++++ lib/opendir.c | 6 +++++- modules/opendir | 1 + 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index f215c1718..db0bd7a9f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2011-09-21 Bruno Haible + opendir: Avoid compilation error on mingw. + * lib/opendir.c: Include always. Include as well. + * modules/opendir (Depends-on): Add unistd. + +2011-09-21 Bruno Haible + ftruncate tests: Avoid a test failure on mingw. * tests/test-ftruncate.c (main): Allow a failure with EACCES. diff --git a/lib/opendir.c b/lib/opendir.c index 06c611f2e..20ae75e10 100644 --- a/lib/opendir.c +++ b/lib/opendir.c @@ -20,6 +20,7 @@ #include #include +#include #if HAVE_OPENDIR @@ -28,7 +29,6 @@ #else -# include # include # include "dirent-private.h" @@ -36,6 +36,10 @@ #endif +#if REPLACE_FCHDIR +# include +#endif + DIR * opendir (const char *dir_name) { diff --git a/modules/opendir b/modules/opendir index ede6d48a3..adb2242b5 100644 --- a/modules/opendir +++ b/modules/opendir @@ -10,6 +10,7 @@ Depends-on: dirent largefile filename [test $HAVE_OPENDIR = 0 || test $REPLACE_OPENDIR = 1] +unistd [test $HAVE_OPENDIR = 0 || test $REPLACE_OPENDIR = 1] configure.ac: gl_FUNC_OPENDIR -- 2.11.0