diff options
author | Bob Friesenhahn <bfriesen@simple.dallas.tx.us> | 2011-04-02 19:30:20 +0000 |
---|---|---|
committer | Bob Friesenhahn <bfriesen@simple.dallas.tx.us> | 2011-04-02 19:30:20 +0000 |
commit | b69a1998bedfabc32cd541408bffdef05bd01e45 (patch) | |
tree | 7f2efd44c939a9e3744dde55c57a39fe8c2d2604 | |
parent | a9a1d1c65fb5c3ac97b3be8e6e1786c5004035f9 (diff) | |
download | libtiff-git-b69a1998bedfabc32cd541408bffdef05bd01e45.tar.gz |
* 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.
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | libtiff/tif_ojpeg.c | 14 | ||||
-rw-r--r-- | tools/fax2ps.c | 8 |
3 files changed, 24 insertions, 6 deletions
@@ -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 diff --git a/libtiff/tif_ojpeg.c b/libtiff/tif_ojpeg.c index 4ad32979..485ce28b 100644 --- a/libtiff/tif_ojpeg.c +++ b/libtiff/tif_ojpeg.c @@ -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 */ diff --git a/tools/fax2ps.c b/tools/fax2ps.c index 9e6e97ab..b8cdf89f 100644 --- a/tools/fax2ps.c +++ b/tools/fax2ps.c @@ -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) |