Commit aaf829bf authored by Victor Zverovich's avatar Victor Zverovich

Fix fallback pointer formatting on big endian, take 2

parent b994a0ab
...@@ -231,7 +231,10 @@ struct fallback_uintptr { ...@@ -231,7 +231,10 @@ struct fallback_uintptr {
fallback_uintptr() = default; fallback_uintptr() = default;
explicit fallback_uintptr(const void* p) { explicit fallback_uintptr(const void* p) {
*this = bit_cast<fallback_uintptr>(p); *this = bit_cast<fallback_uintptr>(p);
if (is_big_endian()) std::memmove(value, value, sizeof(void*)); if (is_big_endian()) {
for (size_t i = 0, j = sizeof(void*) - 1; i < j; ++i, --j)
std::swap(value[i], value[j]);
}
} }
}; };
#ifdef UINTPTR_MAX #ifdef UINTPTR_MAX
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment