1 #ifndef PROTOZERO_BYTESWAP_HPP
2 #define PROTOZERO_BYTESWAP_HPP
32 static_assert(N == 1,
"Can only swap 4 or 8 byte values");
40 #ifdef PROTOZERO_USE_BUILTIN_BSWAP
41 *
reinterpret_cast<uint32_t*
>(result) = __builtin_bswap32(*reinterpret_cast<const uint32_t*>(data));
55 #ifdef PROTOZERO_USE_BUILTIN_BSWAP
56 *
reinterpret_cast<uint64_t*
>(result) = __builtin_bswap64(*reinterpret_cast<const uint64_t*>(data));
71 #endif // PROTOZERO_BYTESWAP_HPP
void byteswap< 4 >(const char *data, char *result)
Definition: byteswap.hpp:39
void byteswap< 8 >(const char *data, char *result)
Definition: byteswap.hpp:54
Contains macro checks for different configurations.
void byteswap(const char *, char *)
Definition: byteswap.hpp:31
All parts of the protozero header-only library are in this namespace.
Definition: byteswap.hpp:24