From: NaitLee Date: Sun, 20 Oct 2024 09:00:14 +0000 (+0800) Subject: fix(fs.c, windows, ucrt64): use GetCurrentDirectoryW instead of _wgetcwd on windows... X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=e80bb97f5b83637d7825574c43c2b41433ba6aa0;p=xonotic%2Fdarkplaces.git fix(fs.c, windows, ucrt64): use GetCurrentDirectoryW instead of _wgetcwd on windows to fix compilation on msys ucrt64 Signed-off-by: NaitLee --- 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));