From 1e73bb40e9ff4c57ba6de7dc89fca81d36fc86f3 Mon Sep 17 00:00:00 2001 From: Jon Clayden Date: Mon, 18 Mar 2024 09:56:14 +0000 Subject: [PATCH] Also abstract out continue statements, which need to be return in blocks --- src/Distancer.cpp | 2 +- src/Parallel.h | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Distancer.cpp b/src/Distancer.cpp index 65ba9fd..27f9b51 100644 --- a/src/Distancer.cpp +++ b/src/Distancer.cpp @@ -78,7 +78,7 @@ Array * Distancer::run () // If no parabolas have been placed, there's nothing else to do if (vertices.empty()) - continue; + PARALLEL_LOOP_CONTINUE // Step back over the data, replacing each element with the value // of the lowest parabola at that location diff --git a/src/Parallel.h b/src/Parallel.h index 5cf6671..badbe62 100644 --- a/src/Parallel.h +++ b/src/Parallel.h @@ -7,21 +7,24 @@ #define PARALLEL_LOOP_START(i,n) \ dispatch_apply(size_t(n), DISPATCH_APPLY_AUTO, ^(size_t i) { +#define PARALLEL_LOOP_CONTINUE return; #define PARALLEL_LOOP_END }); -#elif _OPENMP +#elif defined(_OPENMP) #include #define PARALLEL_LOOP_START(i,n) \ _Pragma("omp parallel for") \ for (size_t i=0; i