summaryrefslogtreecommitdiff
path: root/x11/fox/patches/patch-ab
blob: f20fbbcce99c147af725a6e2c0c21ca09aeac2ae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
$NetBSD: patch-ab,v 1.7 2011/01/29 16:55:13 wiz Exp $

Fix build with png-1.5.
Fed back upstream, will be included in 1.6.42.

--- src/fxpngio.cpp.orig	2006-01-22 17:58:54.000000000 +0000
+++ src/fxpngio.cpp
@@ -75,7 +75,11 @@ static void user_flush_fn(png_structp ){
 static void user_error_fn(png_structp png_ptr,png_const_charp){
   FXStream* store=(FXStream*)png_get_error_ptr(png_ptr);
   store->setError(FXStreamFormat);                      // Flag this as a format error in FXStream
+#if (PNG_LIBPNG_VER < 10500)
   longjmp(png_ptr->jmpbuf,1);                           // Bail out
+#else
+  png_longjmp(png_ptr,1);                               // Bail out
+#endif
   }
 
 
@@ -118,7 +122,7 @@ bool fxloadPNG(FXStream& store,FXColor*&
     }
 
   // Set error handling
-  if(setjmp(png_ptr->jmpbuf)){
+  if(setjmp(png_jmpbuf(png_ptr))){
 
     // Free all of the memory associated with the png_ptr and info_ptr
     png_destroy_read_struct(&png_ptr,&info_ptr,(png_infopp)NULL);
@@ -231,7 +235,7 @@ bool fxsavePNG(FXStream& store,const FXC
     }
 
   // Set error handling.
-  if(setjmp(png_ptr->jmpbuf)){
+  if(setjmp(png_jmpbuf(png_ptr))){
     png_destroy_write_struct(&png_ptr,&info_ptr);
     return false;
     }