Mercurial > hg > release > icedtea6-1.9
view patches/libpng-1.5.patch @ 2357:7451a7b2b43e icedtea6-1.9.10
Support buildnig against libpng 1.5.
2011-10-13 Andrew John Hughes <ahughes@redhat.com>
* Makefile.am: Add new patch.
* patches/libpng-1.5.patch:
Support building against libpng 1.5.
author | Andrew John Hughes <ahughes@redhat.com> |
---|---|
date | Wed, 19 Oct 2011 01:20:54 +0100 |
parents | |
children |
line wrap: on
line source
diff -r b139627f7bc3 src/share/native/sun/awt/splashscreen/splashscreen_png.c --- openjdk/jdk/src/share/native/sun/awt/splashscreen/splashscreen_png.c Mon Nov 22 09:43:58 2010 +0800 +++ openjdk/jdk/src/share/native/sun/awt/splashscreen/splashscreen_png.c Tue Oct 18 13:55:10 2011 +0100 @@ -31,12 +31,22 @@ #define SIG_BYTES 8 +#if (PNG_LIBPNG_VER < 10500) +#define GET_IO_PTR(png_ptr) png_ptr->io_ptr +#define JMPBUF(png_ptr) png_ptr->jmpbuf +#define SET_READ_FN(png_ptr,iop,read_func) png_ptr->io_ptr = iop; png_ptr->read_data_fn = read_func; +#else +#define GET_IO_PTR(png_ptr) png_get_io_ptr(png_ptr) +#define JMPBUF(png_ptr) png_jmpbuf(png_ptr) +#define SET_READ_FN(png_ptr,iop,read_func) png_set_read_fn(png_ptr,iop,read_func); +#endif + void PNGAPI my_png_read_stream(png_structp png_ptr, png_bytep data, png_size_t length) { png_uint_32 check; - SplashStream * stream = (SplashStream*)png_ptr->io_ptr; + SplashStream * stream = (SplashStream*)GET_IO_PTR(png_ptr); check = stream->read(stream, data, length); if (check != length) png_error(png_ptr, "Read Error"); @@ -71,12 +81,11 @@ goto done; } - if (setjmp(png_ptr->jmpbuf)) { + if (setjmp(JMPBUF(png_ptr))) { goto done; } - png_ptr->io_ptr = io_ptr; - png_ptr->read_data_fn = read_func; + SET_READ_FN(png_ptr, io_ptr, read_func) png_set_sig_bytes(png_ptr, SIG_BYTES); /* we already read the 8 signature bytes */