summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorInada Naoki <songofacandy@gmail.com>2022-08-08 15:08:40 +0900
committerGitHub <noreply@github.com>2022-08-08 15:08:40 +0900
commitedca770071fc702e0b4c33f87fb0fa3682b486b4 (patch)
tree3d9fe7b1da1a7db977c613a8a42a21f065313734
parent9d45926a596028e39ec59dd909a56eb5e9e8fee7 (diff)
downloadmsgpack-python-edca770071fc702e0b4c33f87fb0fa3682b486b4.tar.gz
Fix build error caused by ntohs, ntohl (#514)
-rw-r--r--msgpack/sysdep.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/msgpack/sysdep.h b/msgpack/sysdep.h
index ae28f0c..7067300 100644
--- a/msgpack/sysdep.h
+++ b/msgpack/sysdep.h
@@ -61,6 +61,8 @@ typedef unsigned int _msgpack_atomic_counter_t;
#endif
#endif
+#else /* _WIN32 */
+#include <arpa/inet.h> /* ntohs, ntohl */
#endif
#if !defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__)
@@ -93,7 +95,7 @@ typedef unsigned int _msgpack_atomic_counter_t;
#ifdef _WIN32
# if defined(ntohl)
# define _msgpack_be32(x) ntohl(x)
-# elif defined(_byteswap_ulong) || (defined(_MSC_VER) && _MSC_VER >= 1400)
+# elif defined(_byteswap_ulong) || defined(_MSC_VER)
# define _msgpack_be32(x) ((uint32_t)_byteswap_ulong((unsigned long)x))
# else
# define _msgpack_be32(x) \
@@ -106,7 +108,7 @@ typedef unsigned int _msgpack_atomic_counter_t;
# define _msgpack_be32(x) ntohl(x)
#endif
-#if defined(_byteswap_uint64) || (defined(_MSC_VER) && _MSC_VER >= 1400)
+#if defined(_byteswap_uint64) || defined(_MSC_VER)
# define _msgpack_be64(x) (_byteswap_uint64(x))
#elif defined(bswap_64)
# define _msgpack_be64(x) bswap_64(x)