[nogravity] Change libpng-1.5 patch to also work with libpng-1.2

Hans de Goede jwrdegoede at fedoraproject.org
Tue Dec 6 15:36:25 UTC 2011


commit 7679a2bcf27a4a9f471e8ab26a827d3beacc068f
Author: Hans de Goede <hdegoede at redhat.com>
Date:   Tue Dec 6 16:36:52 2011 +0100

    Change libpng-1.5 patch to also work with libpng-1.2

 nogravity-2.00-libpng15.patch |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)
---
diff --git a/nogravity-2.00-libpng15.patch b/nogravity-2.00-libpng15.patch
index 542cba6..b9e395e 100644
--- a/nogravity-2.00-libpng15.patch
+++ b/nogravity-2.00-libpng15.patch
@@ -10,21 +10,27 @@ diff -up nogravity-2.00/rlx32/src/gx_png.c~ nogravity-2.00/rlx32/src/gx_png.c
  
  	if (check != length)
  	{
-@@ -77,7 +77,7 @@ static void pngx_error(png_structp png_p
+@@ -77,7 +77,11 @@ static void pngx_error(png_structp png_p
  #ifdef _DEBUG
  	SYS_Msg("!%s", message);
  #endif
--	longjmp(png_ptr->jmpbuf, 1);
++#ifndef LIBPNG_VERSION_12
 +	png_longjmp(png_ptr, 1);
++#else
+ 	longjmp(png_ptr->jmpbuf, 1);
++#endif
  }
  
  static void pngx_warning(png_structp png_ptr, png_const_charp message)
-@@ -121,7 +121,7 @@ if (!pClut)
+@@ -125,7 +125,11 @@ if (!pClut)
  	info_ptr = png_create_info_struct(png_ptr);
  	png_read_info(png_ptr, info_ptr);  /* read all PNG info up to image data */
  
--	if (setjmp(png_ptr->jmpbuf))
++#ifndef LIBPNG_VERSION_12
 +	if (setjmp(png_jmpbuf(png_ptr)))
++#else
+ 	if (setjmp(png_ptr->jmpbuf))
++#endif
  	{
  		png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
  		return NULL;


More information about the scm-commits mailing list