From mboxrd@z Thu Jan 1 00:00:00 1970 From: jeremie.galarneau@efficios.com (=?UTF-8?q?J=C3=A9r=C3=A9mie=20Galarneau?=) Date: Mon, 14 Jan 2013 16:45:48 +0000 Subject: [lttng-dev] [PATCH lttng-tools 3/4] Extras: Redefined PyInt_AsSsize_T to PyLong_AsSsize_t. In-Reply-To: <1358181949-23456-1-git-send-email-jeremie.galarneau@efficios.com> References: <1358181949-23456-1-git-send-email-jeremie.galarneau@efficios.com> Message-ID: <1358181949-23456-3-git-send-email-jeremie.galarneau@efficios.com> Python 3 merges PyInt and PyLong types. This fixes the undefined symbol error encountered when using the bindings with Python 3. Signed-off-by: J?r?mie Galarneau --- extras/bindings/swig/python/lttng.i.in | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/extras/bindings/swig/python/lttng.i.in b/extras/bindings/swig/python/lttng.i.in index 0d6d1e9..244bc22 100644 --- a/extras/bindings/swig/python/lttng.i.in +++ b/extras/bindings/swig/python/lttng.i.in @@ -15,6 +15,14 @@ multiple concurrent processes and threads. Tracing across multiple systems is al #include %} +%{ +#if PY_MAJOR_VERSION >= 3 +// The PyInt and PyLong types were unified as of Python 3 +// This makes the typemap code useable with both Python 2 and 3. +#define PyInt_AsSsize_t PyLong_AsSsize_t +#endif +%} + typedef unsigned int uint32_t; typedef int int32_t; typedef unsigned long long uint64_t; -- 1.8.1