~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/python-compat.h

  • Committer: John Arbash Meinel
  • Date: 2008-09-25 22:08:41 UTC
  • mto: This revision was merged to the branch mainline in revision 3738.
  • Revision ID: john@arbash-meinel.com-20080925220841-3kfmu3tjv5g97xc6
Bring the Py_ssize_t compatability code together.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
#ifndef _BZR_PYTHON_COMPAT_H
26
26
#define _BZR_PYTHON_COMPAT_H
27
27
 
28
 
#if PY_VERSION_HEX < 0x02050000
29
 
  typedef int Py_ssize_t;
 
28
/* http://www.python.org/dev/peps/pep-0353/ */
 
29
#if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN)
 
30
    typedef int Py_ssize_t;
30
31
    #define PY_SSIZE_T_MAX INT_MAX
31
32
    #define PY_SSIZE_T_MIN INT_MIN
32
33
    #define PyInt_FromSsize_t(z) PyInt_FromLong(z)