]> Savannah Git Hosting - gnulib.git/commitdiff
glob: Choose 'dirent_type' in a way that works better on mingw.
authorBruno Haible <bruno@clisp.org>
Sat, 12 May 2018 15:12:33 +0000 (17:12 +0200)
committerBruno Haible <bruno@clisp.org>
Sat, 12 May 2018 15:12:33 +0000 (17:12 +0200)
Reported and suggested by Eli Zaretskii <eliz@gnu.org>.

* lib/glob.c (dirent_type): Define as uint_fast32_t.

ChangeLog
lib/glob.c

index 1e77eb085966115ad038137d8a503fbce7e61e7c..88630dd23a2fc1f0b2480bf4d01c3fca4940d82d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2018-05-12  Bruno Haible  <bruno@clisp.org>
+
+       glob: Choose 'dirent_type' in a way that works better on mingw.
+       Reported and suggested by Eli Zaretskii <eliz@gnu.org>.
+       * lib/glob.c (dirent_type): Define as uint_fast32_t.
+
 2018-05-12  Bruno Haible  <bruno@clisp.org>
 
        execute, spawn-pipe: Avoid warning about redefining 'close'.
index 61930e7149e7913948da6109c207e67907e1609d..c4ba99459b846884f7f53503e803d6286d4e5ec2 100644 (file)
@@ -78,7 +78,9 @@
 \f
 static const char *next_brace_sub (const char *begin, int flags) __THROWNL;
 
-typedef uint_fast8_t dirent_type;
+/* The type of ((struct dirent *) 0)->d_type is 'unsigned char' on most
+   platforms, but 'unsigned int' in the mingw from mingw.org.  */
+typedef uint_fast32_t dirent_type;
 
 #if !defined _LIBC && !defined HAVE_STRUCT_DIRENT_D_TYPE
 /* Any distinct values will do here.