From: Eli Zaretskii <eliz@gnu.org>
Date: Mon, 3 Jan 2011 19:32:41 +0000 (+0200)
Subject: Don't use png_jmpbuf, it doesn't work with dynamic loading.
X-Git-Tag: emacs-pretest-23.2.92~10
X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=fb724e553757e9d3344be443ab5f329afc9bf91c;p=emacs.git

Don't use png_jmpbuf, it doesn't work with dynamic loading.

 image.c (png_jmpbuf): Remove definition.
 (my_png_error, png_load): Don't use png_jmpbuf.
---

diff --git a/src/ChangeLog b/src/ChangeLog
index 17952ed10b2..f947b5aeef6 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
+2011-01-03  Eli Zaretskii  <eliz@gnu.org>
+
+	* image.c (png_jmpbuf): Remove definition.
+	(my_png_error, png_load): Don't use png_jmpbuf.
+
 2010-12-31  Eli Zaretskii  <eliz@gnu.org>
 
 	* image.c <Qlibpng_version>: New variable.
diff --git a/src/image.c b/src/image.c
index 070ed32d59b..8dcd2da67d4 100644
--- a/src/image.c
+++ b/src/image.c
@@ -5648,12 +5648,6 @@ init_png_functions (Lisp_Object libraries)
 
 #endif /* HAVE_NTGUI */
 
-/* libpng before 1.4.0 didn't have png_jmpbuf; v1.4.0 and later
-   deprecate direct access to png_ptr fields.  */
-#ifndef png_jmpbuf
-# define png_jmpbuf(PTR)  ((PTR)->jmpbuf)
-#endif
-
 /* Error and warning handlers installed when the PNG library
    is initialized.  */
 
@@ -5666,7 +5660,7 @@ my_png_error (png_ptr, msg)
   /* Avoid compiler warning about deprecated direct access to
      png_ptr's fields in libpng versions 1.4.x.  */
   image_error ("PNG error: %s", build_string (msg), Qnil);
-  longjmp (png_jmpbuf (png_ptr), 1);
+  longjmp (png_ptr->jmpbuf, 1);
 }
 
 
@@ -5842,7 +5836,7 @@ png_load (f, img)
 
   /* Set error jump-back.  We come back here when the PNG library
      detects an error.  */
-  if (setjmp (png_jmpbuf (png_ptr)))
+  if (setjmp (png_ptr->jmpbuf))
     {
     error:
       if (png_ptr)