You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by dr...@apache.org on 2009/02/17 21:06:08 UTC

svn commit: r745223 - /incubator/thrift/trunk/lib/py/src/protocol/fastbinary.c

Author: dreiss
Date: Tue Feb 17 20:06:08 2009
New Revision: 745223

URL: http://svn.apache.org/viewvc?rev=745223&view=rev
Log:
THRIFT-340. python: Detect endianness properly on FreeBSD

Modified:
    incubator/thrift/trunk/lib/py/src/protocol/fastbinary.c

Modified: incubator/thrift/trunk/lib/py/src/protocol/fastbinary.c
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/lib/py/src/protocol/fastbinary.c?rev=745223&r1=745222&r2=745223&view=diff
==============================================================================
--- incubator/thrift/trunk/lib/py/src/protocol/fastbinary.c (original)
+++ incubator/thrift/trunk/lib/py/src/protocol/fastbinary.c Tue Feb 17 20:06:08 2009
@@ -50,6 +50,16 @@
   T_UTF16      = 17
 } TType;
 
+#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
+
 // Same comment as the enum.  Sorry.
 #if __BYTE_ORDER == __BIG_ENDIAN
 # define ntohll(n) (n)