diff options
Diffstat (limited to 'src/win32/posix.h')
-rw-r--r-- | src/win32/posix.h | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/src/win32/posix.h b/src/win32/posix.h index 24cba23e0..2cbea1807 100644 --- a/src/win32/posix.h +++ b/src/win32/posix.h @@ -19,6 +19,12 @@ # define EAFNOSUPPORT (INT_MAX-1) #endif +#ifdef _MSC_VER +# define p_ftruncate(fd, sz) _chsize_s(fd, sz) +#else /* MinGW */ +# define p_ftruncate(fd, sz) _chsize(fd, sz) +#endif + GIT_INLINE(int) p_link(const char *old, const char *new) { GIT_UNUSED(old); @@ -27,24 +33,15 @@ GIT_INLINE(int) p_link(const char *old, const char *new) return -1; } -GIT_INLINE(int) p_mkdir(const char *path, mode_t mode) -{ - git_win32_path buf; - GIT_UNUSED(mode); - git_win32_path_from_c(buf, path); - return _wmkdir(buf); -} - +extern int p_mkdir(const char *path, mode_t mode); extern int p_unlink(const char *path); extern int p_lstat(const char *file_name, struct stat *buf); -extern int p_readlink(const char *link, char *target, size_t target_len); +extern int p_readlink(const char *path, char *buf, size_t bufsiz); extern int p_symlink(const char *old, const char *new); -extern int p_hide_directory__w32(const char *path); extern char *p_realpath(const char *orig_path, char *buffer); extern int p_vsnprintf(char *buffer, size_t count, const char *format, va_list argptr); extern int p_snprintf(char *buffer, size_t count, const char *format, ...) GIT_FORMAT_PRINTF(3, 4); extern int p_mkstemp(char *tmp_path); -extern int p_setenv(const char* name, const char* value, int overwrite); extern int p_stat(const char* path, struct stat* buf); extern int p_chdir(const char* path); extern int p_chmod(const char* path, mode_t mode); |