mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-02-06 00:40:11 +00:00
Potential fix for Linux compilation
This commit is contained in:
parent
50ea1a12c9
commit
984e97cbdc
@ -14,19 +14,17 @@ namespace stx
|
|||||||
static_assert(std::endian::native == std::endian::little || std::endian::native == std::endian::big);
|
static_assert(std::endian::native == std::endian::little || std::endian::native == std::endian::big);
|
||||||
|
|
||||||
template<class T, std::size_t... N>
|
template<class T, std::size_t... N>
|
||||||
constexpr T bswap_impl(T i, std::index_sequence<N...>)
|
FORCE_INLINE constexpr T bswap_impl(T i, std::index_sequence<N...>)
|
||||||
{
|
{
|
||||||
return static_cast<T>(((((i >> (N * 8)) & T{UINT8_MAX}) <<
|
return static_cast<T>(((((i >> (N * 8)) & T{UINT8_MAX}) << ((sizeof(T) - 1 - N) * 8)) | ...));
|
||||||
((sizeof(T) - 1 - N) * 8)) | ...));
|
|
||||||
};
|
};
|
||||||
|
|
||||||
template<class T, class U = typename std::make_unsigned<T>::type>
|
template<class T, class U = typename std::make_unsigned<T>::type>
|
||||||
constexpr U bswap(T i)
|
FORCE_INLINE constexpr U bswap(T i)
|
||||||
{
|
{
|
||||||
return bswap_impl<U>(i, std::make_index_sequence<sizeof(T)>{});
|
return bswap_impl<U>(i, std::make_index_sequence<sizeof(T)>{});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template <typename T, std::size_t Align = alignof(T), std::size_t Size = sizeof(T)>
|
template <typename T, std::size_t Align = alignof(T), std::size_t Size = sizeof(T)>
|
||||||
struct se_storage
|
struct se_storage
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user