From: Bas Couwenberg Date: Fri, 8 May 2026 12:41:38 +0000 (+0200) Subject: Fix FTBFS with GDAL 3.13.0. X-Git-Tag: archive/raspbian/9.5.2+dfsg4-4+rpi1^2~1 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=f8b5a127e81bf5690168452a88541f97efd9d9a6;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 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) {