From 4c7c5da22538bc8b11b3393418bfc057a4336769 Mon Sep 17 00:00:00 2001 From: Martin Ridgers Date: Thu, 2 Dec 2021 16:01:50 +0100 Subject: Fake concrt for non-Windows platforms --- zen/chunk/chunk.cpp | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/zen/chunk/chunk.cpp b/zen/chunk/chunk.cpp index 866372654..e4dfd2a36 100644 --- a/zen/chunk/chunk.cpp +++ b/zen/chunk/chunk.cpp @@ -33,6 +33,48 @@ ////////////////////////////////////////////////////////////////////////// +#if ZEN_PLATFORM_LINUX || ZEN_PLATFORM_MAC + +namespace Concurrency +{ + +template void +parallel_for_each(IterType Cursor, IterType End, const LambdaType& Lambda) +{ + for (; Cursor < End; ++Cursor) + { + Lambda(*Cursor); + } +} + +template +struct combinable +{ + T& local() + { + return Value; + } + + template void combine_each(const LambdaType& Lambda) + { + Lambda(Value); + } + + T Value = {}; +}; + +struct task_group +{ + void run(...) {} + void wait() {} +}; + +} // namespace Concurrency + +#endif // ZEN_PLATFORM_LINUX || ZEN_PLATFORM_MAC + +////////////////////////////////////////////////////////////////////////// + namespace detail { static const uint32_t buzhashTable[] = { 0x458be752, 0xc10748cc, 0xfbbcdbb8, 0x6ded5b68, 0xb10a82b5, 0x20d75648, 0xdfc5665f, 0xa8428801, 0x7ebf5191, 0x841135c7, 0x65cc53b3, -- cgit v1.2.3