diff --git a/sci-libs/opencascade/files/opencascade-7.5.3-tbb-2021.patch b/sci-libs/opencascade/files/opencascade-7.5.3-tbb-2021.patch new file mode 100644 index 0000000000000..38770ac9a5419 --- /dev/null +++ b/sci-libs/opencascade/files/opencascade-7.5.3-tbb-2021.patch @@ -0,0 +1,51 @@ +https://github.com/Open-Cascade-SAS/OCCT/commit/740833a6a88e481f474783c426b6f6311ed586d3 + +From 740833a6a88e481f474783c426b6f6311ed586d3 Mon Sep 17 00:00:00 2001 +From: kgv +Date: Mon, 29 Nov 2021 21:26:45 +0300 +Subject: [PATCH] 0032697: Configuration - fix compilation errors with oneTBB + 2021 + +Removed usage of no more existing tbb::task_scheduler_init and tbb::captured_exception. +--- a/src/OSD/OSD_Parallel_TBB.cxx ++++ b/src/OSD/OSD_Parallel_TBB.cxx +@@ -25,7 +25,9 @@ Standard_DISABLE_DEPRECATION_WARNINGS + #include + #include + #include +-#include ++#if TBB_VERSION_MAJOR < 2021 ++ #include ++#endif + Standard_ENABLE_DEPRECATION_WARNINGS + + //======================================================================= +@@ -38,12 +40,16 @@ void OSD_Parallel::forEachExternal (UniversalIterator& theBegin, + const FunctorInterface& theFunctor, + Standard_Integer theNbItems) + { ++#if TBB_VERSION_MAJOR >= 2021 ++ // task_scheduler_init is removed, ++ // exceptions are captured without proxy tbb::captured_exception object ++ (void )theNbItems; ++ tbb::parallel_for_each (theBegin, theEnd, theFunctor); ++#else + try + { + const Handle(OSD_ThreadPool)& aThreadPool = OSD_ThreadPool::DefaultPool(); +- const Standard_Integer aNbThreads = theNbItems > 0 ? +- aThreadPool->NbDefaultThreadsToLaunch() : -1; +- ++ const Standard_Integer aNbThreads = theNbItems > 0 ? aThreadPool->NbDefaultThreadsToLaunch() : -1; + tbb::task_scheduler_init aScheduler (aNbThreads); + tbb::parallel_for_each (theBegin, theEnd, theFunctor); + } +@@ -51,6 +57,7 @@ void OSD_Parallel::forEachExternal (UniversalIterator& theBegin, + { + throw Standard_ProgramError (anException.what()); + } ++#endif + } + + #endif /* HAVE_TBB */ + diff --git a/sci-libs/opencascade/opencascade-7.5.3-r7.ebuild b/sci-libs/opencascade/opencascade-7.5.3-r8.ebuild similarity index 98% rename from sci-libs/opencascade/opencascade-7.5.3-r7.ebuild rename to sci-libs/opencascade/opencascade-7.5.3-r8.ebuild index 8287de53da6b4..87b782fa5e6ab 100644 --- a/sci-libs/opencascade/opencascade-7.5.3-r7.ebuild +++ b/sci-libs/opencascade/opencascade-7.5.3-r8.ebuild @@ -47,7 +47,7 @@ RDEPEND=" ) ffmpeg? ( media-video/ffmpeg:= ) freeimage? ( media-libs/freeimage ) - tbb? (