gmic/gmic-openmp-gcc43.diff
Adrian Schröter 8ba574cff5 Accepting request 225522 from home:garloff:Photography
Submit gmic package to openSUSE:Factory via the graphics Devel package.
Sidenote: While I will continue to build the full gmic binary in my home:garloff:Photography 
project (and use MMX,SSE on i386) for continuity reasons, I follow upstream to only build 
gmic the float type for openSUSE submission, covering probably 99% of the use cases ...
This is controlled by a %define in the specfile, so I can keep the packages in sync otherwise
at least for the time being.

OBS-URL: https://build.opensuse.org/request/show/225522
OBS-URL: https://build.opensuse.org/package/show/graphics/gmic?expand=0&rev=1
2014-03-11 05:52:11 +00:00

51 lines
1.7 KiB
Diff

Index: gmic-1.5.8.4/src/CImg.h
===================================================================
--- gmic-1.5.8.4.orig/src/CImg.h
+++ gmic-1.5.8.4/src/CImg.h
@@ -220,8 +220,13 @@
// OpenMP directives may be used in a (very) few CImg functions to get
// advantages of multi-core CPUs.
#ifdef cimg_use_openmp
#include "omp.h"
+#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)
+#define COLLAPSE(x) collapse(x)
+#else
+#define COLLAPSE(x)
+#endif
#endif
// Configure OpenCV support.
// (http://opencv.willowgarage.com/wiki/)
@@ -24304,27 +24309,27 @@ namespace cimg_library_suffixed {
switch (naxis) {
case 'x' : {
#ifdef cimg_use_openmp
-#pragma omp parallel for collapse(3)
+#pragma omp parallel for COLLAPSE(3)
#endif
cimg_forYZC(*this,y,z,c) _cimg_recursive_apply<4>(data(0,y,z,c),filter,_width,1U,order,boundary_conditions);
} break;
case 'y' : {
#ifdef cimg_use_openmp
-#pragma omp parallel for collapse(3)
+#pragma omp parallel for COLLAPSE(3)
#endif
cimg_forXZC(*this,x,z,c) _cimg_recursive_apply<4>(data(x,0,z,c),filter,_height,(unsigned long)_width,order,boundary_conditions);
} break;
case 'z' : {
#ifdef cimg_use_openmp
-#pragma omp parallel for collapse(3)
+#pragma omp parallel for COLLAPSE(3)
#endif
cimg_forXYC(*this,x,y,c) _cimg_recursive_apply<4>(data(x,y,0,c),filter,_depth,(unsigned long)(_width*_height),order,boundary_conditions);
} break;
default : {
#ifdef cimg_use_openmp
-#pragma omp parallel for collapse(3)
+#pragma omp parallel for COLLAPSE(3)
#endif
cimg_forXYZ(*this,x,y,z) _cimg_recursive_apply<4>(data(x,y,z,0),filter,_spectrum,(unsigned long)(_width*_height*_depth),order,boundary_conditions);
}
}