/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-11-06 01:18:08 UTC
  • mfrom: (7143 work)
  • mto: This revision was merged to the branch mainline in revision 7151.
  • Revision ID: jelmer@jelmer.uk-20181106011808-y870f4vq0ork3ahu
Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
 
30
30
#define PyInt_FromSsize_t PyLong_FromSsize_t
31
31
 
 
32
/* On Python 3 just don't intern bytes for now */
 
33
#define PyBytes_InternFromStringAndSize PyBytes_FromStringAndSize
 
34
 
32
35
/* In Python 3 the Py_TPFLAGS_CHECKTYPES behaviour is on by default */
33
36
#define Py_TPFLAGS_CHECKTYPES 0
34
37
 
46
49
 
47
50
#define PyBytes_Type PyString_Type
48
51
#define PyBytes_CheckExact PyString_CheckExact
 
52
#define PyBytes_FromStringAndSize PyString_FromStringAndSize
 
53
inline PyObject* PyBytes_InternFromStringAndSize(const char *v, Py_ssize_t len)
 
54
{
 
55
    PyObject *obj = PyString_FromStringAndSize(v, len);
 
56
    if (obj != NULL) {
 
57
        PyString_InternInPlace(&obj);
 
58
    }
 
59
    return obj;
 
60
}
49
61
 
50
62
/* Lazy hide Python 3.3 only functions, callers must avoid on 2.7 anyway */
51
63
#define PyUnicode_AsUTF8AndSize(u, size) NULL
59
71
 
60
72
#endif
61
73
 
 
74
#define BrzPy_EnterRecursiveCall(where) (Py_EnterRecursiveCall(where) == 0)
 
75
 
62
76
#if defined(_WIN32) || defined(WIN32)
63
77
    /* Defining WIN32_LEAN_AND_MEAN makes including windows quite a bit
64
78
     * lighter weight.