summaryrefslogtreecommitdiff
path: root/src/os_mswin.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2013-09-29 19:05:21 +0200
committerBram Moolenaar <Bram@vim.org>2013-09-29 19:05:21 +0200
commit8962fda1dacf374d78bd02ca487800c2519c57b2 (patch)
tree7107e274675f98fca92406b1e91ad2d4ad58ae60 /src/os_mswin.c
parent386dcde30d677c26a596cf7479f8dd9ee498978b (diff)
downloadvim-git-8962fda1dacf374d78bd02ca487800c2519c57b2.tar.gz
updated for version 7.4.044v7.4.044
Problem: Can't build with old MSVC. (Wang Shoulin) Solution: Define OPEN_OH_ARGTYPE instead of using intptr_t directly.
Diffstat (limited to 'src/os_mswin.c')
-rw-r--r--src/os_mswin.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/os_mswin.c b/src/os_mswin.c
index 8b507f6fb..95c3d1738 100644
--- a/src/os_mswin.c
+++ b/src/os_mswin.c
@@ -498,6 +498,12 @@ slash_adjust(p)
}
}
+#if (_MSC_VER >= 1300)
+# define OPEN_OH_ARGTYPE intptr_t
+#else
+# define OPEN_OH_ARGTYPE long
+#endif
+
static int
stat_symlink_aware(const char *name, struct stat *stp)
{
@@ -533,7 +539,7 @@ stat_symlink_aware(const char *name, struct stat *stp)
{
int fd, n;
- fd = _open_osfhandle((intptr_t)h, _O_RDONLY);
+ fd = _open_osfhandle((OPEN_OH_ARGTYPE)h, _O_RDONLY);
n = _fstat(fd, (struct _stat*)stp);
_close(fd);
return n;
@@ -580,7 +586,7 @@ wstat_symlink_aware(const WCHAR *name, struct _stat *stp)
{
int fd;
- fd = _open_osfhandle((intptr_t)h, _O_RDONLY);
+ fd = _open_osfhandle((OPEN_OH_ARGTYPE)h, _O_RDONLY);
n = _fstat(fd, stp);
_close(fd);
return n;