14#ifndef WPIUTIL_WPI_SWAPBYTEORDER_H
15#define WPIUTIL_WPI_SWAPBYTEORDER_H
22#if defined(__linux__) || defined(__GNU__) || defined(__HAIKU__) || \
23 defined(__Fuchsia__) || defined(__EMSCRIPTEN__)
26#include <sys/machine.h>
30#define BIG_ENDIAN 4321
31#define LITTLE_ENDIAN 1234
32#if defined(_BIG_ENDIAN)
33#define BYTE_ORDER BIG_ENDIAN
35#define BYTE_ORDER LITTLE_ENDIAN
38#define BIG_ENDIAN 4321
39#define LITTLE_ENDIAN 1234
40#define BYTE_ORDER BIG_ENDIAN
42#if !defined(BYTE_ORDER) && !defined(_WIN32)
43#include <machine/endian.h>
51#if defined(BYTE_ORDER) && defined(BIG_ENDIAN) && BYTE_ORDER == BIG_ENDIAN
97 return static_cast<T
>(
This file implements the C++20 <bit> header.
constexpr auto in(type t, int set) -> bool
Definition: core.h:611
void swapByteOrder(T &Value)
Definition: SwapByteOrder.h:102
constexpr bool IsBigEndianHost
Definition: SwapByteOrder.h:54
unsigned char getSwappedBytes(unsigned char C)
Definition: SwapByteOrder.h:59
static const bool IsLittleEndianHost
Definition: SwapByteOrder.h:57
Definition: ntcore_cpp.h:26
constexpr T byteswap(T V) noexcept
Reverses the bytes in the given integer value V.
Definition: bit.h:53