summaryrefslogtreecommitdiff
path: root/tools/tiffdump.c
diff options
context:
space:
mode:
authorBob Friesenhahn <bfriesen@simple.dallas.tx.us>2015-08-19 02:31:04 +0000
committerBob Friesenhahn <bfriesen@simple.dallas.tx.us>2015-08-19 02:31:04 +0000
commit8ba4a1c8946016d6b82d854d6fbcdc7ed9d0e513 (patch)
tree1126eeea753ab891c8d5ff82ef0f097e79024489 /tools/tiffdump.c
parenta0e1185771f502b81ba07b1ec3b25ea56a6de114 (diff)
downloadlibtiff-git-8ba4a1c8946016d6b82d854d6fbcdc7ed9d0e513.tar.gz
Support large files under Windows using tif_unix.c and libtiff tools.
Diffstat (limited to 'tools/tiffdump.c')
-rw-r--r--tools/tiffdump.c19
1 files changed, 5 insertions, 14 deletions
diff --git a/tools/tiffdump.c b/tools/tiffdump.c
index a5481260..7aa1c178 100644
--- a/tools/tiffdump.c
+++ b/tools/tiffdump.c
@@ -1,4 +1,4 @@
-/* $Id: tiffdump.c,v 1.31 2015-06-21 01:09:11 bfriesen Exp $ */
+/* $Id: tiffdump.c,v 1.32 2015-08-19 02:31:05 bfriesen Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
@@ -171,7 +171,7 @@ dump(int fd, uint64 diroff)
uint64* visited_diroff = NULL;
unsigned int count_visited_dir = 0;
- lseek(fd, (off_t) 0, 0);
+ _TIFF_lseek_f(fd, (_TIFF_off_t) 0, 0);
if (read(fd, (char*) &hdr, sizeof (TIFFHeaderCommon)) != sizeof (TIFFHeaderCommon))
ReadError("TIFF header");
if (hdr.common.tiff_magic != TIFF_BIGENDIAN
@@ -309,11 +309,7 @@ ReadDirectory(int fd, unsigned int ix, uint64 off)
if (off == 0) /* no more directories */
goto done;
-#if defined(__WIN32__) && defined(_MSC_VER)
- if (_lseeki64(fd, (__int64)off, SEEK_SET) != (__int64)off) {
-#else
- if (lseek(fd, (off_t)off, SEEK_SET) != (off_t)off) {
-#endif
+ if (_TIFF_lseek_f(fd, (_TIFF_off_t)off, SEEK_SET) != (_TIFF_off_t)off) {
Fatal("Seek error accessing TIFF directory");
goto done;
}
@@ -479,13 +475,8 @@ ReadDirectory(int fd, unsigned int ix, uint64 off)
{
datamem = _TIFFmalloc((uint32)datasize);
if (datamem) {
-#if defined(__WIN32__) && defined(_MSC_VER)
- if (_lseeki64(fd, (__int64)dataoffset, SEEK_SET)
- != (__int64)dataoffset)
-#else
- if (lseek(fd, (off_t)dataoffset, 0) !=
- (off_t)dataoffset)
-#endif
+ if (_TIFF_lseek_f(fd, (_TIFF_off_t)dataoffset, 0) !=
+ (_TIFF_off_t)dataoffset)
{
Error(
"Seek error accessing tag %u value", tag);