mirror of
https://github.com/hedge-dev/XenonRecomp.git
synced 2025-06-05 08:42:05 +00:00
PowerUtils: implemented endian swap for enums
This commit is contained in:
parent
d8676283fd
commit
62e3188a81
@ -89,6 +89,11 @@ struct be
|
||||
const uint32_t swapped = std::byteswap(*reinterpret_cast<uint32_t*>(&value));
|
||||
return *reinterpret_cast<const T*>(&swapped);
|
||||
}
|
||||
else if constexpr (std::is_enum_v<T>)
|
||||
{
|
||||
const std::underlying_type_t<T> swapped = std::byteswap(*reinterpret_cast<std::underlying_type_t<T>*>(&value));
|
||||
return *reinterpret_cast<const T*>(&swapped);
|
||||
}
|
||||
else
|
||||
{
|
||||
return std::byteswap(value);
|
||||
|
Loading…
x
Reference in New Issue
Block a user