Author: enrico
Date: Wed Sep  2 15:53:43 2015
New Revision: 246709

URL: http://llvm.org/viewvc/llvm-project?rev=246709&view=rev
Log:
We want Python int or long to both be usable as-a tid_t for API purposes. 
Introduce a typemap to this effect

Modified:
    lldb/trunk/scripts/Python/python-typemaps.swig

Modified: lldb/trunk/scripts/Python/python-typemaps.swig
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Python/python-typemaps.swig?rev=246709&r1=246708&r2=246709&view=diff
==============================================================================
--- lldb/trunk/scripts/Python/python-typemaps.swig (original)
+++ lldb/trunk/scripts/Python/python-typemaps.swig Wed Sep  2 15:53:43 2015
@@ -25,6 +25,18 @@
   }
 }
 
+%typemap(in) lldb::tid_t {
+    if (PyInt_Check($input))
+        $1 = PyInt_AsLong($input);
+    else if (PyLong_Check($input))
+        $1 = PyLong_AsLong($input);
+    else
+    {
+        PyErr_SetString(PyExc_ValueError, "Expecting an integer");
+        return NULL;
+    }
+}
+
 %typemap(typecheck) char ** {
   /* Check if is a list  */
   $1 = 1;


_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to