/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/python-compat.h

  • Committer: Jelmer Vernooij
  • Date: 2017-06-10 16:40:42 UTC
  • mfrom: (6653.6.7 rename-controldir)
  • mto: This revision was merged to the branch mainline in revision 6690.
  • Revision ID: jelmer@jelmer.uk-20170610164042-zrxqgy2htyduvke2
MergeĀ rename-controldirĀ branch.

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
 
/* 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;
31
 
    typedef Py_ssize_t (*lenfunc)(PyObject *);
32
 
    typedef PyObject * (*ssizeargfunc)(PyObject *, Py_ssize_t);
33
 
    typedef PyObject * (*ssizessizeargfunc)(PyObject *, Py_ssize_t, Py_ssize_t);
34
 
    #define PY_SSIZE_T_MAX INT_MAX
35
 
    #define PY_SSIZE_T_MIN INT_MIN
36
 
    #define PyInt_FromSsize_t(z) PyInt_FromLong(z)
37
 
    #define PyInt_AsSsize_t(o) PyInt_AsLong(o)
38
 
#endif
39
 
 
40
28
#if defined(_WIN32) || defined(WIN32)
41
29
    /* Defining WIN32_LEAN_AND_MEAN makes including windows quite a bit
42
30
     * lighter weight.
74
62
 
75
63
#ifdef _MSC_VER
76
64
#define  snprintf  _snprintf
77
 
#endif
78
 
 
79
 
/* Introduced in Python 2.6 */
80
 
#ifndef Py_TYPE
81
 
#  define Py_TYPE(o) ((o)->ob_type)
82
 
#endif
83
 
#ifndef Py_REFCNT
84
 
#  define Py_REFCNT(o) ((o)->ob_refcnt)
 
65
/* gcc (mingw32) has strtoll, while the MSVC compiler uses _strtoi64 */
 
66
#define strtoll _strtoi64
 
67
#define strtoull _strtoui64
85
68
#endif
86
69
 
87
70
#endif /* _BZR_PYTHON_COMPAT_H */