Fix MSVC builds: win_opendir.c defined unicode on itself while it's used not in unicode.

This commit is contained in:
ts-korhonen
2021-04-21 13:00:56 +03:00
parent b07a6023d0
commit 90ccb754fb

View File

@@ -17,8 +17,6 @@
* Copyright 1998-2007 MicroWalt Corporation * Copyright 1998-2007 MicroWalt Corporation
* Copyright 2017 Fred N. van Kempen * Copyright 2017 Fred N. van Kempen
*/ */
#define UNICODE
#include <windows.h>
#include <io.h> #include <io.h>
#include <stdio.h> #include <stdio.h>
#include <stdint.h> #include <stdint.h>
@@ -158,10 +156,11 @@ readdir(DIR *p)
default: /* regular entry. */ default: /* regular entry. */
#ifdef UNICODE #ifdef UNICODE
wcsncpy(p->dent.d_name, ffp->name, MAXNAMLEN+1); wcsncpy(p->dent.d_name, ffp->name, MAXNAMLEN+1);
p->dent.d_reclen = (char)wcslen(p->dent.d_name);
#else #else
strncpy(p->dent.d_name, ffp->name, MAXNAMLEN+1); strncpy(p->dent.d_name, ffp->name, MAXNAMLEN+1);
p->dent.d_reclen = (char)strlen(p->dent.d_name);
#endif #endif
p->dent.d_reclen = (char) wcslen(p->dent.d_name);
} }
/* Read next entry. */ /* Read next entry. */