ports/168612: graphics/gdal: gifdataset.cpp:599:23: error: ' PrintGifError' was not declared in this scope

Rainer Hurling rhurlin at gwdg.de
Mon Jun 4 20:10:13 UTC 2012


The following reply was made to PR ports/168612; it has been noted by GNATS.

From: Rainer Hurling <rhurlin at gwdg.de>
To: bug-followup at FreeBSD.org, ohartman at zedat.fu-berlin.de
Cc:  
Subject: Re: ports/168612: graphics/gdal: gifdataset.cpp:599:23: error: 'PrintGifError'
 was not declared in this scope
Date: Mon, 04 Jun 2012 22:04:56 +0200

 This is a multi-part message in MIME format.
 --------------060800040605020106040105
 Content-Type: text/plain; charset=ISO-8859-15; format=flowed
 Content-Transfer-Encoding: 7bit
 
 The (first described) error is not related to png update, but giflib.
 
 It is fixed upstream for existing gdal 1.9 branches and upcoming gdal 
 1.9.2 (trunk), see
 
 http://trac.osgeo.org/gdal/ticket/4675
 
 The patch should solve this issue for ports version 1.9.0.
 
 --------------060800040605020106040105
 Content-Type: text/plain; charset=ISO-8859-15;
  name="patch-frmts__gif__gifdataset.cpp.txt"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: attachment;
  filename="patch-frmts__gif__gifdataset.cpp.txt"
 
 --- frmts/gif/gifdataset.cpp.orig	2012-01-04 08:03:28.000000000 +0100
 +++ frmts/gif/gifdataset.cpp	2012-06-04 17:21:24.000000000 +0200
 @@ -470,6 +470,28 @@
  }
  
  /************************************************************************/
 +/*                        GDALPrintGifError()                           */ 
 +/************************************************************************/ 
 +
 +static void GDALPrintGifError(const char* pszMsg) 
 +{ 
 +/* GIFLIB_MAJOR is only defined in libgif >= 4.2.0 */ 
 +/* libgif 4.2.0 has retired PrintGifError() and added GifErrorString() */ 
 +#if defined(GIFLIB_MAJOR) && defined(GIFLIB_MINOR) && \ 
 +        ((GIFLIB_MAJOR == 4 && GIFLIB_MINOR >= 2) || GIFLIB_MAJOR > 4) 
 +    /* Static string actually, hence the const char* cast */ 
 +    const char* pszGIFLIBError = (const char*) GifErrorString(); 
 +    if (pszGIFLIBError == NULL) 
 +        pszGIFLIBError = "Unknown error"; 
 +    CPLError( CE_Failure, CPLE_AppDefined, 
 +              "%s. GIFLib Error : %s", pszMsg, pszGIFLIBError ); 
 +#else 
 +    PrintGifError(); 
 +    CPLError( CE_Failure, CPLE_AppDefined, "%s", pszMsg ); 
 +#endif 
 +} 
 +
 +/************************************************************************/ 
  /*                             CreateCopy()                             */
  /************************************************************************/
  
 @@ -596,9 +618,7 @@
                            psGifCT->ColorCount, 255, psGifCT) == GIF_ERROR)
      {
          FreeMapObject(psGifCT);
 -        PrintGifError();
 -        CPLError( CE_Failure, CPLE_AppDefined, 
 -                  "Error writing gif file." );
 +        GDALPrintGifError("Error writing gif file.");
          EGifCloseFile(hGifFile);
          VSIFCloseL( fp );
          return NULL;
 @@ -622,9 +642,7 @@
  
      if (EGifPutImageDesc(hGifFile, 0, 0, nXSize, nYSize, bInterlace, NULL) == GIF_ERROR )
      {
 -        PrintGifError();
 -        CPLError( CE_Failure, CPLE_AppDefined, 
 -                  "Error writing gif file." );
 +        GDALPrintGifError("Error writing gif file.");
          EGifCloseFile(hGifFile);
          VSIFCloseL( fp );
          return NULL;
 
 --------------060800040605020106040105--



More information about the freebsd-ports-bugs mailing list