~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/python-compat.h

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2008-09-25 23:11:01 UTC
  • mfrom: (3737.1.1 trivial_python_compat)
  • Revision ID: pqm@pqm.ubuntu.com-20080925231101-586jot7uv08m41xo
(jam) combine the Py_ssize_t compatibility 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)