diff options
| author | Martin Ridgers <[email protected]> | 2021-12-01 09:32:39 +0100 |
|---|---|---|
| committer | Martin Ridgers <[email protected]> | 2021-12-02 11:36:19 +0100 |
| commit | 74db4711dcba159d84a4a05fcd651305e98cc5fb (patch) | |
| tree | 6f25fe812eded3f15b000c00abea8698e10c859b | |
| parent | Ifdef'd Windows-only include (diff) | |
| download | zen-74db4711dcba159d84a4a05fcd651305e98cc5fb.tar.xz zen-74db4711dcba159d84a4a05fcd651305e98cc5fb.zip | |
Stubbed out base minimum of MS' PPL use for non-Windows platforms
| -rw-r--r-- | zen/cmds/hash.cpp | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/zen/cmds/hash.cpp b/zen/cmds/hash.cpp index d9d137f61..a676221e1 100644 --- a/zen/cmds/hash.cpp +++ b/zen/cmds/hash.cpp @@ -13,6 +13,49 @@ namespace zen { +//////////////////////////////////////////////////////////////////////////////// + +#if ZEN_PLATFORM_LINUX || ZEN_PLATFORM_MAC + +namespace Concurrency +{ + +template <typename IterType, typename LambdaType> void +parallel_for_each(IterType Cursor, IterType End, const LambdaType& Lambda) +{ + for (; Cursor < End; ++Cursor) + { + Lambda(*Cursor); + } +} + +template <typename T> +struct combinable +{ + combinable<T>& local() + { + return *this; + } + + void operator += (T Rhs) + { + Value += Rhs; + } + + template <typename LambdaType> void combine_each(const LambdaType& Lambda) + { + Lambda(Value); + } + + T Value = 0; +}; + +} // namespace Concurrency + +#endif // ZEN_PLATFORM_LINUX|MAC + +//////////////////////////////////////////////////////////////////////////////// + HashCommand::HashCommand() { m_Options.add_options()("d,dir", "Directory to scan", cxxopts::value<std::string>(m_ScanDirectory))( |