svn commit: r375642 - head/graphics/mtpaint/files
Antoine Brodin
antoine at FreeBSD.org
Fri Dec 26 17:42:08 UTC 2014
Author: antoine
Date: Fri Dec 26 17:42:07 2014
New Revision: 375642
URL: https://svnweb.freebsd.org/changeset/ports/375642
QAT: https://qat.redports.org/buildarchive/r375642/
Log:
Allow building with either giflib 4.2 or 5.0
Added:
head/graphics/mtpaint/files/patch-src_png.c (contents, props changed)
Added: head/graphics/mtpaint/files/patch-src_png.c
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/graphics/mtpaint/files/patch-src_png.c Fri Dec 26 17:42:07 2014 (r375642)
@@ -0,0 +1,57 @@
+--- src/png.c.orig 2011-10-27 20:56:24 UTC
++++ src/png.c
+@@ -1510,7 +1510,11 @@ static int load_gif_frames(char *file_na
+ int res, val, disposal, bpp, cmask, lastzero = FALSE;
+
+
++#if GIFLIB_MAJOR >= 5
++ if (!(giffy = DGifOpenFileName(file_name, NULL))) return (-1);
++#else
+ if (!(giffy = DGifOpenFileName(file_name))) return (-1);
++#endif
+
+ /* Init state structure */
+ memset(&stat, 0, sizeof(stat));
+@@ -1621,7 +1625,11 @@ static int load_gif(char *file_name, ls_
+ int delay = settings->gif_delay, trans = -1;//, disposal = 0;
+
+
++#if GIFLIB_MAJOR >= 5
++ if (!(giffy = DGifOpenFileName(file_name, NULL))) return (-1);
++#else
+ if (!(giffy = DGifOpenFileName(file_name))) return (-1);
++#endif
+
+ /* Get global palette */
+ settings->colors = convert_gif_palette(settings->pal, giffy->SColorMap);
+@@ -1682,10 +1690,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
+
++#if GIFLIB_MAJOR >= 5
++ gif_map = GifMakeMapObject(nc, NULL);
++#else
+ gif_map = MakeMapObject(nc, NULL);
++#endif
+ if (!gif_map) return -1;
+
++#if GIFLIB_MAJOR >= 5
++ giffy = EGifOpenFileName(file_name, FALSE, NULL);
++#else
+ giffy = EGifOpenFileName(file_name, FALSE);
++#endif
+ if (!giffy) goto fail0;
+
+ for (i = 0; i < settings->colors; i++)
+@@ -1732,7 +1748,11 @@ fail: EGifCloseFile(giffy);
+ umask(mode);
+ chmod(file_name, 0666 & ~mode);
+ #endif
++#if GIFLIB_MAJOR >= 5
++fail0: GifFreeMapObject(gif_map);
++#else
+ fail0: FreeMapObject(gif_map);
++#endif
+
+ return (msg);
+ }
More information about the svn-ports-all
mailing list