diff options
author | Tim Kientzle <kientzle@gmail.com> | 2011-11-18 20:45:13 -0500 |
---|---|---|
committer | Tim Kientzle <kientzle@gmail.com> | 2011-11-18 20:45:13 -0500 |
commit | bb46f17f72cd0c3726ecf48ab9a4ba711bf792ab (patch) | |
tree | 5f808edc612cbeb2260fdd855d454c9d576f8a13 /libarchive/archive_windows.c | |
parent | b26e1a2be71d7f717bf3bd0761167a95f18a7bb8 (diff) | |
download | libarchive-bb46f17f72cd0c3726ecf48ab9a4ba711bf792ab.tar.gz |
Improve portability to old Windows systems by using SetFilePointer
instead of SetFilePointerEx.
Fix a couple of uninitialized variables.
From: Denis B MARTIN
SVN-Revision: 3807
Diffstat (limited to 'libarchive/archive_windows.c')
-rw-r--r-- | libarchive/archive_windows.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/libarchive/archive_windows.c b/libarchive/archive_windows.c index 38480a3c..45ae9d0f 100644 --- a/libarchive/archive_windows.c +++ b/libarchive/archive_windows.c @@ -64,9 +64,7 @@ #define EPOC_TIME ARCHIVE_LITERAL_ULL(116444736000000000) -#if defined(_MSC_VER) && _MSC_VER < 1300 -/* VS 6 does not provide SetFilePointerEx, so define it here. */ -static BOOL SetFilePointerEx(HANDLE hFile, +static BOOL SetFilePointerEx_perso(HANDLE hFile, LARGE_INTEGER liDistanceToMove, PLARGE_INTEGER lpNewFilePointer, DWORD dwMoveMethod) @@ -80,7 +78,6 @@ static BOOL SetFilePointerEx(HANDLE hFile, } return li.LowPart != -1 || GetLastError() == NO_ERROR; } -#endif struct ustat { int64_t st_atime; @@ -285,7 +282,7 @@ __la_lseek(int fd, __int64 offset, int whence) return (-1); } distance.QuadPart = offset; - if (!SetFilePointerEx(handle, distance, &newpointer, whence)) { + if (!SetFilePointerEx_perso(handle, distance, &newpointer, whence)) { DWORD lasterr; lasterr = GetLastError(); |