/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-07-23 22:06:41 UTC
  • mfrom: (6738 trunk)
  • mto: This revision was merged to the branch mainline in revision 6739.
  • Revision ID: jelmer@jelmer.uk-20170723220641-69eczax9bmv8d6kk
Merge trunk, address review comments.

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
 
 
66
 
/* Lazy hide Python 3.3 only functions, callers must avoid on 2.7 anyway */
67
 
#define PyUnicode_AsUTF8AndSize(u, size) NULL
68
49
 
69
50
#define PYMOD_ERROR
70
51
#define PYMOD_SUCCESS(val)
75
56
 
76
57
#endif
77
58
 
78
 
#define BrzPy_EnterRecursiveCall(where) (Py_EnterRecursiveCall(where) == 0)
79
 
 
80
59
#if defined(_WIN32) || defined(WIN32)
81
60
    /* Defining WIN32_LEAN_AND_MEAN makes including windows quite a bit
82
61
     * lighter weight.