From owner-svn-ports-head@freebsd.org Thu Nov 12 18:35:56 2015 Return-Path: Delivered-To: svn-ports-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 90AA9A2DEE8; Thu, 12 Nov 2015 18:35:56 +0000 (UTC) (envelope-from antoine@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 576F61E45; Thu, 12 Nov 2015 18:35:56 +0000 (UTC) (envelope-from antoine@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tACIZtWt026215; Thu, 12 Nov 2015 18:35:55 GMT (envelope-from antoine@FreeBSD.org) Received: (from antoine@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tACIZsPA026200; Thu, 12 Nov 2015 18:35:54 GMT (envelope-from antoine@FreeBSD.org) Message-Id: <201511121835.tACIZsPA026200@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: antoine set sender to antoine@FreeBSD.org using -f From: Antoine Brodin Date: Thu, 12 Nov 2015 18:35:54 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r401387 - in head: graphics/exact-image/files graphics/mapserver/files graphics/ocaml-images/files graphics/osg/files graphics/php5-swfed/files graphics/simpleviewer/files japanese/ming... X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Nov 2015 18:35:56 -0000 Author: antoine Date: Thu Nov 12 18:35:53 2015 New Revision: 401387 URL: https://svnweb.freebsd.org/changeset/ports/401387 Log: Allow building with giflib 5.1 PR: 204492 Added: head/graphics/mapserver/files/ head/graphics/mapserver/files/patch-mapimageio.c (contents, props changed) head/graphics/osg/files/patch-src_osgPlugins_gif_ReaderWriterGIF.cpp (contents, props changed) Modified: head/graphics/exact-image/files/patch-codecs__gif.cc head/graphics/ocaml-images/files/patch-src_gifread.c head/graphics/ocaml-images/files/patch-src_gifwrite.c head/graphics/php5-swfed/files/patch-swf__gif.c head/graphics/simpleviewer/files/patch-src_formats_formatgif.cpp head/japanese/ming/files/patch-util_gif2dbl.c head/mail/spamprobe/files/patch-src_parser_GifParser.cc head/net-im/kmess-kde4/Makefile head/net-im/kmess-kde4/files/patch-contrib_isf-qt_src_isfqt.cpp head/net-mgmt/driftnet/files/patch-gif.c head/textproc/gladtex/files/patch-eqn2img.c head/x11-toolkits/libgdiplus/files/patch-src_gifcodec.c Modified: head/graphics/exact-image/files/patch-codecs__gif.cc ============================================================================== --- head/graphics/exact-image/files/patch-codecs__gif.cc Thu Nov 12 17:23:14 2015 (r401386) +++ head/graphics/exact-image/files/patch-codecs__gif.cc Thu Nov 12 18:35:53 2015 (r401387) @@ -115,7 +115,19 @@ return false; } } -@@ -166,7 +212,11 @@ bool GIFCodec::writeImage (std::ostream* +@@ -155,7 +201,11 @@ int GIFCodec::readImage (std::istream* s + // convert colormap to our 16bit "TIFF"format + colorspace_de_palette (image, ColorMap->ColorCount, rmap, gmap, bmap); + ++#if GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1 || GIFLIB_MAJOR > 5 ++ EGifCloseFile(GifFile, NULL); ++#else + EGifCloseFile(GifFile); ++#endif + + return true; + } +@@ -166,7 +216,11 @@ bool GIFCodec::writeImage (std::ostream* GifFileType* GifFile; GifByteType* Ptr; @@ -127,7 +139,7 @@ { std::cerr << "Error preparing GIF file for writing." << std::endl; return false; -@@ -175,7 +225,11 @@ bool GIFCodec::writeImage (std::ostream* +@@ -175,7 +229,11 @@ bool GIFCodec::writeImage (std::ostream* int ColorMapSize = 256; // later use our own colormap generation @@ -139,7 +151,7 @@ if (!OutputColorMap) return false; -@@ -203,7 +257,11 @@ bool GIFCodec::writeImage (std::ostream* +@@ -203,7 +261,11 @@ bool GIFCodec::writeImage (std::ostream* } @@ -151,7 +163,7 @@ RedBuffer, GreenBuffer, BlueBuffer, OutputBuffer, OutputColorMap->Colors) == GIF_ERROR) { return false; -@@ -215,7 +273,7 @@ bool GIFCodec::writeImage (std::ostream* +@@ -215,7 +277,7 @@ bool GIFCodec::writeImage (std::ostream* if (EGifPutScreenDesc(GifFile, image.w, image.h, ColorMapSize, 0, OutputColorMap) == GIF_ERROR || EGifPutImageDesc(GifFile, 0, 0, image.w, image.h, @@ -160,12 +172,18 @@ { std::cerr << "Error writing GIF header." << std::endl; return false; -@@ -232,7 +290,7 @@ bool GIFCodec::writeImage (std::ostream* +@@ -232,9 +294,13 @@ bool GIFCodec::writeImage (std::ostream* } free (OutputBuffer); - delete (RedBuffer); delete (GreenBuffer); delete (BlueBuffer); + delete[] RedBuffer; delete[] GreenBuffer; delete[] BlueBuffer; ++#if GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1 || GIFLIB_MAJOR > 5 ++ EGifCloseFile(GifFile, NULL); ++#else EGifCloseFile(GifFile); ++#endif return true; + } + Added: head/graphics/mapserver/files/patch-mapimageio.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/graphics/mapserver/files/patch-mapimageio.c Thu Nov 12 18:35:53 2015 (r401387) @@ -0,0 +1,14 @@ +--- mapimageio.c.orig 2015-07-24 07:59:36 UTC ++++ mapimageio.c +@@ -1058,7 +1058,11 @@ int readGIF(char *path, rasterBufferObj + + } while (recordType != TERMINATE_RECORD_TYPE); + ++#if GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1 || GIFLIB_MAJOR > 5 ++ if (DGifCloseFile(image, NULL) == GIF_ERROR) { ++#else + if (DGifCloseFile(image) == GIF_ERROR) { ++#endif + #if defined GIFLIB_MAJOR && GIFLIB_MAJOR >= 5 + msSetError(MS_MISCERR,"failed to close gif after loading: %s","readGIF()", gif_error_msg(image->Error)); + #else Modified: head/graphics/ocaml-images/files/patch-src_gifread.c ============================================================================== --- head/graphics/ocaml-images/files/patch-src_gifread.c Thu Nov 12 17:23:14 2015 (r401386) +++ head/graphics/ocaml-images/files/patch-src_gifread.c Thu Nov 12 18:35:53 2015 (r401387) @@ -12,7 +12,19 @@ failwith("DGifOpenFileName"); } -@@ -200,7 +204,6 @@ value dGifGetLine( value hdl ) +@@ -161,7 +165,11 @@ value dGifCloseFile( value hdl ) + segmentation faults */ + ((GifFileType *)hdl)->Image.ColorMap = NULL; + ++#if GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1 || GIFLIB_MAJOR > 5 ++ DGifCloseFile( (GifFileType *) hdl, NULL ); ++#else + DGifCloseFile( (GifFileType *) hdl ); ++#endif + CAMLreturn(Val_unit); + } + +@@ -200,7 +208,6 @@ value dGifGetLine( value hdl ) if( DGifGetLine(GifFile, String_val(buf), GifFile->Image.Width ) == GIF_ERROR ){ Modified: head/graphics/ocaml-images/files/patch-src_gifwrite.c ============================================================================== --- head/graphics/ocaml-images/files/patch-src_gifwrite.c Thu Nov 12 17:23:14 2015 (r401386) +++ head/graphics/ocaml-images/files/patch-src_gifwrite.c Thu Nov 12 18:35:53 2015 (r401387) @@ -33,7 +33,19 @@ failwith("EGifOpenFileName"); } /* gcc -fwritable-strings is required to compile libungif */ -@@ -133,7 +141,6 @@ value eGifPutLine( value oc, value buf ) +@@ -88,7 +96,11 @@ value eGifCloseFile( value hdl ) + segmentation faults */ + ((GifFileType *)hdl)->Image.ColorMap = NULL; + ++#if GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1 || GIFLIB_MAJOR > 5 ++ EGifCloseFile( (GifFileType *) hdl, NULL ); ++#else + EGifCloseFile( (GifFileType *) hdl ); ++#endif + CAMLreturn(Val_unit); + } + +@@ -133,7 +145,6 @@ value eGifPutLine( value oc, value buf ) if ( EGifPutLine(GifFileOut, String_val(buf), GifFileOut->Image.Width) == GIF_ERROR ){ Added: head/graphics/osg/files/patch-src_osgPlugins_gif_ReaderWriterGIF.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/graphics/osg/files/patch-src_osgPlugins_gif_ReaderWriterGIF.cpp Thu Nov 12 18:35:53 2015 (r401387) @@ -0,0 +1,14 @@ +--- src/osgPlugins/gif/ReaderWriterGIF.cpp.orig 2013-06-03 14:04:02 UTC ++++ src/osgPlugins/gif/ReaderWriterGIF.cpp +@@ -561,7 +561,11 @@ GifImageStream** obj) + *width_ret = giffile->SWidth; + *height_ret = giffile->SHeight; + *numComponents_ret = 4; ++#if GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1 || GIFLIB_MAJOR > 5 ++ DGifCloseFile(giffile, NULL); ++#else + DGifCloseFile(giffile); ++#endif + return buffer; + } + Modified: head/graphics/php5-swfed/files/patch-swf__gif.c ============================================================================== --- head/graphics/php5-swfed/files/patch-swf__gif.c Thu Nov 12 17:23:14 2015 (r401386) +++ head/graphics/php5-swfed/files/patch-swf__gif.c Thu Nov 12 18:35:53 2015 (r401387) @@ -1,6 +1,6 @@ --- swf_gif.c.orig 2014-02-10 02:32:16 UTC +++ swf_gif.c -@@ -132,7 +132,11 @@ gifconv_gif2lossless(unsigned char *gif_ +@@ -132,14 +132,22 @@ gifconv_gif2lossless(unsigned char *gif_ gif_buff.data = gif_data; gif_buff.data_len = gif_data_len; gif_buff.data_offset = 0; @@ -12,7 +12,42 @@ if (GifFile == NULL) { fprintf(stderr, "gifconv_gif2lossless: can't open GIFFile\n"); return NULL; -@@ -252,7 +256,11 @@ gifconv_lossless2gif(void *image_data, + } + if (DGifSlurp(GifFile) == GIF_ERROR) { + fprintf(stderr, "gifconv_gif2lossless: DGifSlurp failed\n"); ++#if GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1 || GIFLIB_MAJOR > 5 ++ DGifCloseFile(GifFile, NULL); ++#else + DGifCloseFile(GifFile); ++#endif + return NULL; + } + Image = GifFile->SavedImages[0]; +@@ -152,7 +160,11 @@ gifconv_gif2lossless(unsigned char *gif_ + bpp = ColorMap->BitsPerPixel; + if (bpp > 8) { + fprintf(stderr, "gifconv_gif2lossless: bpp=%d not implemented. accept only bpp <= 8\n", bpp); ++#if GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1 || GIFLIB_MAJOR > 5 ++ DGifCloseFile(GifFile, NULL); ++#else + DGifCloseFile(GifFile); ++#endif + return NULL; + } + palette_num = ColorMap->ColorCount; +@@ -216,7 +228,11 @@ gifconv_gif2lossless(unsigned char *gif_ + * destruct + */ + if (GifFile) { ++#if GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1 || GIFLIB_MAJOR > 5 ++ DGifCloseFile(GifFile, NULL); ++#else + DGifCloseFile(GifFile); ++#endif + } + return image_data; + } +@@ -252,7 +268,11 @@ gifconv_lossless2gif(void *image_data, gif_buff.data = NULL; gif_buff.data_len = 0; gif_buff.data_offset = 0; @@ -24,7 +59,7 @@ if (GifFile == NULL) { fprintf(stderr, "gifconv_lossless2gif: can't open GIFFile\n"); return NULL; -@@ -292,7 +300,11 @@ gifconv_lossless2gif(void *image_data, +@@ -292,13 +312,21 @@ gifconv_lossless2gif(void *image_data, } GifFile->SavedImages[0].RasterBits = gif_image_data; @@ -36,3 +71,13 @@ EGifSpew(GifFile); // XXX free(gif_image_data); + + if (GifFile) { ++#if GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1 || GIFLIB_MAJOR > 5 ++ EGifCloseFile(GifFile, NULL); ++#else + EGifCloseFile(GifFile); ++#endif + } + *length = gif_buff.data_offset; + return gif_buff.data; Modified: head/graphics/simpleviewer/files/patch-src_formats_formatgif.cpp ============================================================================== --- head/graphics/simpleviewer/files/patch-src_formats_formatgif.cpp Thu Nov 12 17:23:14 2015 (r401386) +++ head/graphics/simpleviewer/files/patch-src_formats_formatgif.cpp Thu Nov 12 18:35:53 2015 (r401387) @@ -12,3 +12,27 @@ if(file == 0) { std::cout << "Error Opening GIF image" << std::endl; return false; +@@ -31,7 +35,11 @@ bool CFormatGif::Load(const char* filena + int res = DGifSlurp(file); + if(res != GIF_OK || file->ImageCount < 1) { + std::cout << "Error Opening GIF image" << std::endl; ++#if GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1 || GIFLIB_MAJOR > 5 ++ DGifCloseFile(file, NULL); ++#else + DGifCloseFile(file); ++#endif + return false; + } + +@@ -130,7 +138,11 @@ bool CFormatGif::Load(const char* filena + // + // std::cout << "Record Type" << (int)recordType << std::endl; + ++#if GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1 || GIFLIB_MAJOR > 5 ++ DGifCloseFile(file, NULL); ++#else + DGifCloseFile(file); ++#endif + + return true; + } Modified: head/japanese/ming/files/patch-util_gif2dbl.c ============================================================================== --- head/japanese/ming/files/patch-util_gif2dbl.c Thu Nov 12 17:23:14 2015 (r401386) +++ head/japanese/ming/files/patch-util_gif2dbl.c Thu Nov 12 18:35:53 2015 (r401387) @@ -1,5 +1,5 @@ ---- ../util/gif2dbl.c.orig 2002-06-24 12:21:54.000000000 +0000 -+++ ../util/gif2dbl.c 2014-12-26 17:29:52.000000000 +0000 +--- ../util/gif2dbl.c.orig 2002-06-24 12:21:54 UTC ++++ ../util/gif2dbl.c @@ -16,7 +16,6 @@ void error(char *msg) { @@ -20,3 +20,15 @@ error("Error opening file"); if(DGifSlurp(file) != GIF_OK) +@@ -181,7 +184,11 @@ unsigned char *readGif(char *fileName, i + } + + /* Done! */ ++#if GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1 || GIFLIB_MAJOR > 5 ++ DGifCloseFile(file, NULL); ++#else + DGifCloseFile(file); ++#endif + + *length = size; + return data; Modified: head/mail/spamprobe/files/patch-src_parser_GifParser.cc ============================================================================== --- head/mail/spamprobe/files/patch-src_parser_GifParser.cc Thu Nov 12 17:23:14 2015 (r401386) +++ head/mail/spamprobe/files/patch-src_parser_GifParser.cc Thu Nov 12 18:35:53 2015 (r401387) @@ -1,6 +1,18 @@ --- src/parser/GifParser.cc.orig 2006-11-17 07:24:49 UTC +++ src/parser/GifParser.cc -@@ -99,7 +99,11 @@ bool GifParser::parseImage() +@@ -81,7 +81,11 @@ GifParser::GifParser(Message *message, + GifParser::~GifParser() + { + if (m_gif) { ++#if GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1 || GIFLIB_MAJOR > 5 ++ DGifCloseFile(m_gif, NULL); ++#else + DGifCloseFile(m_gif); ++#endif + } + } + +@@ -99,7 +103,11 @@ bool GifParser::parseImage() void GifParser::openImage() { m_nextByteIndex = 0; Modified: head/net-im/kmess-kde4/Makefile ============================================================================== --- head/net-im/kmess-kde4/Makefile Thu Nov 12 17:23:14 2015 (r401386) +++ head/net-im/kmess-kde4/Makefile Thu Nov 12 18:35:53 2015 (r401387) @@ -3,14 +3,15 @@ PORTNAME= kmess PORTVERSION= 2.0.6.2 -PORTREVISION= 9 +PORTREVISION= 10 CATEGORIES= net-im kde MASTER_SITES= SF/${PORTNAME}/Latest%20versions/${PORTVERSION}/ MAINTAINER= syncer@gmail.com COMMENT= MSN Messenger client for KDE -LIB_DEPENDS= libqca.so:${PORTSDIR}/devel/qca +LIB_DEPENDS= libqca.so:${PORTSDIR}/devel/qca \ + libgif.so:${PORTSDIR}/graphics/giflib USE_GNOME= libxml2 libxslt USE_KDE4= kdeprefix kdelibs libkonq automoc4 Modified: head/net-im/kmess-kde4/files/patch-contrib_isf-qt_src_isfqt.cpp ============================================================================== --- head/net-im/kmess-kde4/files/patch-contrib_isf-qt_src_isfqt.cpp Thu Nov 12 17:23:14 2015 (r401386) +++ head/net-im/kmess-kde4/files/patch-contrib_isf-qt_src_isfqt.cpp Thu Nov 12 18:35:53 2015 (r401387) @@ -72,10 +72,15 @@ { qWarning() << "EGifPutExtensionLast (0) failed!"; goto writeError; -@@ -624,12 +648,16 @@ QByteArray Stream::writerGif( const Draw +@@ -623,13 +647,21 @@ QByteArray Stream::writerGif( const Draw + writeError: // Clean up the GIF converter etc ++#if GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1 || GIFLIB_MAJOR > 5 ++ EGifCloseFile( gifImage, NULL ); ++#else EGifCloseFile( gifImage ); ++#endif +#if GIFLIB_MAJOR >= 5 + GifFreeMapObject( cmap ); +#else Modified: head/net-mgmt/driftnet/files/patch-gif.c ============================================================================== --- head/net-mgmt/driftnet/files/patch-gif.c Thu Nov 12 17:23:14 2015 (r401386) +++ head/net-mgmt/driftnet/files/patch-gif.c Thu Nov 12 18:35:53 2015 (r401387) @@ -12,3 +12,27 @@ if (!I->us) { I->err = IE_HDRFORMAT; return 0; +@@ -36,7 +40,11 @@ int gif_load_hdr(img I) { + * Abort loading a GIF file after the header is done. + */ + int gif_abort_load(img I) { ++#if GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1 || GIFLIB_MAJOR > 5 ++ DGifCloseFile((GifFileType*)I->us, NULL); ++#else + DGifCloseFile((GifFileType*)I->us); ++#endif + return 1; + } + +@@ -114,7 +122,11 @@ int gif_load_img(img I) { + ret = 1; + fail: + ++#if GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1 || GIFLIB_MAJOR > 5 ++ DGifCloseFile(g, NULL); ++#else + DGifCloseFile(g); ++#endif + + return ret; + } Modified: head/textproc/gladtex/files/patch-eqn2img.c ============================================================================== --- head/textproc/gladtex/files/patch-eqn2img.c Thu Nov 12 17:23:14 2015 (r401386) +++ head/textproc/gladtex/files/patch-eqn2img.c Thu Nov 12 18:35:53 2015 (r401387) @@ -50,7 +50,19 @@ /* EGifSetGifVersion("89a"); this causes segfault (but is really required for transparency, I think) */ EGifPutScreenDesc(fp, width, height, 256, 255, color_map); -@@ -715,7 +727,7 @@ int to_ps(char *basename, int verbose) { +@@ -649,7 +661,11 @@ int gif_write(png_bytepp image, char *im + return -1; + } + ++#if GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1 || GIFLIB_MAJOR > 5 ++ EGifCloseFile(fp, NULL); ++#else + EGifCloseFile(fp); ++#endif + + return 0; + } +@@ -715,7 +731,7 @@ int to_ps(char *basename, int verbose) { fprintf(stderr, " -> ps"); cmd = NEW(char, 2*strlen(basename) + 46); Modified: head/x11-toolkits/libgdiplus/files/patch-src_gifcodec.c ============================================================================== --- head/x11-toolkits/libgdiplus/files/patch-src_gifcodec.c Thu Nov 12 17:23:14 2015 (r401386) +++ head/x11-toolkits/libgdiplus/files/patch-src_gifcodec.c Thu Nov 12 18:35:53 2015 (r401387) @@ -1,6 +1,6 @@ ---- src/gifcodec.c.orig +--- src/gifcodec.c.orig 2015-01-05 10:27:06 UTC +++ src/gifcodec.c -@@ -40,9 +40,13 @@ +@@ -40,9 +40,13 @@ GUID gdip_gif_image_format_guid = {0xb96 #include "gifcodec.h" #ifdef EgifOpen @@ -15,7 +15,7 @@ /* Data structure used for callback */ typedef struct -@@ -131,7 +135,11 @@ +@@ -131,7 +135,11 @@ AddExtensionBlockMono(SavedImage *New, i if (ExtData) { memcpy(ep->Bytes, ExtData, Len); @@ -27,7 +27,7 @@ } return (GIF_OK); -@@ -234,7 +242,11 @@ +@@ -234,7 +242,11 @@ DGifSlurpMono(GifFileType * GifFile, Sav } case EXTENSION_RECORD_TYPE: { @@ -39,7 +39,7 @@ return (GIF_ERROR); } -@@ -247,7 +259,9 @@ +@@ -247,7 +259,9 @@ DGifSlurpMono(GifFileType * GifFile, Sav if (DGifGetExtensionNext(GifFile, &ExtData) == GIF_ERROR) { return (GIF_ERROR); } @@ -49,7 +49,7 @@ } break; } -@@ -306,9 +320,17 @@ +@@ -306,9 +320,17 @@ gdip_load_gif_image (void *stream, GpIma loop_counter = FALSE; if (from_file) { @@ -67,7 +67,31 @@ } if (gif == NULL) { -@@ -663,9 +685,17 @@ +@@ -583,7 +605,11 @@ gdip_load_gif_image (void *stream, GpIma + } + + FreeExtensionMono(&global_extensions); ++#if GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1 || GIFLIB_MAJOR > 5 ++ DGifCloseFile (gif, NULL); ++#else + DGifCloseFile (gif); ++#endif + + *image = result; + return Ok; +@@ -599,7 +625,11 @@ error: + + if (gif != NULL) { + FreeExtensionMono (&global_extensions); ++#if GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1 || GIFLIB_MAJOR > 5 ++ DGifCloseFile (gif, NULL); ++#else + DGifCloseFile (gif); ++#endif + } + + *image = NULL; +@@ -663,9 +693,17 @@ gdip_save_gif_image (void *stream, GpIma } if (from_file) { @@ -85,7 +109,7 @@ } if (!fp) { -@@ -704,7 +734,11 @@ +@@ -704,7 +742,11 @@ gdip_save_gif_image (void *stream, GpIma goto error; } @@ -97,7 +121,7 @@ pixbuf = GdipAlloc(pixbuf_size); if (pixbuf == NULL) { -@@ -795,7 +829,11 @@ +@@ -795,7 +837,11 @@ gdip_save_gif_image (void *stream, GpIma pixbuf = pixbuf_org; } else { cmap_size = 256; @@ -109,7 +133,7 @@ red = GdipAlloc(pixbuf_size); green = GdipAlloc(pixbuf_size); -@@ -826,13 +864,21 @@ +@@ -826,13 +872,21 @@ gdip_save_gif_image (void *stream, GpIma v += 4; } } @@ -131,7 +155,7 @@ cmap->ColorCount = 1 << cmap->BitsPerPixel; if ((frame == 0) && (k == 0)) { -@@ -850,8 +896,15 @@ +@@ -850,8 +904,15 @@ gdip_save_gif_image (void *stream, GpIma Buffer[0] = 1; Buffer[1] = ptr[0]; Buffer[2] = ptr[1]; @@ -147,7 +171,7 @@ } } -@@ -903,7 +956,11 @@ +@@ -903,7 +964,11 @@ gdip_save_gif_image (void *stream, GpIma pixbuf += bitmap_data->width; } @@ -159,7 +183,17 @@ if (red != NULL) { GdipFree (red); } -@@ -931,7 +988,11 @@ +@@ -925,13 +990,21 @@ gdip_save_gif_image (void *stream, GpIma + } + } + ++#if GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1 || GIFLIB_MAJOR > 5 ++ EGifCloseFile (fp, NULL); ++#else + EGifCloseFile (fp); ++#endif + + return Ok; error: if (cmap != NULL) {