From bc4ffe50429fa0282d7b3cfdde9994a92a4300d6 Mon Sep 17 00:00:00 2001 From: maralla Date: Tue, 3 Mar 2015 14:05:55 +0800 Subject: [PATCH] fixes #90 --- thriftpy/protocol/cybin/endian_port.h | 29 ++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/thriftpy/protocol/cybin/endian_port.h b/thriftpy/protocol/cybin/endian_port.h index fc00a5e..4e38b6e 100644 --- a/thriftpy/protocol/cybin/endian_port.h +++ b/thriftpy/protocol/cybin/endian_port.h @@ -30,5 +30,32 @@ static inline int64_t bswap64(int64_t n) { #define be64toh(n) bswap64(n) #else - #include + +#include +#include + +#ifndef htobe16 +#define htobe16(x) bswap_16(x) +#endif + +#ifndef htobe32 +#define htobe32(x) bswap_32(x) +#endif + +#ifndef htobe64 +#define htobe64(x) bswap_64(x) +#endif + +#ifndef be16toh +#define be16toh(x) bswap_16(x) +#endif + +#ifndef be32toh +#define be32toh(x) bswap_32(x) +#endif + +#ifndef be64toh +#define be64toh(x) bswap_64(x) +#endif + #endif