diff options
author | Kenichi Ishibashi <bashi@google.com> | 2014-06-06 17:39:02 +0900 |
---|---|---|
committer | Kenichi Ishibashi <bashi@google.com> | 2014-06-06 17:39:02 +0900 |
commit | 6cef49677dc4c650ef6e3f56041e0a41803afa8c (patch) | |
tree | 71eed4477dfc398abdf81fe8952ca04e862e9481 | |
parent | c75ed764ef2a74bf3ab645ca7a73c0c692477755 (diff) | |
download | src-6cef49677dc4c650ef6e3f56041e0a41803afa8c.tar.gz |
Fix a compile error on Windows
-rw-r--r-- | woff2/buffer.h | 19 |
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> |