From 3cf7c3ef441822c889356fd1812ebf2944a59851 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Tue, 25 Aug 2020 10:45:55 +0100 Subject: gentoo resync : 25.08.2020 --- ...-4.0.2-fix-const-correctness-for-unittest.patch | 35 ++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 media-gfx/openvdb/files/openvdb-4.0.2-fix-const-correctness-for-unittest.patch (limited to 'media-gfx/openvdb/files/openvdb-4.0.2-fix-const-correctness-for-unittest.patch') diff --git a/media-gfx/openvdb/files/openvdb-4.0.2-fix-const-correctness-for-unittest.patch b/media-gfx/openvdb/files/openvdb-4.0.2-fix-const-correctness-for-unittest.patch new file mode 100644 index 000000000000..cb2660329948 --- /dev/null +++ b/media-gfx/openvdb/files/openvdb-4.0.2-fix-const-correctness-for-unittest.patch @@ -0,0 +1,35 @@ +Blosc changed the signature of blosc_compcode_to_compname in 1.15 so +that the second parameter is now const char** not char **. This causes +compile failures when using openvdb with earlier versions of blosc. + +The fix, which is backported from openvdb-7, is to check the blosc +version and cast the char** to const char** for modern versions of +blosc. + +The bug can be produced by emerging blosc 1.15+, and then openvdb. +Without this patch, the compiler will fail with +error: invalid conversion from ‘char**’ to ‘const char**’ + +To test that the patch has been properly implemented, emerge modern +blosc and then openvdb with this patch, and the compile will succeed. + +Fixes bug https://bugs.gentoo.org/734102 +Upstream commit https://github.com/AcademySoftwareFoundation/openvdb/commit/d2e8bd87a63d1e9f66a558ecbb6e6cbd54f7de13 + +diff -Naur a/openvdb/unittest/TestFile.cc b/openvdb/unittest/TestFile.cc +--- a/openvdb/unittest/TestFile.cc 2020-08-19 02:11:48.945711312 +1000 ++++ b/openvdb/unittest/TestFile.cc 2020-08-19 02:13:31.106074899 +1000 +@@ -2666,7 +2666,12 @@ + + for (int compcode = 0; compcode <= BLOSC_ZLIB; ++compcode) { + char* compname = nullptr; +- if (0 > blosc_compcode_to_compname(compcode, &compname)) continue; ++#if BLOSC_VERSION_MAJOR > 1 || (BLOSC_VERSION_MAJOR == 1 && BLOSC_VERSION_MINOR >= 15) ++ if (0 > blosc_compcode_to_compname(compcode, const_cast(&compname))) ++#else ++ if (0 > blosc_compcode_to_compname(compcode, &compname)) ++#endif ++ continue; + /// @todo This changes the compressor setting globally. + if (blosc_set_compressor(compname) < 0) continue; + -- cgit v1.2.3