AWARE [SYSTEMS] Imaging expertise for the Delphi developer
AWare Systems, Imaging expertise for the Delphi developer, Home TIFF and LibTiff Mailing List Archive

LibTiff Mailing List

TIFF and LibTiff Mailing List Archive
April 1998

Previous Thread
Next Thread

Previous by Thread
Next by Thread

Previous by Date
Next by Date

Contact

The TIFF Mailing List Homepage
This list is run by Frank Warmerdam
Archive maintained by AWare Systems



Valid HTML 4.01!



1998.04.15 02:36 "Patch for compiling LibTiff", by Gilles Vollant

I'm using Visual C++ 5.0 for Windows 95/NT
For compile in C++ mode (because the rest of my project is C++), I've done 
these modification (in diff -c format), based on LibTiff 3.4 beta 037


*** tif_win32.c	Tue Sep 02 18:54:31 1997
--- m:\tifftst\tif_win32.c	Wed Apr 15 02:28:57 1998
***************
*** 238,245 ****
  int
  _TIFFmemcmp(const tdata_t p1, const tdata_t p2, tsize_t c)
  {
! 	register const BYTE *pb1 = p1;
! 	register const BYTE *pb2 = p2;
  	register DWORD dwTmp = c;
  	register int iTmp;
  	for (iTmp = 0; dwTmp-- && !iTmp; iTmp = (int)*pb1++ - (int)*pb2++)
--- 238,245 ----
  int
  _TIFFmemcmp(const tdata_t p1, const tdata_t p2, tsize_t c)
  {
! 	register const BYTE *pb1 = (const BYTE *)p1;
! 	register const BYTE *pb2 = (const BYTE *)p2;
  	register DWORD dwTmp = c;
  	register int iTmp;
  	for (iTmp = 0; dwTmp-- && !iTmp; iTmp = (int)*pb1++ - (int)*pb2++)
*** tif_open.c	Tue Sep 02 18:54:27 1997
--- m:\tifftst\tif_open.c	Wed Apr 15 02:29:56 1998
***************
*** 119,124 ****
--- 119,128 ----
  	return (m);
  }

+
+ void
+ _TIFFSetDefaultCompressionState(TIFF* tif);
+
  TIFF*
  TIFFClientOpen(
  	const char* name, const char* mode,
*** tif_fax3.c	Tue Sep 02 18:54:25 1997
--- m:\tifftst\tif_fax3.c	Wed Apr 15 02:31:45 1998
***************
*** 84,94 ****
  } Fax3DecodeState;
  #define	DecoderState(tif)	((Fax3DecodeState*) Fax3State(tif))

  typedef struct {
  	Fax3BaseState b;
  	int	data;			/* current i/o byte */
  	int	bit;			/* current i/o bit in byte */
! 	enum { G3_1D, G3_2D } tag;	/* encoding state */
  	u_char*	refline;		/* reference line for 2d decoding */
  	int	k;			/* #rows left that can be 2d encoded */
  	int	maxk;			/* max #rows that can be 2d encoded */
--- 84,95 ----
  } Fax3DecodeState;
  #define	DecoderState(tif)	((Fax3DecodeState*) Fax3State(tif))

+ typedef enum { G3_1D, G3_2D } Ttag;
  typedef struct {
  	Fax3BaseState b;
  	int	data;			/* current i/o byte */
  	int	bit;			/* current i/o bit in byte */
! 	Ttag	tag;			/* encoding state */
  	u_char*	refline;		/* reference line for 2d decoding */
  	int	k;			/* #rows left that can be 2d encoded */
  	int	maxk;			/* max #rows that can be 2d encoded */
***************
*** 1280,1288 ****
  	 * Allocate state block so tag methods have storage to record values.
  	 */
  	if (tif->tif_mode == O_RDONLY)
! 		tif->tif_data = _TIFFmalloc(sizeof (Fax3DecodeState));
  	else
! 		tif->tif_data = _TIFFmalloc(sizeof (Fax3EncodeState));
  	if (tif->tif_data == NULL) {
  		TIFFError("TIFFInitCCITTFax3",
  		    "%s: No space for state block", tif->tif_name);
--- 1281,1289 ----
  	 * Allocate state block so tag methods have storage to record values.
  	 */
  	if (tif->tif_mode == O_RDONLY)
! 		tif->tif_data = (tidata_t)_TIFFmalloc(sizeof (Fax3DecodeState));
  	else
! 		tif->tif_data = (tidata_t)_TIFFmalloc(sizeof (Fax3EncodeState));
  	if (tif->tif_data == NULL) {
  		TIFFError("TIFFInitCCITTFax3",
  		    "%s: No space for state block", tif->tif_name);