aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJohn Hawthorn <john.hawthorn@gmail.com>2014-06-20 10:25:57 -0700
committerJohn Hawthorn <john.hawthorn@gmail.com>2014-06-20 10:25:57 -0700
commit1c0b8ffa1778e0274b660d657a6112676c421f66 (patch)
treec0b87698ff8e03837cb7f26808289c4521c223f9 /src
parentac61822e72b401a37b26e77b2c2b716e21ba46b7 (diff)
parent1170e23e38b8bf619928d30fd107d8753e71989f (diff)
downloadmirror-meh-1c0b8ffa1778e0274b660d657a6112676c421f66.tar.gz
mirror-meh-1c0b8ffa1778e0274b660d657a6112676c421f66.tar.bz2
mirror-meh-1c0b8ffa1778e0274b660d657a6112676c421f66.zip
Merge pull request #10 from andreasbaumann/master
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);
}