summaryrefslogtreecommitdiff
path: root/graphics/SDL_image
diff options
context:
space:
mode:
authordrochner <drochner@pkgsrc.org>2011-01-19 21:24:10 +0000
committerdrochner <drochner@pkgsrc.org>2011-01-19 21:24:10 +0000
commitf972a864ebe16e4527fd9d17b5ed9e86e6a0c36b (patch)
tree15f06b0e20729e2d4a2fc3c54786ff04a46fa266 /graphics/SDL_image
parent19197c708222b0d9dea323ce6b9e7be7a054b4f9 (diff)
downloadpkgsrc-f972a864ebe16e4527fd9d17b5ed9e86e6a0c36b.tar.gz
fix for png-1.5. The new API (in particular the macro for png_jmpbuf)
does really suck here.
Diffstat (limited to 'graphics/SDL_image')
-rw-r--r--graphics/SDL_image/distinfo4
-rw-r--r--graphics/SDL_image/patches/patch-aa42
2 files changed, 34 insertions, 12 deletions
diff --git a/graphics/SDL_image/distinfo b/graphics/SDL_image/distinfo
index e3c97d2e2f9..2719bda4307 100644
--- a/graphics/SDL_image/distinfo
+++ b/graphics/SDL_image/distinfo
@@ -1,6 +1,6 @@
-$NetBSD: distinfo,v 1.12 2011/01/16 12:51:24 wiz Exp $
+$NetBSD: distinfo,v 1.13 2011/01/19 21:24:10 drochner Exp $
SHA1 (SDL_image-1.2.10.tar.gz) = 6bae71fdfd795c3dbf39f6c7c0cf8b212914ef97
RMD160 (SDL_image-1.2.10.tar.gz) = 8133f7f8d488b1c3f69ad80a941289b4508d2901
Size (SDL_image-1.2.10.tar.gz) = 1332906 bytes
-SHA1 (patch-aa) = f11c0cb93c5d6c0a1ca6257b9b2bfb7d1640ff35
+SHA1 (patch-aa) = 378ca2cbf9975fcf3e1d0cee7045e352efa56b57
diff --git a/graphics/SDL_image/patches/patch-aa b/graphics/SDL_image/patches/patch-aa
index 067a39ce0c9..46b0f48fd9e 100644
--- a/graphics/SDL_image/patches/patch-aa
+++ b/graphics/SDL_image/patches/patch-aa
@@ -1,4 +1,4 @@
-$NetBSD: patch-aa,v 1.3 2011/01/16 12:51:24 wiz Exp $
+$NetBSD: patch-aa,v 1.4 2011/01/19 21:24:10 drochner Exp $
Fix build with png-1.5.
@@ -13,7 +13,15 @@ Fix build with png-1.5.
png_uint_32 (*png_get_tRNS) (png_structp png_ptr, png_infop info_ptr, png_bytep *trans, int *num_trans, png_color_16p *trans_values);
png_uint_32 (*png_get_valid) (png_structp png_ptr, png_infop info_ptr, png_uint_32 flag);
void (*png_read_image) (png_structp png_ptr, png_bytepp image);
-@@ -129,6 +131,13 @@ int IMG_InitPNG()
+@@ -91,6 +93,7 @@ static struct {
+ void (*png_set_read_fn) (png_structp png_ptr, png_voidp io_ptr, png_rw_ptr read_data_fn);
+ void (*png_set_strip_16) (png_structp png_ptr);
+ int (*png_sig_cmp) (png_bytep sig, png_size_t start, png_size_t num_to_check);
++ jmp_buf* (*png_set_longjmp_fn) (png_structp, png_longjmp_ptr, size_t);
+ } lib;
+
+ #ifdef LOAD_PNG_DYNAMIC
+@@ -129,6 +132,13 @@ int IMG_InitPNG()
SDL_UnloadObject(lib.handle);
return -1;
}
@@ -27,7 +35,7 @@ Fix build with png-1.5.
lib.png_get_io_ptr =
(png_voidp (*) (png_structp))
SDL_LoadFunction(lib.handle, "png_get_io_ptr");
-@@ -136,6 +145,13 @@ int IMG_InitPNG()
+@@ -136,6 +146,13 @@ int IMG_InitPNG()
SDL_UnloadObject(lib.handle);
return -1;
}
@@ -41,7 +49,21 @@ Fix build with png-1.5.
lib.png_get_tRNS =
(png_uint_32 (*) (png_structp, png_infop, png_bytep *, int *, png_color_16p *))
SDL_LoadFunction(lib.handle, "png_get_tRNS");
-@@ -236,7 +252,9 @@ int IMG_InitPNG()
+@@ -213,6 +230,13 @@ int IMG_InitPNG()
+ SDL_UnloadObject(lib.handle);
+ return -1;
+ }
++ lib.png_set_longjmp_fn =
++ (jmp_buf * (*) (png_structp, png_longjmp_ptr, size_t))
++ SDL_LoadFunction(lib.handle, "png_set_longjmp_fn");
++ if ( lib.png_set_longjmp_fn == NULL ) {
++ SDL_UnloadObject(lib.handle);
++ return -1;
++ }
+ }
+ ++lib.loaded;
+
+@@ -236,7 +260,9 @@ int IMG_InitPNG()
lib.png_create_read_struct = png_create_read_struct;
lib.png_destroy_read_struct = png_destroy_read_struct;
lib.png_get_IHDR = png_get_IHDR;
@@ -51,16 +73,16 @@ Fix build with png-1.5.
lib.png_get_tRNS = png_get_tRNS;
lib.png_get_valid = png_get_valid;
lib.png_read_image = png_read_image;
-@@ -347,7 +365,7 @@ SDL_Surface *IMG_LoadPNG_RW(SDL_RWops *s
+@@ -347,7 +373,7 @@ SDL_Surface *IMG_LoadPNG_RW(SDL_RWops *s
* the normal method of doing things with libpng). REQUIRED unless you
* set up your own error handlers in png_create_read_struct() earlier.
*/
- if ( setjmp(png_ptr->jmpbuf) ) {
-+ if ( setjmp(png_jmpbuf(png_ptr)) ) {
++ if ( setjmp(*lib.png_set_longjmp_fn(png_ptr, longjmp, sizeof (jmp_buf)))) {
error = "Error reading the PNG file.";
goto done;
}
-@@ -416,9 +434,9 @@ SDL_Surface *IMG_LoadPNG_RW(SDL_RWops *s
+@@ -416,9 +442,9 @@ SDL_Surface *IMG_LoadPNG_RW(SDL_RWops *s
Rmask = 0x000000FF;
Gmask = 0x0000FF00;
Bmask = 0x00FF0000;
@@ -72,7 +94,7 @@ Fix build with png-1.5.
Rmask = 0xFF000000 >> s;
Gmask = 0x00FF0000 >> s;
Bmask = 0x0000FF00 >> s;
-@@ -426,7 +444,7 @@ SDL_Surface *IMG_LoadPNG_RW(SDL_RWops *s
+@@ -426,7 +452,7 @@ SDL_Surface *IMG_LoadPNG_RW(SDL_RWops *s
}
}
surface = SDL_AllocSurface(SDL_SWSURFACE, width, height,
@@ -81,7 +103,7 @@ Fix build with png-1.5.
if ( surface == NULL ) {
error = "Out of memory";
goto done;
-@@ -467,6 +485,9 @@ SDL_Surface *IMG_LoadPNG_RW(SDL_RWops *s
+@@ -467,6 +493,9 @@ SDL_Surface *IMG_LoadPNG_RW(SDL_RWops *s
/* Load the palette, if any */
palette = surface->format->palette;
if ( palette ) {
@@ -91,7 +113,7 @@ Fix build with png-1.5.
if(color_type == PNG_COLOR_TYPE_GRAY) {
palette->ncolors = 256;
for(i = 0; i < 256; i++) {
-@@ -474,12 +495,12 @@ SDL_Surface *IMG_LoadPNG_RW(SDL_RWops *s
+@@ -474,12 +503,12 @@ SDL_Surface *IMG_LoadPNG_RW(SDL_RWops *s
palette->colors[i].g = i;
palette->colors[i].b = i;
}