Skip to content

Commit 71df95c

Browse files
wm4Uoti Urpala
wm4
authored and
Uoti Urpala
committed
windows support: fix _wstat misusage
I have no idea when or how this broke, but _wstati64() is the function we want anyway (64 bit filesize). Possibly this was a mingw-w64 bug. It's unknown why "wstat()" just doesn't work in this case, as it's not defined by MSDN and could be defined by mingw as it needs.
1 parent 393988c commit 71df95c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

osdep/io.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ void mp_get_converted_argv(int *argc, char ***argv)
8787
int mp_stat(const char *path, struct stat *buf)
8888
{
8989
wchar_t *wpath = mp_from_utf8(NULL, path);
90-
int res = _wstat64(wpath, buf);
90+
int res = _wstati64(wpath, buf);
9191
talloc_free(wpath);
9292
return res;
9393
}

osdep/io.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ struct dirent *mp_readdir(DIR *dir);
5555
int mp_closedir(DIR *dir);
5656
int mp_mkdir(const char *path, int mode);
5757

58-
// NOTE: Stat is not overridden with mp_stat, because MinGW-w64 defines it as
58+
// NOTE: stat is not overridden with mp_stat, because MinGW-w64 defines it as
5959
// macro.
6060

6161
#define fprintf(...) mp_fprintf(__VA_ARGS__)

0 commit comments

Comments
 (0)