diff options
author | Antoine Brodin <antoine@FreeBSD.org> | 2014-12-27 07:37:59 +0000 |
---|---|---|
committer | Antoine Brodin <antoine@FreeBSD.org> | 2014-12-27 07:37:59 +0000 |
commit | 2fde21514776e78513d45198b070f4bc5af24105 (patch) | |
tree | 1ec22205c530d284e503b67caf23a6e842e454fd /graphics/swftools | |
parent | fb1102537ce1fcb9e1862a44fc7f92721b831f7c (diff) | |
download | ports-2fde21514776e78513d45198b070f4bc5af24105.tar.gz ports-2fde21514776e78513d45198b070f4bc5af24105.zip |
Allow building with either giflib 4.2 or 5.0
Notes
Notes:
svn path=/head/; revision=375672
Diffstat (limited to 'graphics/swftools')
-rw-r--r-- | graphics/swftools/files/patch-gif2swf.c | 51 |
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 |