From efc88db20d41cc0f35b8cf20c78f780536091e6a Mon Sep 17 00:00:00 2001 From: Yoshihiro Yamazaki Date: Mon, 29 Dec 2014 03:12:46 +0900 Subject: [PATCH] gitlib4 upper compatibility. --- src/swf_gif.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/swf_gif.c b/src/swf_gif.c index 1836dc4..630b056 100644 --- a/src/swf_gif.c +++ b/src/swf_gif.c @@ -143,7 +143,11 @@ gifconv_gif2lossless(unsigned char *gif_data, unsigned long gif_data_len, } if (DGifSlurp(GifFile) == GIF_ERROR) { fprintf(stderr, "gifconv_gif2lossless: DGifSlurp failed\n"); +#if GIFLIB_MAJOR >= 5 DGifCloseFile(GifFile, NULL); +#else + DGifCloseFile(GifFile); +#endif return NULL; } Image = GifFile->SavedImages[0]; @@ -156,7 +160,11 @@ gifconv_gif2lossless(unsigned char *gif_data, unsigned long gif_data_len, bpp = ColorMap->BitsPerPixel; if (bpp > 8) { fprintf(stderr, "gifconv_gif2lossless: bpp=%d not implemented. accept only bpp <= 8\n", bpp); +#if GIFLIB_MAJOR >= 5 DGifCloseFile(GifFile, NULL); +#else + DGifCloseFile(GifFile); +#endif return NULL; } palette_num = ColorMap->ColorCount; @@ -220,7 +228,11 @@ gifconv_gif2lossless(unsigned char *gif_data, unsigned long gif_data_len, * destruct */ if (GifFile) { +#if GIFLIB_MAJOR >= 5 DGifCloseFile(GifFile, NULL); +#else + DGifCloseFile(GifFile); +#endif } return image_data; } @@ -310,7 +322,11 @@ gifconv_lossless2gif(void *image_data, free(gif_image_data); if (GifFile) { +#if GIFLIB_MAJOR >= 5 EGifCloseFile(GifFile, NULL); +#else + DGifCloseFile(GifFile); +#endif } *length = gif_buff.data_offset; return gif_buff.data; -- 2.11.0