1998.04.06 18:42 "libtiff isn't closing all of the file handles on NT ?", by Chris Griffin

1998.04.07 17:13 "RE: libtiff isn't closing all of the file handles on NT ?", by Gerben Vos

This may be fixed by defining __WIN32__ (Microsoft's compiler only defines WIN32), so the pv_map_handle member is added to the tiff directory structure. I don't remember anymore whether this was the fix to this problem or another, but you do need to define it.

What i did, was to change the following in tiffcomp.h:

52a53,56
  #if defined(__acorn) && defined(__riscos)
  #define __acornriscos
  #endif

> #ifdef WIN32
> #define __WIN32__
> #endif

  #if defined(__MWERKS__) || defined(THINK_C)
  #include <unix.h>

Also, i changed this in tiffio.h:

74c74
  typedef       uint32 tstrip_t;        /* strip number */
  typedef uint32 ttile_t;               /* tile number */
  typedef       int32 tsize_t;          /* i/o size in bytes */
< #if defined(_WINDOWS) || defined(__WIN32__) || defined(_Windows)
---
> #if defined(_WINDOWS) || defined(__WIN32__) || defined(WIN32) ||
defined(_Windows)
  #include <windows.h>
76c76
< #ifdef __WIN32__
---
> #if defined(__WIN32__) || defined(WIN32)
  DECLARE_HANDLE(thandle_t);    /* Win32 file handle */
  #else
  typedef       HFILE thandle_t;        /* client data handle */

(Note: the diff format may not be exactly the same as that of Unix diff -c)

If this helps you people, maybe this could be added to the next version of libtiff, so people who blindly try to compile it with Microsoft's compiler get better results.

Gerben.