summaryrefslogtreecommitdiff
path: root/compat/bswap.h
diff options
context:
space:
mode:
Diffstat (limited to 'compat/bswap.h')
-rw-r--r--compat/bswap.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/compat/bswap.h b/compat/bswap.h
index 5cc4acbfcc..279e0b48b1 100644
--- a/compat/bswap.h
+++ b/compat/bswap.h
@@ -28,6 +28,16 @@ static inline uint32_t default_swab32(uint32_t val)
} \
__res; })
+#elif defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_X64))
+
+#include <stdlib.h>
+
+#define bswap32(x) _byteswap_ulong(x)
+
+#endif
+
+#ifdef bswap32
+
#undef ntohl
#undef htonl
#define ntohl(x) bswap32(x)