fun
parent
a3d35b8e04
commit
cf49d155de
|
@ -12,13 +12,16 @@
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include "queue.h"
|
#include "queue.h"
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <bit>
|
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <array>
|
#include <array>
|
||||||
|
|
||||||
|
#if __cplusplus >= 202002L
|
||||||
|
#include <bit>
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(__clang__) || defined(__llvm__) || defined(__GNUC__) || defined(__GNUG__)
|
#if defined(__clang__) || defined(__llvm__) || defined(__GNUC__) || defined(__GNUG__)
|
||||||
|
|
||||||
#include <byteswap.h>
|
#include <byteswap.h>
|
||||||
|
@ -26,8 +29,12 @@
|
||||||
#define SWAP16(val) bswap_16(val)
|
#define SWAP16(val) bswap_16(val)
|
||||||
#define SWAP32(val) bswap_32(val)
|
#define SWAP32(val) bswap_32(val)
|
||||||
#define SWAP64(val) bswap_64(val)
|
#define SWAP64(val) bswap_64(val)
|
||||||
|
#if __cplusplus >= 202002L
|
||||||
#define ENDIAN_LOOKUP(little_endian) (std::endian::native == std::endian::little && !little_endian) || \
|
#define ENDIAN_LOOKUP(little_endian) (std::endian::native == std::endian::little && !little_endian) || \
|
||||||
(std::endian::native == std::endian::big && little_endian)
|
(std::endian::native == std::endian::big && little_endian)
|
||||||
|
#else
|
||||||
|
#define ENDIAN_LOOKUP(little_endian)
|
||||||
|
#endif
|
||||||
#elif defined(_MSC_VER)
|
#elif defined(_MSC_VER)
|
||||||
#include <intrin.h>
|
#include <intrin.h>
|
||||||
#define SWAP16(val) _byteswap_ushort(val)
|
#define SWAP16(val) _byteswap_ushort(val)
|
||||||
|
|
Loading…
Reference in New Issue