| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
#ifndef __PY_PYTHON_3_COMPAT__ |
| 22 |
#define __PY_PYTHON_3_COMPAT__ |
| 23 |
|
| 24 |
#if PY_MAJOR_VERSION > 2 |
| 25 |
|
| 26 |
#define PY_SSIZE_T_CLEAN |
| 27 |
|
| 28 |
#define PyEval_InitThreads Py_Initialize |
| 29 |
#define Py_InitModule3( name, methods, doc ) ( PyModule_Create( &py_pjsua_module ) ) |
| 30 |
|
| 31 |
#if PY_MINOR_VERSION >= 10 |
| 32 |
#define DL_EXPORT( x ) PyObject* |
| 33 |
#define init_pjsua( x ) PyInit__pjsua( x ) |
| 34 |
#define INIT_RETURN ( m ) |
| 35 |
#else |
| 36 |
#define DL_EXPORT( x ) void |
| 37 |
#define INIT_RETURN |
| 38 |
#endif |
| 39 |
|
| 40 |
#define PyString_FromStringAndSize( x, y ) PyUnicode_FromStringAndSize( x, y ) |
| 41 |
#define PyString_Check( x ) PyUnicode_Check( x ) |
| 42 |
#define PyString_FromString( x ) PyUnicode_FromString( x ) |
| 43 |
#define PyString_AsString( x ) ( ( char * )PyUnicode_AsUTF8( x ) ) |
| 44 |
#define PyString_AS_STRING( x ) ( ( char * )PyUnicode_AsUTF8( x ) ) |
| 45 |
#define PyString_GET_SIZE( x ) PyUnicode_GetLength( x ) |
| 46 |
#define PyString_Size( x ) PyUnicode_GetLength( x ) |
| 47 |
|
| 48 |
#define PyInt_AsLong( x ) PyLong_AsLong( x ) |
| 49 |
|
| 50 |
#endif |
| 51 |
|
| 52 |
#endif |