Add some comments in tif_win32.c regarding known issue with WIN64 build.

This commit is contained in:
Bob Friesenhahn 2015-08-23 20:12:44 +00:00
parent 5a17dc99ce
commit b1f904c7a2

View File

@ -1,4 +1,4 @@
/* $Id: tif_win32.c,v 1.40 2012-11-18 17:51:52 bfriesen Exp $ */ /* $Id: tif_win32.c,v 1.41 2015-08-23 20:12:44 bfriesen Exp $ */
/* /*
* Copyright (c) 1988-1997 Sam Leffler * Copyright (c) 1988-1997 Sam Leffler
@ -28,6 +28,31 @@
* TIFF Library Win32-specific Routines. Adapted from tif_unix.c 4/5/95 by * TIFF Library Win32-specific Routines. Adapted from tif_unix.c 4/5/95 by
* Scott Wagner (wagner@itek.com), Itek Graphix, Rochester, NY USA * Scott Wagner (wagner@itek.com), Itek Graphix, Rochester, NY USA
*/ */
/*
CreateFileA/CreateFileW return type 'HANDLE'.
thandle_t is declared like
DECLARE_HANDLE(thandle_t);
in tiffio.h.
Windows (from winnt.h) DECLARE_HANDLE logic looks like
#ifdef STRICT
typedef void *HANDLE;
#define DECLARE_HANDLE(name) struct name##__ { int unused; }; typedef struct name##__ *name
#else
typedef PVOID HANDLE;
#define DECLARE_HANDLE(name) typedef HANDLE name
#endif
See http://bugzilla.maptools.org/show_bug.cgi?id=1941 for problems in WIN64
builds resulting from this. Unfortunately, the proposed patch was lost.
*/
#include "tiffiop.h" #include "tiffiop.h"
#include <windows.h> #include <windows.h>
@ -214,7 +239,7 @@ TIFFFdOpen(int ifd, const char* name, const char* mode)
break; break;
} }
} }
tif = TIFFClientOpen(name, mode, (thandle_t)ifd, tif = TIFFClientOpen(name, mode, (thandle_t)ifd, /* FIXME: WIN64 cast to pointer warning */
_tiffReadProc, _tiffWriteProc, _tiffReadProc, _tiffWriteProc,
_tiffSeekProc, _tiffCloseProc, _tiffSizeProc, _tiffSeekProc, _tiffCloseProc, _tiffSizeProc,
fSuppressMap ? _tiffDummyMapProc : _tiffMapProc, fSuppressMap ? _tiffDummyMapProc : _tiffMapProc,
@ -259,7 +284,7 @@ TIFFOpen(const char* name, const char* mode)
return ((TIFF *)0); return ((TIFF *)0);
} }
tif = TIFFFdOpen((int)fd, name, mode); tif = TIFFFdOpen((int)fd, name, mode); /* FIXME: WIN64 cast from pointer to int warning */
if(!tif) if(!tif)
CloseHandle(fd); CloseHandle(fd);
return tif; return tif;
@ -314,7 +339,7 @@ TIFFOpenW(const wchar_t* name, const char* mode)
NULL, NULL); NULL, NULL);
} }
tif = TIFFFdOpen((int)fd, tif = TIFFFdOpen((int)fd, /* FIXME: WIN64 cast from pointer to int warning */
(mbname != NULL) ? mbname : "<unknown>", mode); (mbname != NULL) ? mbname : "<unknown>", mode);
if(!tif) if(!tif)
CloseHandle(fd); CloseHandle(fd);