From bd38f705d8937635e135cfceb6c552690e2e2ccf Mon Sep 17 00:00:00 2001 From: NaitLee Date: Sun, 20 Oct 2024 15:22:47 +0800 Subject: [PATCH] fix(fs.c, windows, ucrt64): use GetCurrentDirectoryW instead of _wgetcwd on windows to fix compilation on msys ucrt64 --- fs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs.c b/fs.c index 2ce128e8..e912fa47 100644 --- a/fs.c +++ b/fs.c @@ -78,7 +78,7 @@ // windows wchar helpers #ifdef WIN32 -# define MAX_OSWPATH (MAX_OSPATH * sizeof(wchar)) +# define MAX_OSWPATH MAX_OSPATH # define WPATHDEF(var) wchar var[MAX_OSWPATH] #else # define WPATHDEF(var) ; @@ -2197,7 +2197,7 @@ static void FS_Init_Dir (void) #else // use the working directory #ifdef WIN32 - _wgetcwd(fs_basedirw, sizeof(fs_basedirw)); + GetCurrentDirectoryW(sizeof(fs_basedirw), fs_basedirw); NARROW(fs_basedirw, fs_basedir); #else getcwd(fs_basedir, sizeof(fs_basedir)); -- 2.39.2