diff options
author | Marcelo Matus <mmatus@acms.arizona.edu> | 2004-12-11 23:38:44 +0000 |
---|---|---|
committer | Marcelo Matus <mmatus@acms.arizona.edu> | 2004-12-11 23:38:44 +0000 |
commit | 61b1dc73f5c80a53a289df993500513d9ce68327 (patch) | |
tree | 0f440b6b9aed5df9d7d1f931814f4389e5f11cab | |
parent | 7df3a0ab13af12809a1fd8f5bd4357a543c73bbc (diff) | |
download | swig-61b1dc73f5c80a53a289df993500513d9ce68327.tar.gz |
fix for Windows
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@6860 626c5289-ae23-0410-ae9c-e8d60b6d4f22
-rw-r--r-- | SWIG/Lib/python/pyrun.swg | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/SWIG/Lib/python/pyrun.swg b/SWIG/Lib/python/pyrun.swg index 5ca669bd3..97dff2efe 100644 --- a/SWIG/Lib/python/pyrun.swg +++ b/SWIG/Lib/python/pyrun.swg @@ -169,7 +169,11 @@ PySwigObject_GetType() { #endif }; - static PyTypeObject PySwigObject_Type = { + static int type_init = 0; + static PyTypeObject PySwigObject_Type; + + if (!type_init) { + PyTypeObject tmp = { PyObject_HEAD_INIT(&PyType_Type) 0, /*ob_size*/ "PySwigObject", /*tp_name*/ @@ -208,7 +212,11 @@ PySwigObject_GetType() { #ifdef COUNT_ALLOCS 0,0,0,0 /* tp_alloc -> tp_next */ #endif - }; + }; + + PySwigObject_Type = tmp; + type_init = 1; + } return &PySwigObject_Type; } @@ -313,8 +321,11 @@ SWIGRUNTIME PyTypeObject* PySwigPacked_GetType() { static char PySwigPacked_Type__doc__[] = "Swig object carries a C/C++ instance pointer"; + static int type_init = 0; - static PyTypeObject PySwigPacked_Type = { + static PyTypeObject PySwigPacked_Type; + if (!type_init) { + PyTypeObject tmp = { PyObject_HEAD_INIT(&PyType_Type) 0, /*ob_size*/ "PySwigPacked", /*tp_name*/ @@ -353,7 +364,13 @@ PySwigPacked_GetType() { #ifdef COUNT_ALLOCS 0,0,0,0 /* tp_alloc -> tp_next */ #endif - }; + }; + + PySwigPacked_Type = tmp; + type_init = 1; + } + + return &PySwigPacked_Type; } |