From 1170e23e38b8bf619928d30fd107d8753e71989f Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Fri, 20 Jun 2014 13:11:14 +0200 Subject: fixed for API change in DGifCloseFile (giflib 5.1) --- src/gif.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/gif.c') 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); } -- cgit v1.2.3