Closed ITotalJustice closed 2 years ago
something like this seems to build fine (added to fwd.hpp)
#ifdef EMSCRIPTEN
#include <ranges>
namespace std::ranges {
constexpr auto fill(auto& array, auto value) -> void
{
for (auto& entry : array)
{
entry = value;
}
}
constexpr auto copy(auto& src, auto& dst) -> void
{
constexpr auto src_size = sizeof(src);
constexpr auto dst_size = sizeof(dst);
for (std::size_t i = 0; i < src_size && i < dst_size; i++)
{
dst[i] = src[i];
}
}
} // namespace std::ranges
namespace std {
[[noreturn]] inline void unreachable()
{
__builtin_unreachable();
}
} // namespace std
#endif // EMSCRIPTEN
obvs this isnt have copy or fill should be impl, but for the places that i use it, this works fine.
reason being is libc++ support for ranges is pretty poor. this means i cannot build my emulator for the web using emscripten.
i could write a wrapper for ranges, and use that instead for clang builds, but they may involve too much work, though i'd rather this option because then once libc++ has full support for ranges, i can simply delete the wrapper.