From fb66839b59b2f54babd05fc88afa136dfe57877f Mon Sep 17 00:00:00 2001 From: Adrian Johnson Date: Mon, 17 Dec 2012 13:24:14 +1030 Subject: [PATCH 4/4] win32 large file support - not tested --- goo/gtypes.h | 2 ++ poppler/Stream.cc | 13 +++++++++++++ 2 files changed, 15 insertions(+) diff --git a/goo/gtypes.h b/goo/gtypes.h index 5247041..6e9c1ac 100644 --- a/goo/gtypes.h +++ b/goo/gtypes.h @@ -55,6 +55,8 @@ typedef unsigned long Gulong; typedef off_t Goffset; #elif HAVE_FSEEK64 typedef off64_t Goffset; +#elif _WIN32 +typedef __int64 Goffset; #else typedef long Goffset; #endif diff --git a/poppler/Stream.cc b/poppler/Stream.cc index 2529e4e..f22d012 100644 --- a/poppler/Stream.cc +++ b/poppler/Stream.cc @@ -757,6 +757,9 @@ void FileStream::reset() { #elif HAVE_FSEEK64 savePos = ftell64(f); fseek64(f, start, SEEK_SET); +#elif _WIN32 + savePos = _ftelli64(f); + _fseeki64(f, start, SEEK_SET); #else savePos = ftell(f); fseek(f, start, SEEK_SET); @@ -772,6 +775,8 @@ void FileStream::close() { fseeko(f, savePos, SEEK_SET); #elif HAVE_FSEEK64 fseek64(f, savePos, SEEK_SET); +#elif _WIN32 + _fseeki64(f, savePos, SEEK_SET); #else fseek(f, savePos, SEEK_SET); #endif @@ -808,6 +813,8 @@ void FileStream::setPos(Goffset pos, int dir) { fseeko(f, pos, SEEK_SET); #elif HAVE_FSEEK64 fseek64(f, pos, SEEK_SET); +#elif _WIN32 + _fseeki64(f, pos, SEEK_SET); #else fseek(f, pos, SEEK_SET); #endif @@ -819,6 +826,9 @@ void FileStream::setPos(Goffset pos, int dir) { #elif HAVE_FSEEK64 fseek64(f, 0, SEEK_END); size = ftell64(f); +#elif _WIN32 + _fseeki64(f, 0, SEEK_END); + size = _ftelli64(f); #else fseek(f, 0, SEEK_END); size = ftell(f); @@ -831,6 +841,9 @@ void FileStream::setPos(Goffset pos, int dir) { #elif HAVE_FSEEK64 fseek64(f, -pos, SEEK_END); bufPos = ftell64(f); +#elif _WIN32 + _fseeki64(f, -pos, SEEK_END); + bufPos = _ftelli64(f); #else fseek(f, -pos, SEEK_END); bufPos = ftell(f); -- 1.7.10.4