Commit e6480970b400b38c041ffedd611632eea2d720ea

Sebastian Schuberth 2011-06-10T14:00:54

Add missing function declarations to avoid MSVC compiler warnings The better solution would probably be to turn the gitfo_lstat / gitfo_readlink macros into real functions that wrap either lstat or gitfo_lstat__w32 (and readlink or gitfo_readlink__w32). However, that would introduce an indirection unless inlined. For now, this is the less intrusive change.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
diff --git a/src/fileops.h b/src/fileops.h
index 4e6007a..ae8932b 100644
--- a/src/fileops.h
+++ b/src/fileops.h
@@ -98,6 +98,9 @@ extern int gitfo_mv_force(const char *from, const char *to);
 #ifdef GIT_WIN32
 #  define gitfo_lstat(p,b) gitfo_lstat__w32(p,b)
 #  define gitfo_readlink(a, b, c) gitfo_readlink__w32(a, b, c)
+
+   extern int gitfo_lstat__w32(const char *file_name, struct stat *buf);
+   extern int gitfo_readlink__w32(const char *link, char *target, size_t target_len);
 #else
 #  define gitfo_lstat(p,b) lstat(p,b)
 #  define gitfo_readlink(a, b, c) readlink(a, b, c)