PyVarObject_HEAD_INIT to conform to C standard - pointers cannot be used in static initializers
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12660 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
a52612f845
commit
63f21af8d0
1 changed files with 7 additions and 5 deletions
|
|
@ -143,7 +143,7 @@ swig_varlink_type(void) {
|
|||
const PyTypeObject tmp = {
|
||||
/* PyObject header changed in Python 3 */
|
||||
#if PY_VERSION_HEX >= 0x03000000
|
||||
PyVarObject_HEAD_INIT(&PyType_Type, 0)
|
||||
PyVarObject_HEAD_INIT(NULL, 0)
|
||||
#else
|
||||
PyObject_HEAD_INIT(NULL)
|
||||
0, /* ob_size */
|
||||
|
|
@ -186,11 +186,13 @@ swig_varlink_type(void) {
|
|||
#endif
|
||||
};
|
||||
varlink_type = tmp;
|
||||
/* for Python 3 we already assigned ob_type in PyVarObject_HEAD_INIT() */
|
||||
#if PY_VERSION_HEX < 0x03000000
|
||||
varlink_type.ob_type = &PyType_Type;
|
||||
#endif
|
||||
type_init = 1;
|
||||
#if PY_VERSION_HEX < 0x02020000
|
||||
varlink_type.ob_type = &PyType_Type;
|
||||
#else
|
||||
if (PyType_Ready(&varlink_type) < 0)
|
||||
return NULL;
|
||||
#endif
|
||||
}
|
||||
return &varlink_type;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue