aboutsummaryrefslogtreecommitdiffstats
path: root/graphics
diff options
context:
space:
mode:
authorantoine <antoine@FreeBSD.org>2014-12-27 15:37:59 +0800
committerantoine <antoine@FreeBSD.org>2014-12-27 15:37:59 +0800
commita415deb530337518694d1985638878da553c567e (patch)
tree1ec22205c530d284e503b67caf23a6e842e454fd /graphics
parentc4e2500aa822fc3507abbc1c68229bad1c834199 (diff)
downloadfreebsd-ports-gnome-a415deb530337518694d1985638878da553c567e.tar.gz
freebsd-ports-gnome-a415deb530337518694d1985638878da553c567e.tar.zst
freebsd-ports-gnome-a415deb530337518694d1985638878da553c567e.zip
Allow building with either giflib 4.2 or 5.0
Diffstat (limited to 'graphics')
-rw-r--r--graphics/swftools/files/patch-gif2swf.c51
1 files changed, 45 insertions, 6 deletions
diff --git a/graphics/swftools/files/patch-gif2swf.c b/graphics/swftools/files/patch-gif2swf.c
index 742c03f55bdb..812b0a87fc2f 100644
--- a/graphics/swftools/files/patch-gif2swf.c
+++ b/graphics/swftools/files/patch-gif2swf.c
@@ -1,37 +1,76 @@
---- src/gif2swf.c.orig 2011-01-02 04:30:29.000000000 +0100
-+++ src/gif2swf.c 2012-06-03 06:43:44.000000000 +0200
-@@ -65,6 +65,16 @@
+--- src/gif2swf.c.orig 2011-01-02 03:30:29 UTC
++++ src/gif2swf.c
+@@ -65,6 +65,25 @@ enum disposal_method {
RESTORE_TO_PREVIOUS
};
+static void
++#if GIFLIB_MAJOR >= 5
++localPrintGifError(int ErrorCode)
++#else
+localPrintGifError(void)
++#endif
+{
++#if GIFLIB_MAJOR >= 5
++ char *Err = GifErrorString(ErrorCode);
++#else
+ char *Err = GifErrorString();
++ int ErrorCode = GifError();
++#endif
+
+ if (Err != NULL)
+ fprintf(stderr, "\nGIF-LIB error: %s.\n", Err);
+ else
-+ fprintf(stderr, "\nGIF-LIB undefined error %d.\n", GifError());
++ fprintf(stderr, "\nGIF-LIB undefined error %d.\n", ErrorCode);
+}
void SetFrameAction(TAG ** t, const char *src, int ver)
{
-@@ -236,7 +246,7 @@
+@@ -230,13 +249,21 @@ TAG *MovieAddFrame(SWF * swf, TAG * t, c
+ }
+ fclose(fi);
+
++#if GIFLIB_MAJOR >= 5
++ if ((gft = DGifOpenFileName(sname, NULL)) == NULL) {
++#else
+ if ((gft = DGifOpenFileName(sname)) == NULL) {
++#endif
+ fprintf(stderr, "%s is not a GIF file!\n", sname);
+ return t;
}
if (DGifSlurp(gft) != GIF_OK) {
- PrintGifError();
++#if GIFLIB_MAJOR >= 5
++ localPrintGifError(gft->Error);
++#else
+ localPrintGifError();
++#endif
return t;
}
-@@ -499,7 +509,7 @@
+@@ -488,7 +515,11 @@ int CheckInputFile(char *fname, char **r
+ }
+ fclose(fi);
+
++#if GIFLIB_MAJOR >= 5
++ if ((gft = DGifOpenFileName(s, NULL)) == NULL) {
++#else
+ if ((gft = DGifOpenFileName(s)) == NULL) {
++#endif
+ fprintf(stderr, "%s is not a GIF file!\n", fname);
+ return -1;
+ }
+@@ -499,7 +530,11 @@ int CheckInputFile(char *fname, char **r
global.max_image_height = gft->SHeight;
if (DGifSlurp(gft) != GIF_OK) {
- PrintGifError();
++#if GIFLIB_MAJOR >= 5
++ localPrintGifError(gft->Error);
++#else
+ localPrintGifError();
++#endif
return -1;
}
// After DGifSlurp() call, gft->ImageCount become available