Skip to content

Commit

Permalink
Fix build error caused by ntohs, ntohl (#514)
Browse files Browse the repository at this point in the history
  • Loading branch information
methane authored Aug 8, 2022
1 parent 9d45926 commit edca770
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions msgpack/sysdep.h
Original file line number Diff line number Diff line change
Expand Up @@ -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__)
Expand Down Expand Up @@ -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) \
Expand All @@ -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)
Expand Down

0 comments on commit edca770

Please sign in to comment.