From 89bb298149cfc2a8a4cc147cb668e0973d898de1 Mon Sep 17 00:00:00 2001 From: Bas Couwenberg Date: Mon, 25 May 2026 21:11:13 +0200 Subject: [PATCH] Fix FTBFS with GDAL 3.13.0. error: invalid conversion from 'CSLConstList' {aka 'const char* const*'} to 'char**' [-fpermissive] From GDAL 3.13.0 NEWS: " * GDALMajorObject: Use CSLConstList for GetMetadata, SetMetadata (API breakage) " Gbp-Pq: Name gdal-3.13.patch --- IO/GDAL/vtkGDALRasterReader.cxx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/IO/GDAL/vtkGDALRasterReader.cxx b/IO/GDAL/vtkGDALRasterReader.cxx index 2069e78af..8293d95a1 100644 --- a/IO/GDAL/vtkGDALRasterReader.cxx +++ b/IO/GDAL/vtkGDALRasterReader.cxx @@ -182,7 +182,11 @@ void vtkGDALRasterReader::vtkGDALRasterReaderInternal::ReadMetaData(const std::s this->Reader->DriverShortName = GDALGetDriverShortName(driver); this->Reader->DriverLongName = GDALGetDriverLongName(driver); +#if GDAL_VERSION_NUM >= GDAL_COMPUTE_VERSION(3, 13, 0) + CSLConstList papszMetaData = GDALGetMetadata(this->GDALData, nullptr); +#else char** papszMetaData = GDALGetMetadata(this->GDALData, nullptr); +#endif if (CSLCount(papszMetaData) > 0) { for (int i = 0; papszMetaData[i] != nullptr; ++i) @@ -878,7 +882,11 @@ std::vector vtkGDALRasterReader::GetDomainMetaData(const std::strin { std::vector domainMetaData; +#if GDAL_VERSION_NUM >= GDAL_COMPUTE_VERSION(3, 13, 0) + CSLConstList papszMetadata = GDALGetMetadata(this->Impl->GDALData, domain.c_str()); +#else char** papszMetadata = GDALGetMetadata(this->Impl->GDALData, domain.c_str()); +#endif if (CSLCount(papszMetadata) > 0) { -- 2.30.2