From: Bas Couwenberg Date: Tue, 14 Jul 2026 09:40:34 +0000 (+0200) Subject: Fix FTBFS with GDAL 3.13.0. X-Git-Tag: archive/raspbian/9.6.2+dfsg1-2+rpi1^2~2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=51542b2a864bb74b710edfdcc3c414bc7b503e6c;p=vtk9.git 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 --- 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) {