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>
#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;