14#ifndef WPIUTIL_WPI_SWAPBYTEORDER_H
15#define WPIUTIL_WPI_SWAPBYTEORDER_H
27 wpi::endianness::native == wpi::endianness::big;
35inline unsigned short getSwappedBytes(
unsigned short C) {
return wpi::byteswap(C); }
44inline unsigned long long getSwappedBytes(
unsigned long long C) {
return wpi::byteswap(C); }
45inline signed long long getSwappedBytes(
signed long long C) {
return wpi::byteswap(C); }
48 return wpi::bit_cast<float>(wpi::byteswap(wpi::bit_cast<uint32_t>(C)));
52 return wpi::bit_cast<double>(wpi::byteswap(wpi::bit_cast<uint64_t>(C)));
This file contains library features backported from future STL versions.
void swapByteOrder(T &Value)
Definition SwapByteOrder.h:61
constexpr bool IsBigEndianHost
Definition SwapByteOrder.h:26
unsigned char getSwappedBytes(unsigned char C)
Definition SwapByteOrder.h:31
static const bool IsLittleEndianHost
Definition SwapByteOrder.h:29
Definition ntcore_cpp.h:26
constexpr std::underlying_type_t< Enum > to_underlying(Enum E)
Returns underlying integer value of an enum.
Definition STLForwardCompat.h:66