From 0058156a0cf089859f4d7a8f26affc9b0269f73df5f27e5ee48a38da6224e7e3 Mon Sep 17 00:00:00 2001 From: Stephan Kulow Date: Sun, 1 Jun 2014 08:15:56 +0000 Subject: [PATCH] Accepting request 235928 from home:jengelh:branches:devel:libraries:c_c++ - Update fontforge-fixgiflib.patch to support giflib7-5.1 OBS-URL: https://build.opensuse.org/request/show/235928 OBS-URL: https://build.opensuse.org/package/show/M17N/fontforge?expand=0&rev=37 --- fontforge-fixgiflib.patch | 76 +++++++++++++++++++++++++++++++++++++-- fontforge.changes | 5 +++ 2 files changed, 79 insertions(+), 2 deletions(-) diff --git a/fontforge-fixgiflib.patch b/fontforge-fixgiflib.patch index cc6f40c..72b740d 100644 --- a/fontforge-fixgiflib.patch +++ b/fontforge-fixgiflib.patch @@ -1,8 +1,33 @@ +--- + gutils/gimagereadgif.c | 32 ++++++++++++++++++++++++++------ + 1 file changed, 26 insertions(+), 6 deletions(-) + Index: fontforge-20120731-b/gutils/gimagereadgif.c =================================================================== --- fontforge-20120731-b.orig/gutils/gimagereadgif.c +++ fontforge-20120731-b/gutils/gimagereadgif.c -@@ -132,7 +132,7 @@ GImage *GImageReadGif(char *filename) { +@@ -44,7 +44,11 @@ static int a_file_must_define_something= + static DL_CONST void *libgif=NULL; + static GifFileType *(*_DGifOpenFileName)(char *); + static int (*_DGifSlurp)(GifFileType *); ++#if defined(GIFLIB_MAJOR) && (GIFLIB_MAJOR > 5 || (GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1)) ++static int (*_DGifCloseFile)(GifFileType *, int *); ++#else + static int (*_DGifCloseFile)(GifFileType *); ++#endif + + static int loadgif() { + char *err; +@@ -58,7 +62,7 @@ return( 0 ); + } + _DGifOpenFileName = (GifFileType *(*)(char *)) dlsym(libgif,"DGifOpenFileName"); + _DGifSlurp = (int (*)(GifFileType *)) dlsym(libgif,"DGifSlurp"); +- _DGifCloseFile = (int (*)(GifFileType *)) dlsym(libgif,"DGifCloseFile"); ++ _DGifCloseFile = (void *)dlsym(libgif,"DGifCloseFile"); + if ( _DGifOpenFileName && _DGifSlurp && _DGifCloseFile ) + return( 1 ); + dlclose(libgif); +@@ -132,13 +136,17 @@ GImage *GImageReadGif(char *filename) { if ( !loadgif()) return( NULL ); @@ -11,7 +36,30 @@ Index: fontforge-20120731-b/gutils/gimagereadgif.c fprintf( stderr, "can't open %s\n", filename); return( NULL ); } -@@ -220,7 +220,7 @@ GImage *GImageReadGif(char *filename) { + + if ( _DGifSlurp(gif)==GIF_ERROR ) { ++#if defined(GIFLIB_MAJOR) && (GIFLIB_MAJOR > 5 || (GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1)) ++ _DGifCloseFile(gif, NULL); ++#else + _DGifCloseFile(gif); ++#endif + fprintf( stderr, "Bad gif file %s\n", filename ); + return( NULL ); + } +@@ -150,7 +158,11 @@ return( NULL ); + ret = images[0]; + else + ret = GImageCreateAnimation(images,gif->ImageCount); +- _DGifCloseFile(gif); ++#if defined(GIFLIB_MAJOR) && (GIFLIB_MAJOR > 5 || (GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1)) ++ _DGifCloseFile(gif, NULL); ++#else ++ _DGifCloseFile(gif); ++#endif + free(images); + return( ret ); + } +@@ -220,13 +232,17 @@ GImage *GImageReadGif(char *filename) { GifFileType *gif; int i; @@ -20,3 +68,27 @@ Index: fontforge-20120731-b/gutils/gimagereadgif.c fprintf( stderr, "can't open %s\n", filename); return( NULL ); } + + if ( DGifSlurp(gif)==GIF_ERROR ) { +- DGifCloseFile(gif); ++#if defined(GIFLIB_MAJOR) && (GIFLIB_MAJOR > 5 || (GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1)) ++ DGifCloseFile(gif, NULL); ++#else ++ DGifCloseFile(gif); ++#endif + fprintf(stderr,"Bad gif file %s\n", filename ); + return( NULL ); + } +@@ -238,7 +254,11 @@ return( NULL ); + ret = images[0]; + else + ret = GImageCreateAnimation(images,gif->ImageCount); +- DGifCloseFile(gif); ++#if defined(GIFLIB_MAJOR) && (GIFLIB_MAJOR > 5 || (GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1)) ++ DGifCloseFile(gif, NULL); ++#else ++ DGifCloseFile(gif); ++#endif + free(images); + return( ret ); + } diff --git a/fontforge.changes b/fontforge.changes index d40e70d..0a8de9b 100644 --- a/fontforge.changes +++ b/fontforge.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Sat May 31 16:12:53 UTC 2014 - jengelh@inai.de + +- Update fontforge-fixgiflib.patch to support giflib7-5.1 + ------------------------------------------------------------------- Mon Mar 17 07:21:51 UTC 2014 - pgajdos@suse.com