We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2f09551 commit 77ca35aCopy full SHA for 77ca35a
1 file changed
msgpack/unpack_define.h
@@ -45,8 +45,21 @@ extern "C" {
45
#endif
46
47
48
+#ifdef __WIN32__
49
+static inline uint16_t msgpack_betoh16(uint16_t x) {
50
+ return ((x << 8) & 0xff00U) |
51
+ ((x >> 8) & 0x00ffU);
52
+}
53
+static inline uint32_t msgpack_betoh32(uint32_t x) {
54
+ return ((x << 24) & 0xff000000UL ) |
55
+ ((x << 8) & 0x00ff0000UL ) |
56
+ ((x >> 8) & 0x0000ff00UL ) |
57
+ ((x >> 24) & 0x000000ffUL );
58
59
+#else
60
#define msgpack_betoh16(x) ntohs(x)
61
#define msgpack_betoh32(x) ntohl(x)
62
+#endif
63
64
#ifdef __LITTLE_ENDIAN__
65
#if defined(__bswap_64)
0 commit comments