aboutsummaryrefslogtreecommitdiffhomepage
path: root/portability.h
diff options
context:
space:
mode:
authorcbdev <cb@cbcdn.com>2019-08-03 18:42:39 +0200
committercbdev <cb@cbcdn.com>2019-08-03 18:42:39 +0200
commit20a6882a063404858588596bd3f12bdd9e53460a (patch)
treec13ee23aec08ac3c29a1ff9efe2e429d87041239 /portability.h
parentbbeade8898200a8024169ece30c620016fd5eaf1 (diff)
downloadmidimonster-20a6882a063404858588596bd3f12bdd9e53460a.tar.gz
midimonster-20a6882a063404858588596bd3f12bdd9e53460a.tar.bz2
midimonster-20a6882a063404858588596bd3f12bdd9e53460a.zip
Windows build compatiblity
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