Commits

Anonymous committed 4d1dbb2

- we only need HAVE_BOOLEAN under mingw with libjpeg (patches required in libjpeg, see our wiki)

Comments (0)

Files changed (1)

 /*
  * gd_jpeg.c: Read and write JPEG (JFIF) format image files using the
  * gd graphics library (http://www.libgd.org).
- * 
+ *
  * This software is based in part on the work of the Independent JPEG
  * Group.  For more information on the IJG JPEG software (and JPEG
  * documentation, etc.), see ftp://ftp.uu.net/graphics/jpeg/.
  * major CGI brain damage
  *
  * 2.0.10: more efficient gdImageCreateFromJpegCtx, thanks to
- * Christian Aberger 
+ * Christian Aberger
  */
 
+
 #ifdef HAVE_CONFIG_H
 #	include "config.h"
 #endif
 #ifdef HAVE_LIBJPEG
 #include "gdhelpers.h"
 
-/*
-  Libjpeg's jmorecfg.h defines INT16 and INT32, but only if XMD_H is
-  not defined. 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
-
-/*
-  Another possible conflict under MinGW
- */
-#if defined(WIN32) && defined(__MINGW32__)
-# ifndef __RPCNDR_H__            /* don't conflict if rpcndr.h already read */
-   typedef unsigned char boolean;
-# endif
-# define HAVE_BOOLEAN            /* prevent jmorecfg.h from redefining it */
-#endif
-
+# define HAVE_BOOLEAN
 
 /* JCE undef two symbols that we don't need anymore but which are
    may be defined in config.h from ./configure but which are
 			}
 		}
 	}
-		
+
 	jpeg_finish_compress(&cinfo);
 	jpeg_destroy_compress(&cinfo);
 	gdFree(row);
 
 static int CMYKToRGB(int c, int m, int y, int k, int inverted);
 
-/* 
+/*
  * Create a gd-format image from the JPEG-format INFILE.  Returns the
  * image, or NULL upon error.
  */
 #ifdef JPEG_DEBUG
 	printf("gd-jpeg: gd JPEG version %s\n", GD_JPEG_VERSION);
 	printf("gd-jpeg: JPEG library version %d, %d-bit sample values\n", JPEG_LIB_VERSION, BITS_IN_JSAMPLE);
+	printf("sizeof: %d\n", sizeof(struct jpeg_decompress_struct));
 #endif
 
 	memset(&cinfo, 0, sizeof(cinfo));
 	 * latest libjpeg, replaced by something else. Unfortunately
 	 * there is still no right way to find out if the file was
 	 * progressive or not; just declare your intent before you
-	 * write one by calling gdImageInterlace(im, 1) yourself. 
+	 * write one by calling gdImageInterlace(im, 1) yourself.
 	 * After all, we're not really supposed to rework JPEGs and
 	 * write them out again anyway. Lossy compression, remember? */
 #if 0
 		fprintf(stderr, "gd-jpeg: warning: jpeg_finish_decompress"
 		" reports suspended data source\n");
 	}
-	/* TBB 2.0.29: we should do our best to read whatever we can read, and a 
+	/* TBB 2.0.29: we should do our best to read whatever we can read, and a
 	 * warning is a warning. A fatal error on warnings doesn't make sense. */
 #if 0
   /* This was originally added by Truxton Fulton */
 {
 	my_src_ptr src = (my_src_ptr)cinfo->src;
 	/* 2.0.12: signed size. Thanks to Geert Jansen */
-	/* 2.0.14: some platforms (mingw-msys) don't have ssize_t. Call 
+	/* 2.0.14: some platforms (mingw-msys) don't have ssize_t. Call
 	 * an int an int.
 	 */
 	int nbytes = 0;
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.