aboutsummaryrefslogtreecommitdiff
path: root/woff2/buffer.h
diff options
context:
space:
mode:
Diffstat (limited to 'woff2/buffer.h')
-rw-r--r--woff2/buffer.h19
1 files changed, 18 insertions, 1 deletions
diff --git a/woff2/buffer.h b/woff2/buffer.h
index f71f6a8..5111c65 100644
--- a/woff2/buffer.h
+++ b/woff2/buffer.h
@@ -18,8 +18,25 @@
#ifndef WOFF2_BUFFER_H_
#define WOFF2_BUFFER_H_
-#include <stdint.h>
+#if defined(_WIN32)
+#include <stdlib.h>
+typedef signed char int8_t;
+typedef unsigned char uint8_t;
+typedef short int16_t;
+typedef unsigned short uint16_t;
+typedef int int32_t;
+typedef unsigned int uint32_t;
+typedef __int64 int64_t;
+typedef unsigned __int64 uint64_t;
+#define ntohl(x) _byteswap_ulong (x)
+#define ntohs(x) _byteswap_ushort (x)
+#define htonl(x) _byteswap_ulong (x)
+#define htons(x) _byteswap_ushort (x)
+#else
#include <arpa/inet.h>
+#include <stdint.h>
+#endif
+
#include <cstdlib>
#include <cstring>
#include <limits>