X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b47c832e5529dc6c632536b4665a005f0a85aec8..b9efe021b554fa3967d1442cf758435c5cd5ae8f:/src/tiff/tif_unix.c diff --git a/src/tiff/tif_unix.c b/src/tiff/tif_unix.c index 6e4378595e..dab65b3ced 100644 --- a/src/tiff/tif_unix.c +++ b/src/tiff/tif_unix.c @@ -47,7 +47,11 @@ _tiffWriteProc(thandle_t fd, tdata_t buf, tsize_t size) static toff_t _tiffSeekProc(thandle_t fd, toff_t off, int whence) { +#if USE_64BIT_API == 1 + return ((toff_t) lseek64((int) fd, (off64_t) off, whence)); +#else return ((toff_t) lseek((int) fd, (off_t) off, whence)); +#endif } static int @@ -64,10 +68,15 @@ _tiffSizeProc(thandle_t fd) #ifdef _AM29K long fsize; return ((fsize = lseek((int) fd, 0, SEEK_END)) < 0 ? 0 : fsize); +#else +#if USE_64BIT_API == 1 + struct stat64 sb; + return (toff_t) (fstat64((int) fd, &sb) < 0 ? 0 : sb.st_size); #else struct stat sb; return (toff_t) (fstat((int) fd, &sb) < 0 ? 0 : sb.st_size); #endif +#endif } #ifdef HAVE_MMAP @@ -147,8 +156,12 @@ TIFFOpen(const char* name, const char* mode) #ifdef _AM29K fd = open(name, m); +#else +#if USE_64BIT_API == 1 + fd = open(name, m | O_LARGEFILE, 0666); #else fd = open(name, m, 0666); +#endif #endif if (fd < 0) { TIFFError(module, "%s: Cannot open", name);