summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authornulltoken <emeric.fermas@gmail.com>2011-06-15 17:04:11 +0200
committernulltoken <emeric.fermas@gmail.com>2011-06-15 19:45:33 +0200
commit63fadf99dccf51cf6f7912419690dd5af128a66a (patch)
tree5c64f7828d91ada158736bd561fa2f36cb37e93f /src
parent95818ff73aa8af414c4c893a5088656ac07a6de4 (diff)
downloadlibgit2-63fadf99dccf51cf6f7912419690dd5af128a66a.tar.gz
Add mode_t definition in MSVC compat layer
Diffstat (limited to 'src')
-rw-r--r--src/fileops.c2
-rw-r--r--src/msvc-compat.h2
2 files changed, 3 insertions, 1 deletions
diff --git a/src/fileops.c b/src/fileops.c
index c8c37bee7..2a20617a5 100644
--- a/src/fileops.c
+++ b/src/fileops.c
@@ -633,7 +633,7 @@ static int do_lstat(const char *file_name, struct stat *buf)
buf->st_gid = 0;
buf->st_uid = 0;
buf->st_nlink = 1;
- buf->st_mode = (unsigned short)fMode;
+ buf->st_mode = (mode_t)fMode;
buf->st_size = fdata.nFileSizeLow; /* Can't use nFileSizeHigh, since it's not a stat64 */
buf->st_dev = buf->st_rdev = (_getdrive() - 1);
buf->st_atime = filetime_to_time_t(&(fdata.ftLastAccessTime));
diff --git a/src/msvc-compat.h b/src/msvc-compat.h
index 89f410d4b..df3e62d11 100644
--- a/src/msvc-compat.h
+++ b/src/msvc-compat.h
@@ -21,6 +21,8 @@
# define S_ISFIFO(m) (((m) & _S_IFMT) == _S_IFIFO)
# define S_ISLNK(m) (((m) & _S_IFMT) == _S_IFLNK)
+# define mode_t unsigned short
+
/* case-insensitive string comparison */
# define strcasecmp _stricmp
# define strncasecmp _strnicmp