mcst-linux-kernel/patches-2024.06.26/hugin-2018.0.0/0002-pragma-omp-workaround-...

27 lines
1.2 KiB
Diff

Workaround for bug 117863.
Compiler supports only variables and const values in pragma.
diff -rupN a/src/hugin_base/vigra_ext/ImageTransforms.h b/src/hugin_base/vigra_ext/ImageTransforms.h
--- a/src/hugin_base/vigra_ext/ImageTransforms.h 2019-10-03 16:52:06.376866372 +0300
+++ b/src/hugin_base/vigra_ext/ImageTransforms.h 2019-10-03 17:17:55.018698639 +0300
@@ -115,7 +115,8 @@ void transformImageIntern(vigra::triple<
interpol(src, interp, warparound);
// loop over the image and transform
-#pragma omp parallel for if(!singleThreaded) schedule(dynamic)
+ bool multiThreaded = !singleThreaded;
+#pragma omp parallel for if(multiThreaded) schedule(dynamic)
for (int y = ystart; y < yend; ++y)
{
// create x iterators
@@ -176,7 +177,8 @@ void transformImageAlphaIntern(vigra::tr
interpol (src, srcAlpha, interp, warparound);
// loop over the image and transform
-#pragma omp parallel for if(!singleThreaded) schedule(dynamic)
+ bool multiThreaded = !singleThreaded;
+#pragma omp parallel for if(multiThreaded) schedule(dynamic)
for(int y=ystart; y < yend; ++y)
{
// create x iterators