From: NaitLee Date: Sun, 20 Oct 2024 07:22:47 +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=refs%2Fheads%2FNaitLee%2Fgetcwd-on-windows-ucrt64;p=xonotic%2Fdarkplaces.git fix(fs.c, windows, ucrt64): use GetCurrentDirectoryW instead of _wgetcwd on windows to fix compilation on msys ucrt64 --- 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));