From: Mark Slee Date: Sat, 9 Jun 2007 01:23:04 +0000 (+0000) Subject: Darwin endianness junk X-Git-Tag: 0.2.0~1339 X-Git-Url: https://source.supwisdom.com/gerrit/gitweb?a=commitdiff_plain;h=1d2ead34a23602a1dd248648204bbbeea356bc0c;p=common%2Fthrift.git Darwin endianness junk Reviewed By: darwin Test Plan: build on OSX git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665133 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/lib/cpp/src/protocol/TProtocol.h b/lib/cpp/src/protocol/TProtocol.h index 47d74f81..a7560ca5 100644 --- a/lib/cpp/src/protocol/TProtocol.h +++ b/lib/cpp/src/protocol/TProtocol.h @@ -25,6 +25,16 @@ using facebook::thrift::transport::TTransport; #include #endif +#ifndef __BYTE_ORDER +# if defined(BYTE_ORDER) && defined(LITTLE_ENDIAN) && defined(BIG_ENDIAN) +# define __BYTE_ORDER BYTE_ORDER +# define __LITTLE_ENDIAN LITTLE_ENDIAN +# define __BIG_ENDIAN BIG_ENDIAN +# else +# error "Cannot determine endianness" +# endif +#endif + #if __BYTE_ORDER == __BIG_ENDIAN # define ntohll(n) (n) # define htonll(n) (n)