more portability tricks

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@7934 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Marcelo Matus 2005-12-06 20:14:55 +00:00
commit a0f161b09d
2 changed files with 10 additions and 7 deletions

View file

@ -13,6 +13,14 @@ Version 1.3.28 (unreleased).
12/06/2005: mmatus 12/06/2005: mmatus
[Python] The generated code is now more portable, specially
for Windows. Following
http://www.python.org/doc/faq/windows.html
Py_None is never accessed as a structure, plus other
tricks mentioned there.
[Python] Added initial support for threads based in the [Python] Added initial support for threads based in the
proposal by Joseph Winston. proposal by Joseph Winston.

View file

@ -96,13 +96,10 @@ swig_varlink_setattr(swig_varlinkobject *v, char *n, PyObject *p) {
SWIGINTERN PyTypeObject* SWIGINTERN PyTypeObject*
swig_varlink_type(void) { swig_varlink_type(void) {
static char varlink__doc__[] = "Swig var link object"; static char varlink__doc__[] = "Swig var link object";
static PyTypeObject varlink_type static PyTypeObject varlink_type;
#if !defined(__cplusplus)
;
static int type_init = 0; static int type_init = 0;
if (!type_init) { if (!type_init) {
const PyTypeObject tmp const PyTypeObject tmp
#endif
= { = {
PyObject_HEAD_INIT(NULL) PyObject_HEAD_INIT(NULL)
0, /* Number of items in variable part (ob_size) */ 0, /* Number of items in variable part (ob_size) */
@ -140,12 +137,10 @@ swig_varlink_type(void) {
0,0,0,0 /* tp_alloc -> tp_next */ 0,0,0,0 /* tp_alloc -> tp_next */
#endif #endif
}; };
#if !defined(__cplusplus)
varlink_type = tmp; varlink_type = tmp;
varlink_type.ob_type = &PyType_Type;
type_init = 1; type_init = 1;
} }
#endif
varlink_type.ob_type = &PyType_Type;
return &varlink_type; return &varlink_type;
} }