Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 0 additions & 44 deletions MarathonRecomp/framework.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,47 +83,3 @@ inline bool strcmpIgnoreCase(const char* a, const char* b)

return true;
}

#ifndef __cpp_lib_atomic_ref
// Polyfill for std::atomic_ref
namespace std {
template <typename value_type>
class atomic_ref
{
public:
atomic_ref(value_type& ref)
{
ptr = reinterpret_cast<std::atomic<value_type>*>(&ref);
}

void store(value_type desired)
{
ptr->store(desired);
}

bool compare_exchange_weak(value_type& expected, value_type desired)
{
return ptr->compare_exchange_weak(expected, desired);
}

void wait(value_type old)
{
ptr->wait(old);
}

void notify_one()
{
ptr->notify_one();
}

bool operator=(const value_type& rhs)
{
store(rhs);
}

private:
std::atomic<value_type>* ptr;
};
}
#endif

Loading