From 6c7ee73ef9b93eb6bd4381a4a4dfc96d45b7d401 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Mon, 14 Jan 2013 16:45:48 +0000 Subject: [PATCH] Extras: Redefined PyInt_AsSsize_T to PyLong_AsSsize_t. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: David Goulet --- 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 0d6d1e952..244bc2282 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; -- 2.34.1