blob: a9e8e5cb90f4065c3e2741ab1e3f483d7f4ec7bb [file] [log] [blame]
Jean-Paul Calderoneef853eb2010-08-10 19:47:06 -04001#ifndef PyOpenSSL_PY3K_H_
2#define PyOpenSSL_PY3K_H_
3
4#if (PY_VERSION_HEX >= 0x03000000)
5
6#define PY3
7
8#define PyOpenSSL_MODINIT(name) \
9PyMODINIT_FUNC \
10PyInit_##name(void)
11
12#define PyText_FromString PyUnicode_FromString
13
14#else /* (PY_VERSION_HEX >= 0x03000000) */
15
16#define PyBytes_FromStringAndSize PyString_FromStringAndSize
17
18#define PyLong_FromLong PyInt_FromLong
19
20#define PyBytes_Size PyString_Size
21#define PyBytes_Check PyString_Check
22#define PyBytes_AsString PyString_AsString
23#define PyBytes_FromStringAndSize PyString_FromStringAndSize
24
25#define PyText_FromString PyString_FromString
26
27#define PyOpenSSL_MODINIT(name)
28void \
29init##name(void)
30
31#endif /* (PY_VERSION_HEX >= 0x03000000) */
32
33#endif /* PyOpenSSL_PY3K_H_ */
34