Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
spins:invis:testing
swftools
0001-build-support-for-giflib-5.x.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0001-build-support-for-giflib-5.x.patch of Package swftools
From beaabd9ca03ad800571eb4b7ce64d2ee4ad86bc8 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt <jengelh@inai.de> Date: Wed, 26 Jun 2013 02:59:31 +0200 Subject: [PATCH] build: support for giflib-5.x The API/ABI has changed in giflib-5.x (libgif.so.6). Deal with it. --- src/gif2swf.c | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) Index: swftools-0.9.2/src/gif2swf.c =================================================================== --- swftools-0.9.2.orig/src/gif2swf.c +++ swftools-0.9.2/src/gif2swf.c @@ -222,6 +222,7 @@ TAG *MovieAddFrame(SWF * swf, TAG * t, c GifFileType *gft; FILE *fi; + int ret; if ((fi = fopen(sname, "rb")) == NULL) { if (VERBOSE(1)) @@ -230,13 +231,22 @@ TAG *MovieAddFrame(SWF * swf, TAG * t, c } fclose(fi); - if ((gft = DGifOpenFileName(sname)) == NULL) { +#if defined(GIFLIB_MAJOR) && GIFLIB_MAJOR >= 5 + gft = DGifOpenFileName(sname, NULL); +#else + gft = DGifOpenFileName(sname); +#endif + if (gft == NULL) { fprintf(stderr, "%s is not a GIF file!\n", sname); return t; } - if (DGifSlurp(gft) != GIF_OK) { + if ((ret = DGifSlurp(gft)) != GIF_OK) { +#if defined(GIFLIB_MAJOR) && GIFLIB_MAJOR >= 5 + fprintf(stderr, "GIF-LIB: %s\n", GifErrorString(ret)); +#else PrintGifError(); +#endif return t; } @@ -455,7 +465,11 @@ TAG *MovieAddFrame(SWF * swf, TAG * t, c free(pal); free(imagedata); +#if defined(GIFLIB_MAJOR) && GIFLIB_MAJOR > 5 || (GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1) + DGifCloseFile(gft, NULL); +#else DGifCloseFile(gft); +#endif return t; } @@ -465,6 +479,7 @@ int CheckInputFile(char *fname, char **r FILE *fi; char *s = malloc(strlen(fname) + 5); GifFileType *gft; + int ret; if (!s) exit(2); @@ -488,7 +503,12 @@ int CheckInputFile(char *fname, char **r } fclose(fi); - if ((gft = DGifOpenFileName(s)) == NULL) { +#if defined(GIFLIB_MAJOR) && GIFLIB_MAJOR >= 5 + gft = DGifOpenFileName(s, NULL); +#else + gft = DGifOpenFileName(s); +#endif + if (gft == NULL) { fprintf(stderr, "%s is not a GIF file!\n", fname); return -1; } @@ -498,8 +518,12 @@ int CheckInputFile(char *fname, char **r if (global.max_image_height < gft->SHeight) global.max_image_height = gft->SHeight; - if (DGifSlurp(gft) != GIF_OK) { + if ((ret = DGifSlurp(gft)) != GIF_OK) { +#if defined(GIFLIB_MAJOR) && GIFLIB_MAJOR >= 5 + fprintf(stderr, "GIF-LIB: %s\n", GifErrorString(ret)); +#else PrintGifError(); +#endif return -1; } // After DGifSlurp() call, gft->ImageCount become available @@ -518,7 +542,11 @@ int CheckInputFile(char *fname, char **r fprintf(stderr, "frame: %u, delay: %.3f sec\n", i + 1, getGifDelayTime(gft, i) / 100.0); } +#if defined(GIFLIB_MAJOR) && GIFLIB_MAJOR > 5 || (GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1) + DGifCloseFile(gft, NULL); +#else DGifCloseFile(gft); +#endif return 0; }
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor