2
#ifndef PYGPGME_COMPAT_H
3
#define PYGPGME_COMPAT_H
5
#if PY_VERSION_HEX < 0x02060000
7
# define PyVarObject_HEAD_INIT(type, size) \
8
PyObject_HEAD_INIT(type) size,
9
# define Py_TYPE(ob) (((PyObject*)(ob))->ob_type)
12
# define PyBytesObject PyStringObject
13
# define PyBytes_Type PyString_Type
15
# define PyBytes_Check PyString_Check
16
# define PyBytes_CheckExact PyString_CheckExact
17
# define PyBytes_CHECK_INTERNED PyString_CHECK_INTERNED
18
# define PyBytes_AS_STRING PyString_AS_STRING
19
# define PyBytes_GET_SIZE PyString_GET_SIZE
20
# define Py_TPFLAGS_BYTES_SUBCLASS Py_TPFLAGS_STRING_SUBCLASS
22
# define PyBytes_FromStringAndSize PyString_FromStringAndSize
23
# define PyBytes_FromString PyString_FromString
24
# define PyBytes_FromFormatV PyString_FromFormatV
25
# define PyBytes_FromFormat PyString_FromFormat
26
# define PyBytes_Size PyString_Size
27
# define PyBytes_AsString PyString_AsString
28
# define PyBytes_Repr PyString_Repr
29
# define PyBytes_Concat PyString_Concat
30
# define PyBytes_ConcatAndDel PyString_ConcatAndDel
31
# define PyBytes_Format PyString_Format
32
# define PyBytes_DecodeEscape PyString_DecodeEscape
33
# define PyBytes_Decode PyString_Decode
34
# define PyBytes_Encode PyString_Encode
35
# define PyBytes_AsEncodedObject PyString_AsEncodedObject
36
# define PyBytes_AsEncodedString PyString_AsEncodedString
37
# define PyBytes_AsDecodedObject PyString_AsDecodedObject
38
# define PyBytes_AsDecodedString PyString_AsDecodedString
39
# define PyBytes_AsStringAndSize PyString_AsStringAndSize
43
#if PY_VERSION_HEX > 0x03000000
44
/* Ugh. I'll need to fix this code, but the text/bytes changes take
46
# include <intobject.h>
49
#endif /* PYGPGME_COMPAT_H */