diff --git a/include/blt/std/memory.h b/include/blt/std/memory.h index d782cdd..10121ca 100755 --- a/include/blt/std/memory.h +++ b/include/blt/std/memory.h @@ -12,13 +12,16 @@ #include #include "queue.h" #include -#include #include #include #include #include #include +#if __cplusplus >= 202002L + #include +#endif + #if defined(__clang__) || defined(__llvm__) || defined(__GNUC__) || defined(__GNUG__) #include @@ -26,8 +29,12 @@ #define SWAP16(val) bswap_16(val) #define SWAP32(val) bswap_32(val) #define SWAP64(val) bswap_64(val) +#if __cplusplus >= 202002L #define ENDIAN_LOOKUP(little_endian) (std::endian::native == std::endian::little && !little_endian) || \ (std::endian::native == std::endian::big && little_endian) +#else + #define ENDIAN_LOOKUP(little_endian) +#endif #elif defined(_MSC_VER) #include #define SWAP16(val) _byteswap_ushort(val)