summaryrefslogtreecommitdiffstats
path: root/player
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-10-17 21:46:08 +0200
committerwm4 <wm4@nowhere>2014-10-17 22:15:19 +0200
commit201a65635055cb5a2987dc23819ba0fcb18e4e14 (patch)
treec6ac3b5e4392579ff0f6ed22efb9cd780984bc1c /player
parenta7eb363ac1acb5566ce1af923d07c658361d5ad4 (diff)
downloadmpv-201a65635055cb5a2987dc23819ba0fcb18e4e14.tar.bz2
mpv-201a65635055cb5a2987dc23819ba0fcb18e4e14.tar.xz
win32: get rid of mp_stat in the normal source code
mp_stat() instead of stat() was used in the normal code (i.e. even on Unix), because MinGW-w64 has an unbelievable macro-mess in place, which prevents solving this elegantly. Add some dirty workarounds to hide mp_stat() from the normal code properly. This now requires replacing all functions that use the struct stat type. This includes fstat, lstat, fstatat, and possibly others. (mpv currently uses stat and fstat only.)
Diffstat (limited to 'player')
-rw-r--r--player/lua.c2
-rw-r--r--player/scripting.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/player/lua.c b/player/lua.c
index ef8dc1ca7d..73b5a2991c 100644
--- a/player/lua.c
+++ b/player/lua.c
@@ -1090,7 +1090,7 @@ static int script_readdir(lua_State *L)
fullpath[0] = '\0';
fullpath = talloc_asprintf_append(fullpath, "%s/%s", path, name);
struct stat st;
- if (mp_stat(fullpath, &st))
+ if (stat(fullpath, &st))
continue;
if (!(((t & 1) && S_ISREG(st.st_mode)) ||
((t & 2) && S_ISDIR(st.st_mode))))
diff --git a/player/scripting.c b/player/scripting.c
index 6e2a5a4e2d..5bc9a915f3 100644
--- a/player/scripting.c
+++ b/player/scripting.c
@@ -157,7 +157,7 @@ static char **list_script_files(void *talloc_ctx, char *path)
while ((ep = readdir(dp))) {
char *fname = mp_path_join(talloc_ctx, bstr0(path), bstr0(ep->d_name));
struct stat s;
- if (!mp_stat(fname, &s) && S_ISREG(s.st_mode))
+ if (!stat(fname, &s) && S_ISREG(s.st_mode))
MP_TARRAY_APPEND(talloc_ctx, files, count, fname);
}
closedir(dp);