Skip to content

Commit

Permalink
Integrate POOLSTL_STD_SUPPLEMENT.
Browse files Browse the repository at this point in the history
  • Loading branch information
evoskuil committed Feb 10, 2025
1 parent 4426565 commit b1a17ee
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 26 deletions.
12 changes: 0 additions & 12 deletions include/bitcoin/system/define.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,16 +79,4 @@ namespace bc = libbitcoin;
namespace libbitcoin { constexpr auto with_arm = false; };
#endif

/// Workarounds for C++ noncompliance.
/// ---------------------------------------------------------------------------

/// C++17 (partial), see HAVE_EXECUTION.
#if defined(HAVE_EXECUTION)
namespace libbitcoin { constexpr auto par_unseq = std::execution::par_unseq; }
namespace libbitcoin { constexpr auto seq = std::execution::seq; }
#else
namespace libbitcoin { constexpr auto par_unseq = false; }
namespace libbitcoin { constexpr auto seq = false; }
#endif

#endif
6 changes: 3 additions & 3 deletions include/bitcoin/system/impl/hash/scrypt.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ CONSTEVAL auto& CLASS::
concurrency() NOEXCEPT
{
if constexpr (Concurrent)
return bc::par_unseq;
return std::execution::par_unseq;
else
return bc::seq;
return std::execution::seq;
}

// protected
Expand Down Expand Up @@ -499,7 +499,7 @@ CLASS::hash(data_array<Size>& out, const data_slice& password,
// B[i] = scryptROMix (r, B[i], N)
// end for
std::atomic_bool success{ true };
std_for_each(concurrency(), prblocks.begin(), prblocks.end(),
std::for_each(concurrency(), prblocks.begin(), prblocks.end(),
[&](rblock_t& rblock) NOEXCEPT
{
success = success && romix(rblock);
Expand Down
11 changes: 1 addition & 10 deletions include/bitcoin/system/preprocessor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,18 +214,9 @@
/// C++17 (partial)
#if defined(HAVE_EXECUTION)
#include <execution>
#define std_any_of(p, b, e, l) std::any_of((p), (b), (e), (l))
#define std_all_of(p, b, e, l) std::all_of((p), (b), (e), (l))
#define std_for_each(p, b, e, l) std::for_each((p), (b), (e), (l))
#define std_reduce(p, b, e, i, l) std::reduce((p), (b), (e), (i), (l))
#define std_transform(p, b, e, t, l) std::transform((p), (b), (e), (t), (l))
#else
#define POOLSTL_STD_SUPPLEMENT
#include <bitcoin/system/execution.hpp>
#define std_any_of(p, b, e, l) std::any_of((b), (e), (l))
#define std_all_of(p, b, e, l) std::all_of((b), (e), (l))
#define std_for_each(p, b, e, l) std::for_each((b), (e), (l))
#define std_reduce(p, b, e, i, l) std::reduce((b), (e), (i), (l))
#define std_transform(p, b, e, t, l) std::transform((b), (e), (t), (l))
#endif

/// C++20 (partial)
Expand Down
2 changes: 1 addition & 1 deletion test/hacks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include "test.hpp"
#include <utility>

#if defined(DISABLED) && defined(HAVE_EXECUTION)
#if defined(DISABLED)

BOOST_AUTO_TEST_SUITE(skip_parser_tests)

Expand Down

0 comments on commit b1a17ee

Please sign in to comment.