aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndreas Baumann <abaumann@yahoo.com>2014-06-20 13:11:14 +0200
committerAndreas Baumann <abaumann@yahoo.com>2014-06-20 13:11:14 +0200
commit1170e23e38b8bf619928d30fd107d8753e71989f (patch)
treec0b87698ff8e03837cb7f26808289c4521c223f9 /src
parentac61822e72b401a37b26e77b2c2b716e21ba46b7 (diff)
downloadmirror-meh-1170e23e38b8bf619928d30fd107d8753e71989f.tar.gz
mirror-meh-1170e23e38b8bf619928d30fd107d8753e71989f.tar.bz2
mirror-meh-1170e23e38b8bf619928d30fd107d8753e71989f.zip
fixed for API change in DGifCloseFile (giflib 5.1)
Diffstat (limited to 'src')
-rw-r--r--src/gif.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/gif.c b/src/gif.c
index fe4c090..9d492c2 100644
--- a/src/gif.c
+++ b/src/gif.c
@@ -96,7 +96,24 @@ error:
void gif_close(struct image *img){
struct gif_t *g = (struct gif_t *)img;
+#if defined(GIFLIB_MAJOR) && defined(GIFLIB_MINOR) && (GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1)
+ int ret;
+#endif
+
+#if defined(GIFLIB_MAJOR) && defined(GIFLIB_MINOR) && (GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1)
+ DGifCloseFile(g->gif,&ret);
+ if(ret != GIF_OK) {
+#if defined(GIFLIB_MAJOR) && GIFLIB_MAJOR >= 5
+ fprintf(stderr, "GIFLIB: %s\n", GifErrorString(ret));
+#elif defined(GIFLIB_MAJOR) && defined(GIFLIB_MINOR) && ((GIFLIB_MAJOR == 4 && GIFLIB_MINOR >= 2) || GIFLIB_MAJOR > 4)
+ fprintf(stderr, "GIFLIB: %s\n", GifErrorString());
+#else
+ PrintGifError();
+#endif
+ }
+#else
DGifCloseFile(g->gif);
+#endif
fclose(g->f);
}