#include <cstdint>
#include <type_traits>
#include "flutter/fml/build_config.h"
Go to the source code of this file.
|
template<typename T , class = std::enable_if_t<kIsByteSwappableV<T>>> |
constexpr T | fml::ByteSwap (T n) |
| Flips the endianness of the given value. The given value must be an integral type of size 1, 2, 4, or 8. More...
|
|
template<typename T , class = std::enable_if_t<kIsByteSwappableV<T>>> |
constexpr T | fml::BigEndianToArch (T n) |
| Convert a known big endian value to match the endianness of the current architecture. This is effectively a cross platform ntohl/ntohs (as network byte order is always Big Endian). The given value must be an integral type of size 1, 2, 4, or 8. More...
|
|
template<typename T , class = std::enable_if_t<kIsByteSwappableV<T>>> |
constexpr T | fml::LittleEndianToArch (T n) |
| Convert a known little endian value to match the endianness of the current architecture. The given value must be an integral type of size 1, 2, 4, or 8. More...
|
|
◆ FML_BYTESWAP_16
#define FML_BYTESWAP_16 |
( |
|
n | ) |
__builtin_bswap16(n) |
◆ FML_BYTESWAP_32
#define FML_BYTESWAP_32 |
( |
|
n | ) |
__builtin_bswap32(n) |
◆ FML_BYTESWAP_64
#define FML_BYTESWAP_64 |
( |
|
n | ) |
__builtin_bswap64(n) |