aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Ridgers <[email protected]>2021-12-01 09:32:39 +0100
committerMartin Ridgers <[email protected]>2021-12-02 11:36:19 +0100
commit74db4711dcba159d84a4a05fcd651305e98cc5fb (patch)
tree6f25fe812eded3f15b000c00abea8698e10c859b
parentIfdef'd Windows-only include (diff)
downloadzen-74db4711dcba159d84a4a05fcd651305e98cc5fb.tar.xz
zen-74db4711dcba159d84a4a05fcd651305e98cc5fb.zip
Stubbed out base minimum of MS' PPL use for non-Windows platforms
-rw-r--r--zen/cmds/hash.cpp43
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))(