Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(fs.c, windows, ucrt64): fix getcwd for windows ucrt64 builds #214

Merged

Conversation

NaitLee
Copy link
Contributor

@NaitLee NaitLee commented Oct 20, 2024

I'm really late 🥲 With this patch, compiling darkplaces master with msys2 ucrt64 environment is back to normal.

History:

Closes gitlab.com/xonotic/darkplaces#422.

…cwd on windows to fix compilation on msys ucrt64

Signed-off-by: NaitLee <naitlee@disroot.org>
…cwd on windows to fix compilation on msys ucrt64

Signed-off-by: NaitLee <naitlee@disroot.org>
@NaitLee NaitLee force-pushed the NaitLee/getcwd-on-windows-ucrt64 branch from 6e6ccd6 to fb909df Compare October 20, 2024 09:07
fs.c Outdated
@@ -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);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be sizeof(fs_basedirw) / sizeof(*fs_basedirw), so that the elements, not bytes, are counted.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right. New commit pushed to fix this.

@divVerent
Copy link
Contributor

wasm error seems unrelated.

As for _wgetcwd vs GetCurrentDirectoryW - I still am not convinced that was the problem, but at the same time, don't care. The winapi function name is slightly more readable than the not-really-posix name, both are proprietary, so may as well keep the winapi one you got there.

@divVerent divVerent merged commit ef5f75a into DarkPlacesEngine:master Oct 25, 2024
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

modlist.txt looks for mods in c:\ on windows
3 participants