[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Problem compiling glob.c with MinGW
From: |
Bruno Haible |
Subject: |
Re: Problem compiling glob.c with MinGW |
Date: |
Sat, 12 May 2018 17:13:21 +0200 |
User-agent: |
KMail/5.1.3 (Linux/4.4.0-119-generic; KDE/5.18.0; x86_64; ; ) |
Eli Zaretskii wrote:
> Would it be okay to use 'unsigned' instead of 'uint8_t' on all
> platforms?
Yes, this is a good idea. Done:
2018-05-12 Bruno Haible <address@hidden>
glob: Choose 'dirent_type' in a way that works better on mingw.
Reported and suggested by Eli Zaretskii <address@hidden>.
* lib/glob.c (dirent_type): Define as uint_fast32_t.
diff --git a/lib/glob.c b/lib/glob.c
index 61930e7..c4ba994 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.