From 8478a976da950242a4ea85ec4935b30297a6d555 Mon Sep 17 00:00:00 2001 From: Yoshihiro Yamazaki Date: Sat, 27 Dec 2014 17:01:11 +0900 Subject: [PATCH] Allow building with either giflib 4.2 or 5.0. thank you > antoine ref) http://src.mouf.net/ports/revision?rev=375669 --- src/swf_gif.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/swf_gif.c b/src/swf_gif.c index c161c69..50fdc8f 100644 --- a/src/swf_gif.c +++ b/src/swf_gif.c @@ -132,7 +132,11 @@ gifconv_gif2lossless(unsigned char *gif_data, unsigned long gif_data_len, gif_buff.data = gif_data; gif_buff.data_len = gif_data_len; gif_buff.data_offset = 0; +#if GIFLIB_MAJOR >= 5 + GifFile = DGifOpen(& gif_buff, gif_data_read_func, NULL); +#else GifFile = DGifOpen(& gif_buff, gif_data_read_func); +#endif if (GifFile == NULL) { fprintf(stderr, "gifconv_gif2lossless: can't open GIFFile\n"); return NULL; @@ -252,7 +256,11 @@ gifconv_lossless2gif(void *image_data, gif_buff.data = NULL; gif_buff.data_len = 0; gif_buff.data_offset = 0; +#if GIFLIB_MAJOR >= 5 + GifFile = EGifOpen(& gif_buff, gif_data_write_func, NULL); +#else GifFile = EGifOpen(& gif_buff, gif_data_write_func); +#endif if (GifFile == NULL) { fprintf(stderr, "gifconv_lossless2gif: can't open GIFFile\n"); return NULL; @@ -292,7 +300,11 @@ gifconv_lossless2gif(void *image_data, } GifFile->SavedImages[0].RasterBits = gif_image_data; +#if GIFLIB_MAJOR >= 5 + GifFile->SColorMap = GifMakeMapObject(ColorCount, Colors); +#else GifFile->SColorMap = MakeMapObject(ColorCount, Colors); +#endif EGifSpew(GifFile); // XXX free(gif_image_data); -- 2.11.0