Skip Menu |

This queue is for tickets about the Prima CPAN distribution.

Report information
The Basics
Id: 96335
Status: resolved
Priority: 0/
Queue: Prima

People
Owner: Nobody in particular
Requestors: sisyphus [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Prima fails to build against libgif-5.1.0
Hi, With giflib-5.1.0 DGifClose() and EGifClose() require an additional arg. I'm not sure just when the change to giflib was made, and there's no mention of it in the giflib source ChangeLog. In the gif_lib.h (version 5.0.5) that ships with latest Strawberry Perl the additional arg is *not* specified, so I'm guessing that 5.1.0 might indeed be the first release of giflib that takes the extra argument. Anyway, attached is the patch to img/codec_ungif.c that I used to build Prima-1.39. It worked fine for me when used with both giflib-5.1.0 and giflib-4.1. Cheers, Rob
Subject: diff.txt
--- codec_ungif.c_orig 2014-06-09 14:19:51 +1000 +++ codec_ungif.c 2014-06-09 14:32:01 +1000 @@ -34,6 +34,15 @@ #include "Icon.h" #include <gif_lib.h> +#if defined(GIFLIB_MAJOR) && defined(GIFLIB_MINOR) +#if (GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1) || (GIFLIB_MAJOR > 5) +#define ERRORCODE_ARG ,&ec +#else define ERRORCODE_ARG +#endif +#else +#define ERRORCODE_ARG +#endif + #ifdef __cplusplus extern "C" { #endif @@ -356,6 +365,7 @@ static Bool load( PImgCodec instance, PImgLoadFileInstance fi) { + int ec; PImage i = ( PImage) fi-> object; LoadRec * l = ( LoadRec *) fi-> instance; HV * profile = fi-> frameProperties; @@ -363,7 +373,7 @@ /* Reopen file if rewind requested */ if ( fi-> frame <= l-> passed) { - DGifCloseFile( l-> gft); + DGifCloseFile( l-> gft ERRORCODE_ARG); l-> gft = NULL; if ( req_seek( fi-> req, 0, SEEK_SET)) { snprintf( fi-> errbuf, 256, "Can't rewind GIF stream, seek() error:%s", strerror(req_error( fi-> req))); @@ -521,8 +531,9 @@ static void close_load( PImgCodec instance, PImgLoadFileInstance fi) { + int ec; LoadRec * l = ( LoadRec *) fi-> instance; - if ( l-> gft) DGifCloseFile( l-> gft); + if ( l-> gft) DGifCloseFile( l-> gft ERRORCODE_ARG); free( l); } @@ -751,7 +762,8 @@ static void close_save( PImgCodec instance, PImgSaveFileInstance fi) { - EGifCloseFile(( GifFileType *) fi-> instance); + int ec; + EGifCloseFile(( GifFileType *) fi-> instance ERRORCODE_ARG); } void
Hi , can I ask you to check the latest github snapshot to see if that works for you? I didn't test it on 5.1 myself, would be grateful if you could do it thank you!
Subject: Re: [rt.cpan.org #96335] Prima fails to build against libgif-5.1.0
Date: Mon, 9 Jun 2014 21:06:50 +1000
To: <bug-Prima [...] rt.cpan.org>, <sisyphus [...] cpan.org>
From: <sisyphus1 [...] optusnet.com.au>
Show quoted text
-----Original Message----- From: KARASIK via RT
> can I ask you to check the latest github snapshot to see if that works for > you? I didn't test it on 5.1 myself, would be grateful if you could do it
Sure. There's something not quite right. At around line 123 in img/codec_ungif.c we have: #else #define GIF_ERROR_ARG #endif That needs to become: #else #define GIF_ERROR_ARG #define GIF_ERROR_ARG_51 #endif otherwise the code fails to compile for those giflib versions (eg 4.1) for which GIFLIB_MAJOR is not defined. With that change in place, the current git version is fine with both giflib-4.1 and giflib-5.1.0. Cheers, Rob
Yes, thank you, committed!
fixed in 1.40