windowscodecs: Workaround libtiff bug when it defines toff_t as 32-bit for 32-bit builds.

Dmitry Timoshkov dmitry at baikal.ru
Fri Jul 26 07:10:21 CDT 2013


On a recent 64-bit Linux tiffconf.h has the following define:
/* Unsigned 64-bit type */
#define TIFF_UINT64_T unsigned long

tiff.h has this:
typedef TIFF_UINT64_T uint64;

and tiffio.h has this:
typedef uint64 toff_t;          /* file offset */

due to TIFF_UINT64_T breakage nothing of user defined callbacks works.
---
 dlls/windowscodecs/tiffformat.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/dlls/windowscodecs/tiffformat.c b/dlls/windowscodecs/tiffformat.c
index 62f1ad7..c01413c 100644
--- a/dlls/windowscodecs/tiffformat.c
+++ b/dlls/windowscodecs/tiffformat.c
@@ -142,7 +142,7 @@ static tsize_t tiff_stream_write(thandle_t client_data, tdata_t data, tsize_t si
     return bytes_written;
 }
 
-static toff_t tiff_stream_seek(thandle_t client_data, toff_t offset, int whence)
+static UINT64 tiff_stream_seek(thandle_t client_data, UINT64 offset, int whence)
 {
     IStream *stream = (IStream*)client_data;
     LARGE_INTEGER move;
@@ -178,7 +178,7 @@ static int tiff_stream_close(thandle_t client_data)
     return 0;
 }
 
-static toff_t tiff_stream_size(thandle_t client_data)
+static UINT64 tiff_stream_size(thandle_t client_data)
 {
     IStream *stream = (IStream*)client_data;
     STATSTG statstg;
@@ -190,13 +190,13 @@ static toff_t tiff_stream_size(thandle_t client_data)
     else return -1;
 }
 
-static int tiff_stream_map(thandle_t client_data, tdata_t *addr, toff_t *size)
+static int tiff_stream_map(thandle_t client_data, tdata_t *addr, UINT64 *size)
 {
     /* Cannot mmap streams */
     return 0;
 }
 
-static void tiff_stream_unmap(thandle_t client_data, tdata_t addr, toff_t size)
+static void tiff_stream_unmap(thandle_t client_data, tdata_t addr, UINT64 size)
 {
     /* No need to ever do this, since we can't map things. */
 }
@@ -209,8 +209,8 @@ static TIFF* tiff_open_stream(IStream *stream, const char *mode)
     IStream_Seek(stream, zero, STREAM_SEEK_SET, NULL);
 
     return pTIFFClientOpen("<IStream object>", mode, stream, tiff_stream_read,
-        tiff_stream_write, tiff_stream_seek, tiff_stream_close,
-        tiff_stream_size, tiff_stream_map, tiff_stream_unmap);
+        tiff_stream_write, (void *)tiff_stream_seek, tiff_stream_close,
+        (void *)tiff_stream_size, (void *)tiff_stream_map, (void *)tiff_stream_unmap);
 }
 
 typedef struct {
-- 
1.8.3.3




More information about the wine-patches mailing list