Fri May 23 13:04:10 2014 UTC ()
Fixes build with giflib>=5.1.
(obache)
diff -r1.21 -r1.22 pkgsrc/geography/gdal-lib/distinfo
diff -r0 -r1.1 pkgsrc/geography/gdal-lib/patches/patch-frmts_gif_biggifdataset.cpp
diff -r0 -r1.1 pkgsrc/geography/gdal-lib/patches/patch-frmts_gif_gifabstractdataset.cpp
diff -r0 -r1.1 pkgsrc/geography/gdal-lib/patches/patch-frmts_gif_gifdataset.cpp
--- pkgsrc/geography/gdal-lib/distinfo 2013/04/09 15:58:54 1.21
+++ pkgsrc/geography/gdal-lib/distinfo 2014/05/23 13:04:09 1.22
| @@ -1,5 +1,8 @@ | | | @@ -1,5 +1,8 @@ |
1 | $NetBSD: distinfo,v 1.21 2013/04/09 15:58:54 adam Exp $ | | 1 | $NetBSD: distinfo,v 1.22 2014/05/23 13:04:09 obache Exp $ |
2 | | | 2 | |
3 | SHA1 (gdal-1.9.2.tar.gz) = 7eda6a4d735b8d6903740e0acdd702b43515e351 | | 3 | SHA1 (gdal-1.9.2.tar.gz) = 7eda6a4d735b8d6903740e0acdd702b43515e351 |
4 | RMD160 (gdal-1.9.2.tar.gz) = 1ab34a85946bae4313cbd925cdbbf728d23d7b57 | | 4 | RMD160 (gdal-1.9.2.tar.gz) = 1ab34a85946bae4313cbd925cdbbf728d23d7b57 |
5 | Size (gdal-1.9.2.tar.gz) = 9495381 bytes | | 5 | Size (gdal-1.9.2.tar.gz) = 9495381 bytes |
| | | 6 | SHA1 (patch-frmts_gif_biggifdataset.cpp) = ec591ad57fdc96e04713ef769f93df6b8e101e0d |
| | | 7 | SHA1 (patch-frmts_gif_gifabstractdataset.cpp) = a36bfacd0c1c329d221af8554fa8d236033b970d |
| | | 8 | SHA1 (patch-frmts_gif_gifdataset.cpp) = 7d307e0530bad5f5364e08c157e45c39b20b5026 |
$NetBSD: patch-frmts_gif_biggifdataset.cpp,v 1.1 2014/05/23 13:04:10 obache Exp $
* giflib>=5.1 API change
--- frmts/gif/biggifdataset.cpp.orig 2012-10-09 00:58:25.000000000 +0000
+++ frmts/gif/biggifdataset.cpp
@@ -337,7 +337,12 @@ CPLErr BIGGIFDataset::ReOpen()
/* If the file is already open, close it so we can restart. */
/* -------------------------------------------------------------------- */
if( hGifFile != NULL )
+#if defined(GIFLIB_MAJOR) && defined(GIFLIB_MINOR) && \
+ (GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1 || GIFLIB_MAJOR > 5)
+ DGifCloseFile( hGifFile, NULL );
+#else
DGifCloseFile( hGifFile );
+#endif
/* -------------------------------------------------------------------- */
/* If we are actually reopening, then we assume that access to */
@@ -411,7 +416,12 @@ CPLErr BIGGIFDataset::ReOpen()
if( RecordType != IMAGE_DESC_RECORD_TYPE )
{
+#if defined(GIFLIB_MAJOR) && defined(GIFLIB_MINOR) && \
+ (GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1 || GIFLIB_MAJOR > 5)
+ DGifCloseFile( hGifFile, NULL );
+#else
DGifCloseFile( hGifFile );
+#endif
hGifFile = NULL;
CPLError( CE_Failure, CPLE_OpenFailed,
@@ -421,7 +431,12 @@ CPLErr BIGGIFDataset::ReOpen()
if (DGifGetImageDesc(hGifFile) == GIF_ERROR)
{
+#if defined(GIFLIB_MAJOR) && defined(GIFLIB_MINOR) && \
+ (GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1 || GIFLIB_MAJOR > 5)
+ DGifCloseFile( hGifFile, NULL );
+#else
DGifCloseFile( hGifFile );
+#endif
hGifFile = NULL;
CPLError( CE_Failure, CPLE_OpenFailed,
$NetBSD: patch-frmts_gif_gifabstractdataset.cpp,v 1.1 2014/05/23 13:04:10 obache Exp $
* giflib>=5.1 API change
--- frmts/gif/gifabstractdataset.cpp.orig 2012-10-09 00:58:25.000000000 +0000
+++ frmts/gif/gifabstractdataset.cpp
@@ -82,7 +82,12 @@ GIFAbstractDataset::~GIFAbstractDataset(
}
if( hGifFile )
+#if defined(GIFLIB_MAJOR) && defined(GIFLIB_MINOR) && \
+ (GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1 || GIFLIB_MAJOR > 5)
+ DGifCloseFile( hGifFile, NULL );
+#else
DGifCloseFile( hGifFile );
+#endif
if( fp != NULL )
VSIFCloseL( fp );
$NetBSD: patch-frmts_gif_gifdataset.cpp,v 1.1 2014/05/23 13:04:10 obache Exp $
* giflib>=5.1 API change
--- frmts/gif/gifdataset.cpp.orig 2012-10-09 00:58:25.000000000 +0000
+++ frmts/gif/gifdataset.cpp
@@ -385,13 +385,23 @@ GDALDataset *GIFDataset::Open( GDALOpenI
CPLDebug( "GIF",
"Due to limitations of the GDAL GIF driver we deliberately avoid\n"
"opening large GIF files (larger than 100 megapixels).");
+#if defined(GIFLIB_MAJOR) && defined(GIFLIB_MINOR) && \
+ (GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1 || GIFLIB_MAJOR > 5)
+ DGifCloseFile( hGifFile, NULL );
+#else
DGifCloseFile( hGifFile );
+#endif
VSIFCloseL( fp );
return NULL;
}
}
+#if defined(GIFLIB_MAJOR) && defined(GIFLIB_MINOR) && \
+ (GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1 || GIFLIB_MAJOR > 5)
+ DGifCloseFile( hGifFile, NULL );
+#else
DGifCloseFile( hGifFile );
+#endif
VSIFSeekL( fp, 0, SEEK_SET);
@@ -416,7 +426,12 @@ GDALDataset *GIFDataset::Open( GDALOpenI
if( nGifErr != GIF_OK || hGifFile->SavedImages == NULL )
{
VSIFCloseL( fp );
+#if defined(GIFLIB_MAJOR) && defined(GIFLIB_MINOR) && \
+ (GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1 || GIFLIB_MAJOR > 5)
+ DGifCloseFile(hGifFile, NULL);
+#else
DGifCloseFile(hGifFile);
+#endif
if( nGifErr == D_GIF_ERR_DATA_TOO_BIG )
{
@@ -648,7 +663,12 @@ GIFDataset::CreateCopy( const char * psz
{
GifFreeMapObject(psGifCT);
GDALPrintGifError(hGifFile, "Error writing gif file.");
+#if defined(GIFLIB_MAJOR) && defined(GIFLIB_MINOR) && \
+ (GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1 || GIFLIB_MAJOR > 5)
+ EGifCloseFile(hGifFile, NULL);
+#else
EGifCloseFile(hGifFile);
+#endif
VSIFCloseL( fp );
return NULL;
}
@@ -672,7 +692,12 @@ GIFDataset::CreateCopy( const char * psz
if (EGifPutImageDesc(hGifFile, 0, 0, nXSize, nYSize, bInterlace, NULL) == GIF_ERROR )
{
GDALPrintGifError(hGifFile, "Error writing gif file.");
+#if defined(GIFLIB_MAJOR) && defined(GIFLIB_MINOR) && \
+ (GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1 || GIFLIB_MAJOR > 5)
+ EGifCloseFile(hGifFile, NULL);
+#else
EGifCloseFile(hGifFile);
+#endif
VSIFCloseL( fp );
return NULL;
}
@@ -755,7 +780,12 @@ GIFDataset::CreateCopy( const char * psz
/* -------------------------------------------------------------------- */
/* cleanup */
/* -------------------------------------------------------------------- */
+#if defined(GIFLIB_MAJOR) && defined(GIFLIB_MINOR) && \
+ (GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1 || GIFLIB_MAJOR > 5)
+ if (EGifCloseFile(hGifFile, NULL) == GIF_ERROR)
+#else
if (EGifCloseFile(hGifFile) == GIF_ERROR)
+#endif
{
CPLError( CE_Failure, CPLE_AppDefined,
"EGifCloseFile() failed.\n" );
@@ -806,7 +836,12 @@ GIFDataset::CreateCopy( const char * psz
error:
if (hGifFile)
+#if defined(GIFLIB_MAJOR) && defined(GIFLIB_MINOR) && \
+ (GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1 || GIFLIB_MAJOR > 5)
+ EGifCloseFile(hGifFile, NULL);
+#else
EGifCloseFile(hGifFile);
+#endif
if (fp)
VSIFCloseL( fp );
if (pabyScanline)