diff --git a/compat/mingw-posix.h b/compat/mingw-posix.h index 4539d3ca49..e154697865 100644 --- a/compat/mingw-posix.h +++ b/compat/mingw-posix.h @@ -406,7 +406,7 @@ int mingw_fstat(int fd, struct stat *buf); #ifdef lstat #undef lstat #endif -#define lstat mingw_lstat +extern int (*lstat)(const char *file_name, struct stat *buf); int mingw_utime(const char *file_name, const struct utimbuf *times); diff --git a/compat/mingw.c b/compat/mingw.c index 4673b1c34f..c27860e67f 100644 --- a/compat/mingw.c +++ b/compat/mingw.c @@ -1036,6 +1036,8 @@ static int do_stat_internal(int follow, const char *file_name, struct stat *buf) return do_lstat(follow, alt_name, buf); } +int (*lstat)(const char *file_name, struct stat *buf) = mingw_lstat; + static int get_file_info_by_handle(HANDLE hnd, struct stat *buf) { BY_HANDLE_FILE_INFORMATION fdata;