]> Savannah Git Hosting - gnulib.git/commitdiff
opendir: Avoid compilation error on mingw.
authorBruno Haible <bruno@clisp.org>
Wed, 21 Sep 2011 21:19:44 +0000 (23:19 +0200)
committerBruno Haible <bruno@clisp.org>
Wed, 21 Sep 2011 21:19:44 +0000 (23:19 +0200)
* lib/opendir.c: Include <stddef.h> always. Include <unistd.h> as well.
* modules/opendir (Depends-on): Add unistd.

ChangeLog
lib/opendir.c
modules/opendir

index f215c171859914f499226de8783531cf55b9c3b4..db0bd7a9f065824406193604ac045c5b8c97cd44 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2011-09-21  Bruno Haible  <bruno@clisp.org>
+
+       opendir: Avoid compilation error on mingw.
+       * lib/opendir.c: Include <stddef.h> always. Include <unistd.h> as well.
+       * modules/opendir (Depends-on): Add unistd.
+
 2011-09-21  Bruno Haible  <bruno@clisp.org>
 
        ftruncate tests: Avoid a test failure on mingw.
index 06c611f2e16a5843b3458c502607d97ab83bafa4..20ae75e109e7e6e79539779148b6aa12edf21d95 100644 (file)
@@ -20,6 +20,7 @@
 #include <dirent.h>
 
 #include <errno.h>
+#include <stddef.h>
 
 #if HAVE_OPENDIR
 
@@ -28,7 +29,6 @@
 
 #else
 
-# include <stddef.h>
 # include <stdlib.h>
 
 # include "dirent-private.h"
 
 #endif
 
+#if REPLACE_FCHDIR
+# include <unistd.h>
+#endif
+
 DIR *
 opendir (const char *dir_name)
 {
index ede6d48a3d08ef5a134d76e730b85fd9da7033a8..adb2242b52cde07d2cad8f466cd63fa0f3fd9b03 100644 (file)
@@ -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