From 16d248d921ef8801bf377491a874852cdafc50f6 Mon Sep 17 00:00:00 2001 From: Logan oos Even <46396513+Logan007@users.noreply.github.com> Date: Thu, 30 Sep 2021 02:20:48 +0545 Subject: [PATCH] fixed MinGW compile (#830) --- include/portable_endian.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/portable_endian.h b/include/portable_endian.h index 9c46ffe..d9e3d16 100644 --- a/include/portable_endian.h +++ b/include/portable_endian.h @@ -135,8 +135,8 @@ # define be32toh(x) _byteswap_ulong(x) # define le32toh(x) (x) -# define htobe64(x) _byteswap_uint64(x) -# define be64toh(x) _byteswap_uint64(x) +# define htobe64(x) (((uint64_t)htonl(((uint32_t)(((uint64_t)(x)) >> 32))) & 0x00000000FFFFFFFFULL) | (((uint64_t)htonl(((uint32_t)(x)))) << 32)) +# define be64toh(x) (((uint64_t)htonl(((uint32_t)(((uint64_t)(x)) >> 32))) & 0x00000000FFFFFFFFULL) | (((uint64_t)htonl(((uint32_t)(x)))) << 32)) # define htole64(x) (x) # define le64toh(x) (x)