Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 423910 Details for
Bug 450610
media-libs/ming-0.4.5 does not support giflib-5
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
ming-0.4.5-giflib-5-compat.patch
ming-0.4.5-giflib-5.1-compat.patch (text/plain), 4.85 KB, created by
Jonathan Scruggs (RETIRED)
on 2016-01-26 11:16:14 UTC
(
hide
)
Description:
ming-0.4.5-giflib-5-compat.patch
Filename:
MIME Type:
Creator:
Jonathan Scruggs (RETIRED)
Created:
2016-01-26 11:16:14 UTC
Size:
4.85 KB
patch
obsolete
>From 91b4b78a3e35def58934ad7893295da77017c035 Mon Sep 17 00:00:00 2001 >From: Andrew John Hughes <gnu_andrew@member.fsf.org> >Date: Thu, 5 Feb 2015 17:29:16 +0000 >Subject: [PATCH] Support building against giflib 5.1.1. > >--- > src/blocks/gifdbl.c | 13 +++++++++++++ > src/libming.h | 31 ++++++++++++++++++++++++++++--- > util/gif2dbl.c | 22 +++++++++++++++++++--- > util/gif2mask.c | 19 +++++++++++++++---- > 4 files changed, 75 insertions(+), 10 deletions(-) > >diff --git a/src/blocks/gifdbl.c b/src/blocks/gifdbl.c >index d14b273..47e2e50 100644 >--- a/src/blocks/gifdbl.c >+++ b/src/blocks/gifdbl.c >@@ -203,7 +203,12 @@ readGif(GifFileType *file, dblData result) > } > > /* Done! */ >+#if GIFLIB_MAJOR >= 5 && GIFLIB_MINOR >= 1 >+ if (DGifCloseFile(file, NULL) != GIF_OK) >+ return 0; >+#else > DGifCloseFile(file); >+#endif > > result->data = malloc(outsize = (int)floor(size*1.01+12)); > >@@ -227,7 +232,11 @@ SWFDBLBitmapData newSWFDBLBitmapData_fromGifFile(const char *fileName) > SWFDBLBitmapData ret; > struct dbl_data gifdata; > >+#if GIFLIB_MAJOR >= 5 >+ if((file = DGifOpenFileName(fileName, NULL)) == NULL) >+#else > if((file = DGifOpenFileName(fileName)) == NULL) >+#endif > return NULL; > if(!readGif(file, &gifdata)) > return NULL; >@@ -246,7 +255,11 @@ SWFDBLBitmapData newSWFDBLBitmapData_fromGifInput(SWFInput input) > SWFDBLBitmapData ret; > struct dbl_data gifdata; > >+#if GIFLIB_MAJOR >= 5 >+ if((file = DGifOpen(input, (InputFunc) gifReadFunc, NULL)) == NULL) >+#else > if((file = DGifOpen(input, (InputFunc) gifReadFunc)) == NULL) >+#endif > return NULL; > if(!readGif(file, &gifdata)) > return NULL; >diff --git a/src/libming.h b/src/libming.h >index 84b367d..b26041f 100644 >--- a/src/libming.h >+++ b/src/libming.h >@@ -75,13 +75,38 @@ typedef unsigned char BOOL; > #include <unistd.h> > #endif > >-#if GIFLIB_GIFERRORSTRING >+#ifdef HAVE_GIF_LIB_H > #include <gif_lib.h> >+#endif >+ >+#ifndef __has_attribute >+#define __has_attribute(x) 0 >+#endif >+ >+#if (defined(__GNUC__)) || __has_attribute(unused) >+#define UNUSED(x) UNUSED_ ## x __attribute__((__unused__)) >+#else >+#define UNUSED(x) UNUSED_ ## x >+#endif >+ >+#if GIFLIB_MAJOR < 5 >+#define GIFLIB5_ONLY(x) UNUSED(x) >+#else >+#define GIFLIB5_ONLY(x) x >+#endif >+ > static void >-PrintGifError(void) >+PrintGifError(int GIFLIB5_ONLY(errorCode)) > { >+#if GIFLIB_GIFERRORSTRING >+#if GIFLIB_MAJOR < 5 > fprintf(stderr, "\nGIF-LIB error: %s.\n", GifErrorString()); >-} >+#else >+ fprintf(stderr, "\nGIF-LIB error: %s.\n", GifErrorString(errorCode)); >+#endif >+#else >+ fprintf(stderr, "\nGIF-LIB error but no GifErrorString support.\n"); > #endif >+} > > #endif /* SWF_LIBMING_H_INCLUDED */ >diff --git a/util/gif2dbl.c b/util/gif2dbl.c >index 3c2e7f1..c89152f 100644 >--- a/util/gif2dbl.c >+++ b/util/gif2dbl.c >@@ -19,10 +19,10 @@ > > #include "libming.h" > >-void error(char *msg) >+void error(char *msg, int errorCode) > { > printf("%s:\n\n", msg); >- PrintGifError(); >+ PrintGifError(errorCode); > exit(-1); > } > >@@ -59,11 +59,22 @@ unsigned char *readGif(char *fileName, int *length, int *bytesPerColor) > unsigned char *p; > int i, nColors, size, alpha, bgColor, alignedWidth; > >+#if GIFLIB_MAJOR < 5 > if((file = DGifOpenFileName(fileName)) == NULL) > error("Error opening file"); >+#else >+ int errorCode = 0; >+ >+ if((file = DGifOpenFileName(fileName, &errorCode)) == NULL) >+ error("Error opening file", errorCode); >+#endif > > if(DGifSlurp(file) != GIF_OK) >- error("Error slurping file"); >+#if GIFLIB_MAJOR < 5 >+ error("Error slurping file", 0); >+#else >+ error("Error slurping file", file->Error); >+#endif > > /* data should now be available */ > >@@ -190,7 +201,12 @@ unsigned char *readGif(char *fileName, int *length, int *bytesPerColor) > } > > /* Done! */ >+#if GIFLIB_MAJOR >= 5 && GIFLIB_MINOR >= 1 >+ if (DGifCloseFile(file, &errorCode) != GIF_OK) >+ error("Error closing file", errorCode); >+#else > DGifCloseFile(file); >+#endif > > *length = size; > return data; >diff --git a/util/gif2mask.c b/util/gif2mask.c >index 76e36c3..e101b60 100644 >--- a/util/gif2mask.c >+++ b/util/gif2mask.c >@@ -13,10 +13,10 @@ > > #define max(a,b,c) (((a)>(b))?(((c)>(a))?(c):(a)):(((c)>(b))?(c):(b))) > >-void error(char *msg) >+void error(char *msg, int errorCode) > { > printf("%s:\n\n", msg); >- PrintGifError(); >+ PrintGifError(errorCode); > exit(-1); > } > >@@ -28,11 +28,22 @@ unsigned char *readGif(char *fileName, int *length) > unsigned char *data; > int i, nColors, size; > >+#if GIFLIB_MAJOR < 5 > if((file = DGifOpenFileName(fileName)) == NULL) >- error("Error opening file"); >+ error("Error opening file", 0); >+#else >+ int errorCode = 0; >+ >+ if((file = DGifOpenFileName(fileName, &errorCode)) == NULL) >+ error("Error opening file", errorCode); >+#endif > > if(DGifSlurp(file) != GIF_OK) >- error("Error slurping file"); >+#if GIFLIB_MAJOR < 5 >+ error("Error slurping file", 0); >+#else >+ error("Error slurping file", file->Error); >+#endif > > /* data should now be available */ >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 450610
:
338944
|
389310
|
422574
|
422576
|
422692
|
423908
| 423910