repaired build on mac after libtiff update

This commit is contained in:
Vadim Pisarevsky 2010-07-16 15:04:34 +00:00
parent 396aa53e96
commit 641c2ba83e
6 changed files with 41 additions and 8 deletions

View File

@ -26,13 +26,21 @@
#define TIFF_INT64_FORMAT "%I64d"
/* Signed 64-bit type */
#ifdef _MSC_VER
#define TIFF_INT64_T signed __int64
#else
#define TIFF_INT64_T long long
#endif
/* Unsigned 64-bit type formatter */
#define TIFF_UINT64_FORMAT "%I64u"
/* Unsigned 64-bit type */
#ifdef _MSC_VER
#define TIFF_UINT64_T unsigned __int64
#else
#define TIFF_UINT64_T unsigned long long
#endif
/* Compatibility stuff. */

View File

@ -64,7 +64,7 @@ typedef uint16 tsample_t; /* sample number */
typedef uint32 tstrile_t; /* strip or tile number */
typedef tstrile_t tstrip_t; /* strip number */
typedef tstrile_t ttile_t; /* tile number */
typedef int32 tsize_t; /* i/o size in bytes */
typedef size_t tsize_t; /* i/o size in bytes */
typedef void* tdata_t; /* image data ref */
typedef uint32 toff_t; /* file offset */

View File

@ -32,11 +32,18 @@
/* The size of a `long', as computed by sizeof. */
#define SIZEOF_LONG 4
#ifdef _MSC_VER
/* Signed 64-bit type */
#define TIFF_INT64_T signed __int64
/* Unsigned 64-bit type */
#define TIFF_UINT64_T unsigned __int64
#else
/* Signed 64-bit type */
#define TIFF_INT64_T long long
/* Signed 64-bit type */
#define TIFF_UINT64_T unsigned long long
#endif
/* Set the native cpu bit order */
#define HOST_FILLORDER FILLORDER_LSB2MSB

View File

@ -771,6 +771,22 @@ _TIFFFindFieldInfo(TIFF* tif, ttag_t tag, TIFFDataType dt)
return tif->tif_foundfield = (ret ? *ret : NULL);
}
#undef lfind
static void *
lfind(const void *key, const void *base, size_t *nmemb, size_t size,
int(*compar)(const void *, const void *))
{
char *element, *end;
end = (char *)base + *nmemb * size;
for (element = (char *)base; element < end; element += size)
if (!compar(element, key)) /* key found */
return element;
return NULL;
}
const TIFFFieldInfo*
_TIFFFindFieldInfoByName(TIFF* tif, const char *field_name, TIFFDataType dt)
{

View File

@ -46,10 +46,6 @@
# include <fcntl.h>
#endif
#ifdef HAVE_IO_H
# include <io.h>
#endif
#include "tiffiop.h"
static tsize_t

View File

@ -66,8 +66,14 @@ using namespace std;
struct TempDirHolder
{
const string temp_folder;
TempDirHolder() { char* p = tmpnam(0); if(p[0] == '\\') p++; temp_folder = p; exec_cmd("mkdir " + temp_folder); }
string temp_folder;
TempDirHolder()
{
char* p = tmpnam(0);
if(p[0] == '\\') p++;
temp_folder = string(p);
exec_cmd("mkdir " + temp_folder);
}
~TempDirHolder() { exec_cmd("rm -rf " + temp_folder); }
static void exec_cmd(const string& cmd) { marker(cmd); int res = system( cmd.c_str() ); (void)res; }