]> granicus.if.org Git - imagemagick/commitdiff
Make it possible to build with libpng-1.4.x when png_set_longjmp_fn is
authorglennrp <glennrp@git.imagemagick.org>
Sat, 19 Feb 2011 04:56:17 +0000 (04:56 +0000)
committerglennrp <glennrp@git.imagemagick.org>
Sat, 19 Feb 2011 04:56:17 +0000 (04:56 +0000)
not exported.

ChangeLog
coders/png.c

index fe844811d71f55bf3968df23b8f92b2f9416090d..126a3b9715b7f0487a0dc2e04ca1380f69721ace 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2011-02-18  6.6.7-8 Glenn Randers-Pehrson <glennrp@image...>
+  * Use setjmp() instead of png_setjmp() when building with libpng-1.4.x
+    because png_setjmp() references png_set_longjmp_fn() which was not
+    exported by libpng-1.4.x.
+
 2011-02-15  6.6.7-8 Cristy  <quetzlzacatenango@image...>
   * New version 6.6.7-8.
 
index 05f28ca17f03addad2fb8f2915f982ae11412afc..f002d837803b862e68f3920fa766ad728cec81cd 100644 (file)
@@ -91,7 +91,9 @@
 /* #define PNG_USE_RESULT   The result of this function must be checked */
 /* #define PNG_NORETURN     This function does not return */
 /* #define PNG_ALLOCATED    The result of the function is new memory */
-/* #define PNG_DEPSTRUCT    Access to this struct member is deprecated */
+#if (PNG_LIBPNG_VER >= 10400 && PNG_LIBPNG_VER < 10500)
+   #define PNG_DEPSTRUCT  /* Access to this struct member is deprecated */
+#endif
 
 #include "png.h"
 #include "zlib.h"
@@ -1731,7 +1733,12 @@ static Image *ReadOnePNGImage(MngInfo *mng_info,
 
   ping_pixels=(unsigned char *) NULL;
 
+#if (PNG_LIBPNG_VER < 10400 || PNG_LIBPNG_VER >= 10500)
   if (setjmp(png_jmpbuf(ping)))
+#else
+  /* Warning is unavoidable if #define PNG_DEPSTRUCT is not defined */
+  if (setjmp(ping->jmpbuf))
+#endif
     {
       /*
         PNG image is corrupt.
@@ -2392,7 +2399,12 @@ static Image *ReadOnePNGImage(MngInfo *mng_info,
   /*
     Convert PNG pixels to pixel packets.
   */
+#if (PNG_LIBPNG_VER < 10400 || PNG_LIBPNG_VER >= 10500)
   if (setjmp(png_jmpbuf(ping)))
+#else
+  /* Warning is unavoidable if #define PNG_DEPSTRUCT is not defined */
+  if (setjmp(ping->jmpbuf))
+#endif
     {
       /*
         PNG image is corrupt.
@@ -7439,7 +7451,12 @@ static MagickBooleanType WriteOnePNGImage(MngInfo *mng_info,
   png_set_write_fn(ping,image,png_put_data,png_flush_data);
   ping_pixels=(unsigned char *) NULL;
 
+#if (PNG_LIBPNG_VER < 10400 || PNG_LIBPNG_VER >= 10500)
   if (setjmp(png_jmpbuf(ping)))
+#else
+  /* Warning is unavoidable if #define PNG_DEPSTRUCT is not defined */
+  if (setjmp(ping->jmpbuf))
+#endif
     {
       /*
         PNG write failed.
@@ -8732,7 +8749,12 @@ static MagickBooleanType WriteOnePNGImage(MngInfo *mng_info,
   /*
     Initialize image scanlines.
   */
+#if (PNG_LIBPNG_VER < 10400 || PNG_LIBPNG_VER >= 10500)
   if (setjmp(png_jmpbuf(ping)))
+#else
+  /* Warning is unavoidable if #define PNG_DEPSTRUCT is not defined */
+  if (setjmp(ping->jmpbuf))
+#endif
     {
       /*
         PNG write failed.