diff --git a/compat/mingw.c b/compat/mingw.c index 4e409f0c2b..265646f735 100644 --- a/compat/mingw.c +++ b/compat/mingw.c @@ -157,6 +157,14 @@ int mingw_mkdir(const char *path, int mode) return ret; } +#undef unlink +int mingw_unlink(const char *pathname) +{ + /* read-only files cannot be removed */ + chmod(pathname, 0666); + return unlink(pathname); +} + #undef open int mingw_open (const char *filename, int oflags, ...) { diff --git a/compat/mingw.h b/compat/mingw.h index ab7cf886bb..f66c83166b 100644 --- a/compat/mingw.h +++ b/compat/mingw.h @@ -112,14 +112,6 @@ static inline int fcntl(int fd, int cmd, long arg) * simple adaptors */ -static inline int mingw_unlink(const char *pathname) -{ - /* read-only files cannot be removed */ - chmod(pathname, 0666); - return unlink(pathname); -} -#define unlink mingw_unlink - static inline pid_t waitpid(pid_t pid, int *status, unsigned options) { if (options == 0) @@ -175,6 +167,9 @@ int readlink(const char *path, char *buf, size_t bufsiz); int mingw_mkdir(const char *path, int mode); #define mkdir mingw_mkdir +int mingw_unlink(const char *pathname); +#define unlink mingw_unlink + int mingw_open (const char *filename, int oflags, ...); #define open mingw_open