common,w32: Fix struct stat on Windows.

* common/sysutils.c [HAVE_W32_SYSTEM] (gnupg_stat): Select
appropriate structure.

--

GnuPG-bug-id: 5897
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
NIIBE Yutaka 2022-10-14 14:06:08 +09:00
parent c51139f2bc
commit fe28e088a9
No known key found for this signature in database
GPG Key ID: 640114AF89DE6054
1 changed files with 11 additions and 1 deletions

View File

@ -1237,10 +1237,20 @@ int
gnupg_stat (const char *name, struct stat *statbuf)
{
# ifdef HAVE_W32_SYSTEM
# if __MINGW32_MAJOR_VERSION > 3
/* mingw.org's MinGW */
# define STRUCT_STAT _stat
# elif defined(_USE_32BIT_TIME_T)
/* MinGW64 for i686 */
# define STRUCT_STAT _stat32
# else
/* MinGW64 for x86_64 */
# define STRUCT_STAT _stat64i32
# endif
if (any8bitchar (name))
{
wchar_t *wname;
struct _stat32 st32;
struct STRUCT_STAT st32;
int ret;
wname = utf8_to_wchar (name);