From ac0c3093f4935fd266656abc9311a63fad98e99e Mon Sep 17 00:00:00 2001 From: myd7349 Date: Mon, 25 May 2020 21:49:24 +0800 Subject: [PATCH] Fix build error on UWP (#896) For x64-uwp, size_t is 64-bit, DWORD is 32-bit. When /WX compiler option is specified, error occurs. --- windows/toni_ronnko_dirent.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/windows/toni_ronnko_dirent.h b/windows/toni_ronnko_dirent.h index f118712e..a9356644 100644 --- a/windows/toni_ronnko_dirent.h +++ b/windows/toni_ronnko_dirent.h @@ -339,7 +339,13 @@ static void dirent_set_errno(int error); */ static _WDIR *_wopendir(const wchar_t *dirname) { _WDIR *dirp; +#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) + /* Desktop */ DWORD n; +#else + /* WinRT */ + size_t n; +#endif wchar_t *p; /* Must have directory name */