fix SWIG_Python_TypeQuery for C/Ansi, ie, the old variable declared after code issue

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8967 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Marcelo Matus 2006-03-06 05:59:54 +00:00
commit 7a5c6d8e90

View file

@ -1320,11 +1320,16 @@ SWIG_Python_SetModule(swig_module_info *swig_module) {
}
/* The python cached type query */
SWIGRUNTIME PyObject *
SWIG_Python_TypeCache() {
static PyObject *SWIG_STATIC_POINTER(cache) = PyDict_New();
return cache;
}
SWIGRUNTIME swig_type_info *
SWIG_Python_TypeQuery(const char *type)
{
static PyObject *SWIG_STATIC_POINTER(cache) = PyDict_New();
PyObject *cache = SWIG_Python_TypeCache();
PyObject *key = PyString_FromString(type);
PyObject *obj = PyDict_GetItem(cache, key);
swig_type_info *descriptor;