* libtiff/tif_ojpeg.c: Fixes to compile with MinGW32 GCC.

* tools/fax2ps.c (main): Use tmpfile() rather than mkstemp() since
it is much more portable.  Tmpfile is included in ISO/IEC
9899:1990 and the WIN32 CRT.
This commit is contained in:
Bob Friesenhahn 2011-04-02 19:30:20 +00:00
parent a9a1d1c65f
commit b69a1998be
3 changed files with 24 additions and 6 deletions

View File

@ -1,3 +1,11 @@
2011-04-02 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
* libtiff/tif_ojpeg.c: Fixes to compile with MinGW32 GCC.
* tools/fax2ps.c (main): Use tmpfile() rather than mkstemp() since
it is much more portable. Tmpfile is included in ISO/IEC
9899:1990 and the WIN32 CRT.
2011-03-26 Frank Warmerdam <warmerdam@pobox.com>
* tools/tiffset.c: add -d and -sd switches to allow operation on

View File

@ -1,4 +1,4 @@
/* $Id: tif_ojpeg.c,v 1.52 2011-02-18 22:54:48 fwarmerdam Exp $ */
/* $Id: tif_ojpeg.c,v 1.53 2011-04-02 19:30:20 bfriesen Exp $ */
/* WARNING: The type of JPEG encapsulation defined by the TIFF Version 6.0
specification is now totally obsolete and deprecated for new applications and
@ -120,6 +120,8 @@
session.
*/
#define WIN32_LEAN_AND_MEAN
#define VC_EXTRALEAN
#include "tiffiop.h"
#ifdef OJPEG_SUPPORT
@ -194,6 +196,16 @@ static const TIFFField ojpegFields[] = {
#undef FAR
#endif
/*
Libjpeg's jmorecfg.h defines INT16 and INT32, but only if XMD_H is
not defined. Unfortunately, the MinGW and Borland compilers include
a typedef for INT32, which causes a conflict. MSVC does not include
a conficting typedef given the headers which are included.
*/
#if defined(__BORLANDC__) || defined(__MINGW32__)
# define XMD_H 1
#endif
/* Define "boolean" as unsigned char, not int, per Windows custom. */
#if defined(__WIN32__) && !defined(__MINGW32__)
# ifndef __RPCNDR_H__ /* don't conflict if rpcndr.h already read */

View File

@ -1,4 +1,4 @@
/* $Id: fax2ps.c,v 1.26 2010-12-14 03:16:45 faxguy Exp $" */
/* $Id: fax2ps.c,v 1.27 2011-04-02 19:30:20 bfriesen Exp $" */
/*
* Copyright (c) 1991-1997 Sam Leffler
@ -381,12 +381,10 @@ main(int argc, char** argv)
int n;
FILE* fd;
char buf[16*1024];
char temp[1024];
strcpy(temp, "/tmp/fax2psXXXXXX");
fd = fdopen(mkstemp(temp), "w+");
fd = tmpfile();
if (fd == NULL) {
fprintf(stderr, "Could not create temp file \"%s\"\n", temp);
fprintf(stderr, "Could not obtain temporary file.\n");
exit(-2);
}
#if defined(HAVE_SETMODE) && defined(O_BINARY)