Skip to content
This repository has been archived by the owner on Dec 10, 2018. It is now read-only.

Commit

Permalink
Merge pull request #92 from maralla/endian
Browse files Browse the repository at this point in the history
fixes #90
  • Loading branch information
lxyu committed Mar 3, 2015
2 parents eb8b296 + bc4ffe5 commit 7c452e7
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion thriftpy/protocol/cybin/endian_port.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,32 @@ static inline int64_t bswap64(int64_t n) {
#define be64toh(n) bswap64(n)

#else
#include <endian.h>

#include <endian.h>
#include <byteswap.h>

#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

0 comments on commit 7c452e7

Please sign in to comment.