Skip to content

Commit

Permalink
Migrate to modern TBB version
Browse files Browse the repository at this point in the history
  • Loading branch information
SiarheiFedartsou committed Aug 21, 2022
1 parent a7be726 commit 4baffaa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/util/packed_vector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include <vector>

#if defined(_MSC_VER)
// for `InterlockedCompareExchange`
// for `InterlockedCompareExchange64`
#include <windows.h>
#endif

Expand Down Expand Up @@ -95,7 +95,7 @@ inline WordT set_upper_value(WordT word, WordT mask, std::uint8_t offset, T valu
inline bool compare_and_swap(uint64_t *ptr, uint64_t old_value, uint64_t new_value)
{
#if defined(_MSC_VER)
return InterlockedCompareExchange(ptr, new_value, old_value) != old_value;
return InterlockedCompareExchange64(ptr, new_value, old_value) == old_value;
#elif defined(__GNUC__)
return __sync_bool_compare_and_swap(ptr, old_value, new_value);
#else
Expand Down

0 comments on commit 4baffaa

Please sign in to comment.