From f4b70b632302f8ff0d6d22e91e3bcc46d5bbb7e9 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 4 Nov 2009 16:31:40 -0500 Subject: [PATCH] libarchive: Provide SetFilePointerEx for VS 6 --- .../cmlibarchive/libarchive/archive_windows.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Utilities/cmlibarchive/libarchive/archive_windows.c b/Utilities/cmlibarchive/libarchive/archive_windows.c index ddd035290..e194d7704 100644 --- a/Utilities/cmlibarchive/libarchive/archive_windows.c +++ b/Utilities/cmlibarchive/libarchive/archive_windows.c @@ -65,6 +65,20 @@ # define EPOC_TIME (116444736000000000ULL) #endif +#if defined(_MSC_VER) && _MSC_VER < 1300 +/* VS 6 does not provide SetFilePointerEx, so define it here. */ +static BOOL SetFilePointerEx(HANDLE hFile, + LARGE_INTEGER liDistanceToMove, + PLARGE_INTEGER lpNewFilePointer, + DWORD dwMoveMethod) +{ + LARGE_INTEGER li; + li.QuadPart = liDistanceToMove.QuadPart; + li.LowPart = SetFilePointer(hFile, li.LowPart, &li.HighPart, dwMoveMethod); + if(lpNewFilePointer) { lpNewFilePointer->QuadPart = li.QuadPart; } + return li.LowPart != -1 || GetLastError() == NO_ERROR; +} +#endif struct ustat { int64_t st_atime;