# HG changeset patch # User Bruno Haible # Date 1316639984 -7200 # Node ID 802b8002c3f2d9cb6a4c0301f4d088d83547f189 # Parent 06f18298ffd84e543a86c797f7bef9bfc2bb9ce5 opendir: Avoid compilation error on mingw. * lib/opendir.c: Include always. Include as well. * modules/opendir (Depends-on): Add unistd. diff --git a/ChangeLog b/ChangeLog --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +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. diff --git a/lib/opendir.c b/lib/opendir.c --- 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 --- a/modules/opendir +++ b/modules/opendir @@ -10,6 +10,7 @@ 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