Mercurial > minori
comparison include/core/endian.h @ 354:9aaf1e788896
core/endian: fix compile error under clang
| author | Paper <paper@paper.us.eu.org> |
|---|---|
| date | Sun, 14 Jul 2024 23:39:42 -0400 |
| parents | c844f8bb87ce |
| children | 99c961c91809 |
comparison
equal
deleted
inserted
replaced
| 353:2f094656e775 | 354:9aaf1e788896 |
|---|---|
| 91 } else if constexpr (std::is_same<T, uint32_t>::value) { | 91 } else if constexpr (std::is_same<T, uint32_t>::value) { |
| 92 return byteswap_32(x); | 92 return byteswap_32(x); |
| 93 } else if constexpr (std::is_same<T, uint64_t>::value) { | 93 } else if constexpr (std::is_same<T, uint64_t>::value) { |
| 94 return byteswap_64(x); | 94 return byteswap_64(x); |
| 95 } else { | 95 } else { |
| 96 static_assert(false, "byteswapping with unknown integer type"); | 96 static_assert(!sizeof(T), "invalid integer type given to byteswap"); |
| 97 } | 97 } |
| 98 } | 98 } |
| 99 | 99 |
| 100 template<typename T> | 100 template<typename T> |
| 101 static constexpr T byteswap_little_to_host(T x) { | 101 static constexpr T byteswap_little_to_host(T x) { |
