From cf49d155dea14e285677f5eb6d43875030bc6420 Mon Sep 17 00:00:00 2001 From: Brett Laptop Date: Thu, 26 Oct 2023 16:35:42 -0400 Subject: [PATCH] fun --- include/blt/std/memory.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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)