Mercurial > vim
comparison src/os_mswin.c @ 5386:c0e3990aed3f v7.4.044
updated for version 7.4.044
Problem: Can't build with old MSVC. (Wang Shoulin)
Solution: Define OPEN_OH_ARGTYPE instead of using intptr_t directly.
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Sun, 29 Sep 2013 19:05:21 +0200 |
parents | 4dfba3df303c |
children | 3881cd916014 |
comparison
equal
deleted
inserted
replaced
5385:b13c957a4cc7 | 5386:c0e3990aed3f |
---|---|
496 *p = psepc; | 496 *p = psepc; |
497 mb_ptr_adv(p); | 497 mb_ptr_adv(p); |
498 } | 498 } |
499 } | 499 } |
500 | 500 |
501 #if (_MSC_VER >= 1300) | |
502 # define OPEN_OH_ARGTYPE intptr_t | |
503 #else | |
504 # define OPEN_OH_ARGTYPE long | |
505 #endif | |
506 | |
501 static int | 507 static int |
502 stat_symlink_aware(const char *name, struct stat *stp) | 508 stat_symlink_aware(const char *name, struct stat *stp) |
503 { | 509 { |
504 #if defined(_MSC_VER) && _MSC_VER < 1700 | 510 #if defined(_MSC_VER) && _MSC_VER < 1700 |
505 /* Work around for VC10 or earlier. stat() can't handle symlinks properly. | 511 /* Work around for VC10 or earlier. stat() can't handle symlinks properly. |
531 NULL); | 537 NULL); |
532 if (h != INVALID_HANDLE_VALUE) | 538 if (h != INVALID_HANDLE_VALUE) |
533 { | 539 { |
534 int fd, n; | 540 int fd, n; |
535 | 541 |
536 fd = _open_osfhandle((intptr_t)h, _O_RDONLY); | 542 fd = _open_osfhandle((OPEN_OH_ARGTYPE)h, _O_RDONLY); |
537 n = _fstat(fd, (struct _stat*)stp); | 543 n = _fstat(fd, (struct _stat*)stp); |
538 _close(fd); | 544 _close(fd); |
539 return n; | 545 return n; |
540 } | 546 } |
541 } | 547 } |
578 NULL); | 584 NULL); |
579 if (h != INVALID_HANDLE_VALUE) | 585 if (h != INVALID_HANDLE_VALUE) |
580 { | 586 { |
581 int fd; | 587 int fd; |
582 | 588 |
583 fd = _open_osfhandle((intptr_t)h, _O_RDONLY); | 589 fd = _open_osfhandle((OPEN_OH_ARGTYPE)h, _O_RDONLY); |
584 n = _fstat(fd, stp); | 590 n = _fstat(fd, stp); |
585 _close(fd); | 591 _close(fd); |
586 return n; | 592 return n; |
587 } | 593 } |
588 } | 594 } |