1
0
mirror of https://github.com/fumiama/base16384.git synced 2026-06-07 11:10:29 +08:00

fix(test): buffer overflow & adapt to windows

This commit is contained in:
源文雨
2024-04-05 16:05:30 +08:00
parent 29e4019ed1
commit b9e02241bd
3 changed files with 11 additions and 11 deletions

View File

@@ -57,7 +57,7 @@
#define htobe64(x) htonll(x)
#endif
#endif
#ifdef _MSC_VER
#ifdef _WIN32
#ifdef WORDS_BIGENDIAN
#define be16toh(x) (x)
#define be32toh(x) (x)
@@ -70,15 +70,15 @@
#define htobe64(x) (x)
#endif
#else
#define be16toh(x) _bitswap_ushort(x)
#define be32toh(x) _bitswap_ulong(x)
#define be16toh(x) _byteswap_ushort(x)
#define be32toh(x) _byteswap_ulong(x)
#ifdef IS_64BIT_PROCESSOR
#define be64toh(x) _bitswap_uint64(x)
#define be64toh(x) _byteswap_uint64(x)
#endif
#define htobe16(x) _bitswap_ushort(x)
#define htobe32(x) _bitswap_ulong(x)
#define htobe16(x) _byteswap_ushort(x)
#define htobe32(x) _byteswap_ulong(x)
#ifdef IS_64BIT_PROCESSOR
#define htobe64(x) _bitswap_uint64(x)
#define htobe64(x) _byteswap_uint64(x)
#endif
#endif
#endif