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

Alexandre Julliard julliard at winehq.org
Thu Aug 1 05:16:56 CDT 2013


Dmitry Timoshkov <dmitry at baikal.ru> writes:

> @@ -208,9 +233,22 @@ static TIFF* tiff_open_stream(IStream *stream, const char *mode)
>      zero.QuadPart = 0;
>      IStream_Seek(stream, zero, STREAM_SEEK_SET, NULL);
>  
> +    /* Workaround for broken libtiff 4.x headers on some 64-bit hosts which
> +     * define TIFF_UINT64_T/toff_t as 32-bit for 32-bit builds, while they
> +     * are supposed to be always 64-bit.
> +     * TIFF_UINT64_T doesn't exist in libtiff 3.x, it was introduced in 4.x.
> +     */
> +#ifdef TIFF_UINT64_T
> +    /* libtiff 4.x */
> +    return pTIFFClientOpen("<IStream object>", mode, stream, tiff_stream_read,
> +        tiff_stream_write, (void *)tiff_stream_seek, tiff_stream_close,
> +        (void *)tiff_stream_size, (void *)tiff_stream_map, (void *)tiff_stream_unmap);
> +#else
> +    /* libtiff 3.x */
>      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, tiff_stream_seek_v3, tiff_stream_close,
> +        tiff_stream_size_v3, tiff_stream_map_v3, tiff_stream_unmap_v3);
> +#endif

Now that you are using ifdefs there's no reason to have two sets of
functions.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list