From: David Reiss Date: Sun, 26 Aug 2007 02:21:24 +0000 (+0000) Subject: Thrift: Fix fastbinary.c for Python 2.4. X-Git-Tag: 0.2.0~1247 X-Git-Url: https://source.supwisdom.com/gerrit/gitweb?a=commitdiff_plain;h=5ec8e26d25dc459041e7c31aa2c65eff4f70ad4e;p=common%2Fthrift.git Thrift: Fix fastbinary.c for Python 2.4. Summary: The recently committed fastbinary.c doesn't compile with Python 2.4. This version does. Blame Rev: 56816 Reviewed By: mcslee Test Plan: make install on devrs004 Revert Plan: Do 56816 also. git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665225 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/lib/py/src/protocol/fastbinary.c b/lib/py/src/protocol/fastbinary.c index cfc504e9..8a04836b 100644 --- a/lib/py/src/protocol/fastbinary.c +++ b/lib/py/src/protocol/fastbinary.c @@ -73,6 +73,11 @@ typedef enum TType { #define INT_CONV_ERROR_OCCURRED(v) ( ((v) == -1) && PyErr_Occurred() ) #define CHECK_RANGE(v, min, max) ( ((v) <= (max)) && ((v) >= (min)) ) +// Py_ssize_t was not defined before Python 2.5 +#if (PY_VERSION_HEX < 0x02050000) +typedef int Py_ssize_t; +#endif + /** * A cache of the spec_args for a set or list, * so we don't have to keep calling PyTuple_GET_ITEM.