/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: 2018-02-18 21:42:57 UTC
  • mto: This revision was merged to the branch mainline in revision 6859.
  • Revision ID: jelmer@jelmer.uk-20180218214257-jpevutp1wa30tz3v
Update TODO to reference Breezy, not Bazaar.

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
 
#ifdef _MSC_VER
29
 
#define inline __inline
30
 
#endif
31
 
 
32
28
#if PY_MAJOR_VERSION >= 3
33
29
 
34
30
#define PyInt_FromSsize_t PyLong_FromSsize_t
35
31
 
36
 
/* On Python 3 just don't intern bytes for now */
37
 
#define PyBytes_InternFromStringAndSize PyBytes_FromStringAndSize
38
 
 
39
32
/* In Python 3 the Py_TPFLAGS_CHECKTYPES behaviour is on by default */
40
33
#define Py_TPFLAGS_CHECKTYPES 0
41
34
 
53
46
 
54
47
#define PyBytes_Type PyString_Type
55
48
#define PyBytes_CheckExact PyString_CheckExact
56
 
#define PyBytes_FromStringAndSize PyString_FromStringAndSize
57
 
inline PyObject* PyBytes_InternFromStringAndSize(const char *v, Py_ssize_t len)
58
 
{
59
 
    PyObject *obj = PyString_FromStringAndSize(v, len);
60
 
    if (obj != NULL) {
61
 
        PyString_InternInPlace(&obj);
62
 
    }
63
 
    return obj;
64
 
}
65
49
 
66
50
/* Lazy hide Python 3.3 only functions, callers must avoid on 2.7 anyway */
67
51
#define PyUnicode_AsUTF8AndSize(u, size) NULL
75
59
 
76
60
#endif
77
61
 
78
 
#define BrzPy_EnterRecursiveCall(where) (Py_EnterRecursiveCall(where) == 0)
79
 
 
80
62
#if defined(_WIN32) || defined(WIN32)
81
63
    /* Defining WIN32_LEAN_AND_MEAN makes including windows quite a bit
82
64
     * lighter weight.