Merge pull request #1600 from myzhang1029/long-tell

Fix #1591 - Not building on MinGW-W64
This commit is contained in:
Nick Terrell
2019-04-24 21:05:25 -07:00
committed by GitHub
+7
View File
@@ -269,6 +269,13 @@ void FIO_addAbortHandler()
else
return -1;
}
static __int64 LONG_TELL(FILE* file) {
LARGE_INTEGER off, newOff;
off.QuadPart = 0;
newOff.QuadPart = 0;
SetFilePointerEx((HANDLE) _get_osfhandle(_fileno(file)), off, &newOff, FILE_CURRENT);
return newOff.QuadPart;
}
#else
# define LONG_SEEK fseek
# define LONG_TELL ftell