libarchive: Provide SetFilePointerEx for VS 6

This commit is contained in:
Brad King 2009-11-04 16:31:40 -05:00
parent e5075bb8e8
commit f4b70b6323
1 changed files with 14 additions and 0 deletions

View File

@ -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;