Rev 3738: Bring the Py_ssize_t compatability code together. in http://bzr.arbash-meinel.com/branches/bzr/1.8-dev/trivial_python_compat

John Arbash Meinel john at arbash-meinel.com
Thu Sep 25 23:08:53 BST 2008


At http://bzr.arbash-meinel.com/branches/bzr/1.8-dev/trivial_python_compat

------------------------------------------------------------
revno: 3738
revision-id: john at arbash-meinel.com-20080925220841-3kfmu3tjv5g97xc6
parent: pqm at pqm.ubuntu.com-20080925075516-olnl5p5au2u1ml5v
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: trivial_python_compat
timestamp: Thu 2008-09-25 17:08:41 -0500
message:
  Bring the Py_ssize_t compatability code together.
-------------- next part --------------
=== modified file 'bzrlib/_patiencediff_c.c'
--- a/bzrlib/_patiencediff_c.c	2008-08-17 19:39:54 +0000
+++ b/bzrlib/_patiencediff_c.c	2008-09-25 22:08:41 +0000
@@ -27,13 +27,7 @@
 #include <string.h>
 #include <Python.h>
 
-
-/* http://www.python.org/dev/peps/pep-0353/ */
-#if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN)
-typedef int Py_ssize_t;
-#define PY_SSIZE_T_MAX INT_MAX
-#define PY_SSIZE_T_MIN INT_MIN
-#endif
+#include "python-compat.h"
 
 
 #if defined(__GNUC__)

=== modified file 'bzrlib/python-compat.h'
--- a/bzrlib/python-compat.h	2008-09-24 04:15:03 +0000
+++ b/bzrlib/python-compat.h	2008-09-25 22:08:41 +0000
@@ -25,8 +25,9 @@
 #ifndef _BZR_PYTHON_COMPAT_H
 #define _BZR_PYTHON_COMPAT_H
 
-#if PY_VERSION_HEX < 0x02050000
-  typedef int Py_ssize_t;
+/* http://www.python.org/dev/peps/pep-0353/ */
+#if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN)
+    typedef int Py_ssize_t;
     #define PY_SSIZE_T_MAX INT_MAX
     #define PY_SSIZE_T_MIN INT_MIN
     #define PyInt_FromSsize_t(z) PyInt_FromLong(z)



More information about the bazaar-commits mailing list