From 681f4961d0edc066be458a092b48cd4b529337ba Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sat, 12 May 2018 17:12:33 +0200 Subject: [PATCH] glob: Choose 'dirent_type' in a way that works better on mingw. Reported and suggested by Eli Zaretskii . * lib/glob.c (dirent_type): Define as uint_fast32_t. --- ChangeLog | 6 ++++++ lib/glob.c | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 1e77eb0859..88630dd23a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2018-05-12 Bruno Haible + + glob: Choose 'dirent_type' in a way that works better on mingw. + Reported and suggested by Eli Zaretskii . + * lib/glob.c (dirent_type): Define as uint_fast32_t. + 2018-05-12 Bruno Haible execute, spawn-pipe: Avoid warning about redefining 'close'. diff --git a/lib/glob.c b/lib/glob.c index 61930e7149..c4ba99459b 100644 --- a/lib/glob.c +++ b/lib/glob.c @@ -78,7 +78,9 @@ 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. -- 2.39.5