summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--osdep/io.c8
-rw-r--r--osdep/io.h2
2 files changed, 10 insertions, 0 deletions
diff --git a/osdep/io.c b/osdep/io.c
index 18c2a83f94..d66160c0e7 100644
--- a/osdep/io.c
+++ b/osdep/io.c
@@ -621,6 +621,14 @@ int mp_mkdir(const char *path, int mode)
return res;
}
+int mp_unlink(const char *path)
+{
+ wchar_t *wpath = mp_from_utf8(NULL, path);
+ int res = _wunlink(wpath);
+ talloc_free(wpath);
+ return res;
+}
+
char *mp_win32_getcwd(char *buf, size_t size)
{
if (size >= SIZE_MAX / 3 - 1) {
diff --git a/osdep/io.h b/osdep/io.h
index 21555e8799..5cbd54f87f 100644
--- a/osdep/io.h
+++ b/osdep/io.h
@@ -116,6 +116,7 @@ DIR *mp_opendir(const char *path);
struct dirent *mp_readdir(DIR *dir);
int mp_closedir(DIR *dir);
int mp_mkdir(const char *path, int mode);
+int mp_unlink(const char *path);
char *mp_win32_getcwd(char *buf, size_t size);
char *mp_getenv(const char *name);
@@ -183,6 +184,7 @@ void mp_globfree(mp_glob_t *pglob);
#define readdir(...) mp_readdir(__VA_ARGS__)
#define closedir(...) mp_closedir(__VA_ARGS__)
#define mkdir(...) mp_mkdir(__VA_ARGS__)
+#define unlink(...) mp_unlink(__VA_ARGS__)
#define getcwd(...) mp_win32_getcwd(__VA_ARGS__)
#define getenv(...) mp_getenv(__VA_ARGS__)