Extras: Redefined PyInt_AsSsize_T to PyLong_AsSsize_t.
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Mon, 14 Jan 2013 16:45:48 +0000 (16:45 +0000)
committerDavid Goulet <dgoulet@efficios.com>
Thu, 17 Jan 2013 15:55:09 +0000 (10:55 -0500)
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 <jeremie.galarneau@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
extras/bindings/swig/python/lttng.i.in

index 0d6d1e952634c0fcc5bbc1ef9045081d87bd558b..244bc2282da9639a432ba9820c9d787a56909d0f 100644 (file)
@@ -15,6 +15,14 @@ multiple concurrent processes and threads. Tracing across multiple systems is al
 #include <lttng/lttng.h>
 %}
 
+%{
+#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;
This page took 0.026067 seconds and 4 git commands to generate.