Fixed bug 1179 (IMG_jpg.c doesn't build with the new libjpeg)
authorSam Lantinga <slouken@libsdl.org>
Thu, 07 Apr 2011 07:50:52 -0700
changeset 273b1c1ec3a8d49
parent 272 37155fd3dc13
child 274 f9ae0edd7bfa
Fixed bug 1179 (IMG_jpg.c doesn't build with the new libjpeg)

fcoelho_9@hotmail.com 2011-04-07 07:24:58 PDT

libjpeg 8 has a different naming scheme for booleans:

boolean -> JPEG_boolean
FALSE -> JPEG_FALSE
TRUE -> JPEG_TRUE

I'm building SDL_image with MinGW, attached is a small change I've made to
IMG_jpg.c to be able to compile it.
IMG_jpg.c
     1.1 --- a/IMG_jpg.c	Mon Mar 28 10:11:00 2011 -0700
     1.2 +++ b/IMG_jpg.c	Thu Apr 07 07:50:52 2011 -0700
     1.3 @@ -34,6 +34,12 @@
     1.4  
     1.5  #include <jpeglib.h>
     1.6  
     1.7 +#if JPEG_LIB_VERSION >= 80
     1.8 +	typedef JPEG_boolean boolean;
     1.9 +	#define TRUE JPEG_TRUE
    1.10 +	#define FALSE JPEG_FALSE
    1.11 +#endif
    1.12 +
    1.13  /* Define this for fast loading and not as good image quality */
    1.14  /*#define FAST_JPEG*/
    1.15