#ifndef ORC_RT_ENDIAN_H
#define ORC_RT_ENDIAN_H
#include <cstddef>
#include <cstdint>
#include <type_traits>
#if defined(_MSC_VER) && !defined(_DEBUG)
#include <stdlib.h>
#endif
#if defined(__linux__) || defined(__GNU__) || defined(__HAIKU__) || \
defined(__Fuchsia__) || defined(__EMSCRIPTEN__)
#include <endian.h>
#elif defined(_AIX)
#include <sys/machine.h>
#elif defined(__sun)
#include <sys/types.h>
#define BIG_ENDIAN …
#define LITTLE_ENDIAN …
#if defined(_BIG_ENDIAN)
#define BYTE_ORDER …
#else
#define BYTE_ORDER …
#endif
#elif defined(__MVS__)
#define BIG_ENDIAN …
#define LITTLE_ENDIAN …
#define BYTE_ORDER …
#else
#if !defined(BYTE_ORDER) && !defined(_WIN32)
#include <machine/endian.h>
#endif
#endif
namespace __orc_rt {
inline uint16_t ByteSwap_16(uint16_t value) { … }
inline uint32_t ByteSwap_32(uint32_t value) { … }
inline uint64_t ByteSwap_64(uint64_t value) { … }
#if defined(BYTE_ORDER) && defined(BIG_ENDIAN) && BYTE_ORDER == BIG_ENDIAN
constexpr bool IsBigEndianHost = true;
#else
constexpr bool IsBigEndianHost = …;
#endif
static const bool IsLittleEndianHost = …;
inline unsigned char getSwappedBytes(unsigned char C) { … }
inline signed char getSwappedBytes(signed char C) { … }
inline char getSwappedBytes(char C) { … }
inline unsigned short getSwappedBytes(unsigned short C) { … }
inline signed short getSwappedBytes(signed short C) { … }
inline unsigned int getSwappedBytes(unsigned int C) { … }
inline signed int getSwappedBytes(signed int C) { … }
inline unsigned long getSwappedBytes(unsigned long C) { … }
inline signed long getSwappedBytes(signed long C) { … }
inline unsigned long long getSwappedBytes(unsigned long long C) { … }
inline signed long long getSwappedBytes(signed long long C) { … }
template <typename T>
inline std::enable_if_t<std::is_enum<T>::value, T> getSwappedBytes(T C) { … }
template <typename T> inline void swapByteOrder(T &Value) { … }
}
#endif