Mirror of the lttng-dev mailing list
 help / color / mirror / Atom feed
From: jeremie.galarneau@efficios.com (Jérémie Galarneau)
Subject: [lttng-dev] [PATCH lttng-tools 3/4] Extras: Redefined PyInt_AsSsize_T to PyLong_AsSsize_t.
Date: Mon, 14 Jan 2013 16:45:48 +0000	[thread overview]
Message-ID: <1358181949-23456-3-git-send-email-jeremie.galarneau@efficios.com> (raw)
In-Reply-To: <1358181949-23456-1-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 <jeremie.galarneau at efficios.com>
---
 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 <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;
-- 
1.8.1




  parent reply	other threads:[~2013-01-14 16:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-14 16:45 [lttng-dev] [PATCH lttng-tools 1/4] Extras: Added lttng.pyc to the clean section of the Python binding makefile Jérémie Galarneau
2013-01-14 16:45 ` [lttng-dev] [PATCH lttng-tools 2/4] Extras: Fix the undefined reference to md build error Jérémie Galarneau
2013-01-14 16:45 ` Jérémie Galarneau [this message]
2013-01-14 16:45 ` [lttng-dev] [PATCH lttng-tools 4/4] Extras: Fixed inconsistent use of space and tabs in lttng.i.in Jérémie Galarneau
2013-01-17 15:58 ` [lttng-dev] [PATCH lttng-tools 1/4] Extras: Added lttng.pyc to the clean section of the Python binding makefile David Goulet

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1358181949-23456-3-git-send-email-jeremie.galarneau@efficios.com \
    --to=jeremie.galarneau@efficios.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox