From: <wsf...@us...> - 2011-05-12 20:20:43
|
Revision: 12660 http://swig.svn.sourceforge.net/swig/?rev=12660&view=rev Author: wsfulton Date: 2011-05-12 20:20:36 +0000 (Thu, 12 May 2011) Log Message: ----------- PyVarObject_HEAD_INIT to conform to C standard - pointers cannot be used in static initializers Modified Paths: -------------- trunk/Lib/python/pyinit.swg Modified: trunk/Lib/python/pyinit.swg =================================================================== --- trunk/Lib/python/pyinit.swg 2011-05-08 06:54:21 UTC (rev 12659) +++ trunk/Lib/python/pyinit.swg 2011-05-12 20:20:36 UTC (rev 12660) @@ -143,7 +143,7 @@ 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 @@ #endif }; varlink_type = tmp; - /* for Python 3 we already assigned ob_type in PyVarObject_HEAD_INIT() */ -#if PY_VERSION_HEX < 0x03000000 + type_init = 1; +#if PY_VERSION_HEX < 0x02020000 varlink_type.ob_type = &PyType_Type; +#else + if (PyType_Ready(&varlink_type) < 0) + return NULL; #endif - type_init = 1; } return &varlink_type; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |