summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2014-08-18 16:00:03 +0200
committerYorhel <git@yorhel.nl>2014-08-18 16:01:51 +0200
commit8d37023ea3ba3b9f2d11c4ad1c6f4168198f9e3d (patch)
treecb4b38286924d538777db6cb8799c9ca8e1f3b84
parent49a943d037352d6c15d4b3d2109ce40010e3f299 (diff)
Fix building with MSVC
-rw-r--r--lib/util/byteswap.h2
-rw-r--r--lib/ypc.h5
2 files changed, 6 insertions, 1 deletions
diff --git a/lib/util/byteswap.h b/lib/util/byteswap.h
index 13fbc23..c43c5d4 100644
--- a/lib/util/byteswap.h
+++ b/lib/util/byteswap.h
@@ -13,7 +13,7 @@ static inline bool ypc__bigendian() {
static inline uint16_t ypc__swap16(uint16_t v) {
#if defined(_MSC_VER)
- return _byteswap_short(v);
+ return _byteswap_ushort(v);
#else
return (v>>8) | (v<<8);
#endif
diff --git a/lib/ypc.h b/lib/ypc.h
index 115143a..69f5ac1 100644
--- a/lib/ypc.h
+++ b/lib/ypc.h
@@ -9,6 +9,11 @@
#define YPC_IMPORT
#endif
+#if defined(_MSC_VER) && !defined(inline)
+#define inline _inline
+#endif
+
+
#include <stdint.h>
#include <stdlib.h>
#include <stdbool.h>