Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 12 Nov 2015 15:41:21 +0000 (UTC)
From:      Antoine Brodin <antoine@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r401360 - head/graphics/mtpaint/files
Message-ID:  <201511121541.tACFfLML073880@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: antoine
Date: Thu Nov 12 15:41:21 2015
New Revision: 401360
URL: https://svnweb.freebsd.org/changeset/ports/401360

Log:
  Allow building with giflib 5.1
  
  PR:		204492

Modified:
  head/graphics/mtpaint/files/patch-src_png.c

Modified: head/graphics/mtpaint/files/patch-src_png.c
==============================================================================
--- head/graphics/mtpaint/files/patch-src_png.c	Thu Nov 12 15:37:31 2015	(r401359)
+++ head/graphics/mtpaint/files/patch-src_png.c	Thu Nov 12 15:41:21 2015	(r401360)
@@ -12,7 +12,19 @@
  
  	/* Init state structure */
  	memset(&stat, 0, sizeof(stat));
-@@ -1621,7 +1625,11 @@ static int load_gif(char *file_name, ls_
+@@ -1608,7 +1612,11 @@ static int load_gif_frames(char *file_na
+ 	}
+ 	res = 1;
+ fail:	mem_free_chanlist(w_set.img);
++#if GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1 || GIFLIB_MAJOR > 5
++	DGifCloseFile(giffy, NULL);
++#else
+ 	DGifCloseFile(giffy);
++#endif
+ 	return (res);
+ }
+ 
+@@ -1621,7 +1629,11 @@ static int load_gif(char *file_name, ls_
  	int delay = settings->gif_delay, trans = -1;//, disposal = 0;
  
  
@@ -24,7 +36,19 @@
  
  	/* Get global palette */
  	settings->colors = convert_gif_palette(settings->pal, giffy->SColorMap);
-@@ -1682,10 +1690,18 @@ static int save_gif(char *file_name, ls_
+@@ -1659,7 +1671,11 @@ static int load_gif(char *file_name, ls_
+ 		}
+ 	}
+ 	res = 1;
++#if GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1 || GIFLIB_MAJOR > 5
++fail:	DGifCloseFile(giffy, NULL);
++#else
+ fail:	DGifCloseFile(giffy);
++#endif
+ 	return (res);
+ }
+ 
+@@ -1682,10 +1698,18 @@ static int save_gif(char *file_name, ls_
  	nc |= nc >> 1; nc |= nc >> 2; nc |= nc >> 4;
  	nc += !nc + 1; // No less than 2 colors
  
@@ -43,7 +67,18 @@
  	if (!giffy) goto fail0;
  
  	for (i = 0; i < settings->colors; i++)
-@@ -1732,7 +1748,11 @@ fail:	EGifCloseFile(giffy);
+@@ -1725,14 +1749,22 @@ static int save_gif(char *file_name, ls_
+ 	if (!settings->silent) progress_end();
+ 	msg = 0;
+ 
++#if GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1 || GIFLIB_MAJOR > 5
++fail:	EGifCloseFile(giffy, NULL);
++#else
+ fail:	EGifCloseFile(giffy);
++#endif
+ #ifndef WIN32
+ 	/* giflib creates files with 0600 permissions, which is nasty - WJ */
+ 	mode = umask(0022);
  	umask(mode);
  	chmod(file_name, 0666 & ~mode);
  #endif



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201511121541.tACFfLML073880>