From 51542b2a864bb74b710edfdcc3c414bc7b503e6c Mon Sep 17 00:00:00 2001 From: Bas Couwenberg Date: Tue, 14 Jul 2026 11:40:34 +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 56632ff4c..db92c6198 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) @@ -882,7 +886,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