diff --git a/uppsrc/plugin/tif/lib/tif_config.h b/uppsrc/plugin/tif/lib/tif_config.h index 5cebfa02e..6d509dfbc 100644 --- a/uppsrc/plugin/tif/lib/tif_config.h +++ b/uppsrc/plugin/tif/lib/tif_config.h @@ -50,7 +50,10 @@ /* Unsigned 64-bit type */ #define TIFF_UINT64_T unsigned __int64 -#if _WIN64 +#define TIFF_SSIZE_T ptrdiff_t +#define TIFF_SIZE_T size_t + +#if _WIN64 /* Windows 64-bit build */ @@ -65,14 +68,10 @@ # define TIFF_SIZE_FORMAT TIFF_INT64_FORMAT /* Unsigned size type */ -# define TIFF_SIZE_T TIFF_UINT64_T - /* Signed size type formatter */ # define TIFF_SSIZE_FORMAT TIFF_INT64_FORMAT /* Signed size type */ -# define TIFF_SSIZE_T TIFF_INT64_T - #else /* Windows 32-bit build @@ -90,15 +89,8 @@ /* Size type formatter */ # define TIFF_SIZE_FORMAT "%u" -/* Unsigned size type */ -# define TIFF_SIZE_T unsigned int - /* Signed size type formatter */ # define TIFF_SSIZE_FORMAT "%d" - -/* Signed size type */ -# define TIFF_SSIZE_T signed int - #endif /* Set the native cpu bit order */ diff --git a/uppsrc/plugin/tif/lib/tiffconf.h b/uppsrc/plugin/tif/lib/tiffconf.h index 2d49f701d..0e883f752 100644 --- a/uppsrc/plugin/tif/lib/tiffconf.h +++ b/uppsrc/plugin/tif/lib/tiffconf.h @@ -22,50 +22,28 @@ /* Unsigned 16-bit type */ #define TIFF_UINT16_T unsigned short -#ifdef PLATFORM_WIN32 +#include + +#ifdef _MSC_VER #define TIFF_INT32_T long #define TIFF_UINT32_T unsigned long + #define TIFF_INT64_T signed __int64 + #define TIFF_UINT64_T unsigned __int64 #else #define TIFF_INT32_T int #define TIFF_UINT32_T unsigned int + #define TIFF_INT64_T long long int + #define TIFF_UINT64_T long long unsigned #endif +#define TIFF_SSIZE_T ptrdiff_t +#define TIFF_SIZE_T size_t + #define TIFF_INT32_FORMAT "%d" #define TIFF_UINT32_FORMAT "%u" - -/* Unsigned 32-bit type */ - - -/* Signed 64-bit type formatter */ #define TIFF_INT64_FORMAT "%I64d" - -/* Signed 64-bit type */ -#define TIFF_INT64_T signed __int64 - -/* Unsigned 64-bit type formatter */ #define TIFF_UINT64_FORMAT "%I64u" -/* Unsigned 64-bit type */ -#define TIFF_UINT64_T unsigned __int64 - -#if _WIN64 -/* - Windows 64-bit build -*/ - -/* Signed size type */ -# define TIFF_SSIZE_T TIFF_INT64_T - -#else -/* - Windows 32-bit build -*/ - -/* Signed size type */ -# define TIFF_SSIZE_T signed int - -#endif - /* Compatibility stuff. */ /* Define as 0 or 1 according to the floating point format suported by the diff --git a/uppsrc/plugin/tif/tifupp.cpp b/uppsrc/plugin/tif/tifupp.cpp index 783a90131..2c1162ac3 100644 --- a/uppsrc/plugin/tif/tifupp.cpp +++ b/uppsrc/plugin/tif/tifupp.cpp @@ -118,9 +118,9 @@ extern "C" tdata_t _TIFFrealloc(tdata_t p, tsize_t s) return (tdata_t)(newptr + 4); } -extern "C" void _TIFFmemset(void* p, int v, tsize_t c) { memset(p, v, c); } -extern "C" void _TIFFmemcpy(void* d, const tdata_t s, tsize_t c) { memcpy(d, s, c); } -extern "C" int _TIFFmemcmp(const tdata_t p1, const tdata_t p2, tsize_t c) { return memcmp(p1, p2, c); } +extern "C" void _TIFFmemset(void* p, int v, tmsize_t c) { memset(p, v, c); } +extern "C" void _TIFFmemcpy(void* d, const void *s, tmsize_t c) { memcpy(d, s, c); } +extern "C" int _TIFFmemcmp(const void *p1, const void *p2, tmsize_t c) { return memcmp(p1, p2, c); } /* static void Blt2to4(byte *dest, const byte *src, unsigned count)