Workaround libc++ issues.

This commit is contained in:
Bartosz Taudul
2026-02-01 18:57:49 +01:00
parent 8f0c83dbf9
commit a9ea7ec1c9
2 changed files with 30 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
#ifndef __EMSCRIPTENSHIM_HPP__
#define __EMSCRIPTENSHIM_HPP__
#ifdef __EMSCRIPTEN__
namespace std {
template<typename T>
struct atomic<shared_ptr<T>> {
shared_ptr<T> value;
bool compare_exchange_weak(shared_ptr<T>& expected, const shared_ptr<T>& desired) noexcept {
return atomic_compare_exchange_weak_explicit(&value, &expected, &desired, std::memory_order_acq_rel, std::memory_order_acquire);
}
shared_ptr<T> load(memory_order order = std::memory_order_seq_cst) const noexcept {
return atomic_load_explicit(&value, order);
}
void store(shared_ptr<T> desired, memory_order order = std::memory_order_seq_cst) noexcept {
atomic_store_explicit(&value, desired, order);
}
};
} // namespace std
#endif
#endif

View File

@@ -58,6 +58,7 @@
#include "Backend.hpp"
#include "ConnectionHistory.hpp"
#include "EmscriptenShim.hpp"
#include "Filters.hpp"
#include "Fonts.hpp"
#include "HttpRequest.hpp"