aboutsummaryrefslogtreecommitdiffhomepage
path: root/portability.h
diff options
context:
space:
mode:
Diffstat (limited to 'portability.h')
-rw-r--r--portability.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/portability.h b/portability.h
index 25aee01..903ecd8 100644
--- a/portability.h
+++ b/portability.h
@@ -19,3 +19,20 @@
#define be64toh(x) OSSwapBigToHostInt64(x)
#define le64toh(x) OSSwapLittleToHostInt64(x)
#endif
+
+#ifdef _WIN32
+ #define WIN32_LEAN_AND_MEAN
+ #include <windows.h>
+ #include <winsock2.h>
+
+ #define htobe16(x) htons(x)
+ #define be16toh(x) ntohs(x)
+
+ #define htobe32(x) htonl(x)
+ #define be32toh(x) ntohl(x)
+
+ #define htobe64(x) _byteswap_uint64(x)
+ #define htole64(x) (x)
+ #define be64toh(x) _byteswap_uint64(x)
+ #define le64toh(x) (x)
+#endif