LookupTypePointer now as pyrun
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@6335 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
ed25a4df08
commit
0b3f8bf2ce
2 changed files with 28 additions and 27 deletions
|
|
@ -115,32 +115,6 @@ typedef struct swig_const_info {
|
|||
#define SWIG_NEWOBJ SWIG_OLDOBJ + 1
|
||||
#define SWIG_PYSTR SWIG_NEWOBJ + 1
|
||||
|
||||
|
||||
#ifdef SWIG_DISABLE_RUNTIME
|
||||
/* -----------------------------------------------------------------------------
|
||||
* Lookup type pointer
|
||||
* ----------------------------------------------------------------------------- */
|
||||
SWIGINTERN void
|
||||
SWIG_Python_LookupTypePointer(swig_type_info ***type_list_handle) {
|
||||
PyObject *module, *pointer;
|
||||
void *type_pointer;
|
||||
|
||||
/* first check if module already created */
|
||||
type_pointer = PyCObject_Import("swig_runtime_data", "type_pointer");
|
||||
if (type_pointer) {
|
||||
*type_list_handle = (swig_type_info **) type_pointer;
|
||||
} else {
|
||||
PyErr_Clear();
|
||||
/* create a new module and variable */
|
||||
module = Py_InitModule("swig_runtime_data", NULL);
|
||||
pointer = PyCObject_FromVoidPtr((void *) (*type_list_handle), NULL);
|
||||
if (pointer && module) {
|
||||
PyModule_AddObject(module, "type_pointer", pointer);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif /* SWIG_DISABLE_RUNTIME */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -38,7 +38,9 @@ SWIGIMPORT(int) SWIG_Python_AddErrMesg(const char* mesg, int infront);
|
|||
SWIGIMPORT(int) SWIG_Python_ArgFail(int argnum);
|
||||
SWIGIMPORT(void) SWIG_Python_TypeError(const char *type, PyObject *obj);
|
||||
SWIGIMPORT(void) SWIG_Python_NullRef(const char *type);
|
||||
|
||||
|
||||
SWIGRUNTIME(void) SWIG_Python_LookupTypePointer(swig_type_info ***type_list_handle);
|
||||
|
||||
#else /* SWIG_NOINCLUDE */
|
||||
|
||||
/* -----------------------------------------------------------------------------
|
||||
|
|
@ -546,6 +548,31 @@ SWIG_Python_FixMethods(PyMethodDef *methods,
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* -----------------------------------------------------------------------------
|
||||
* Lookup type pointer
|
||||
* ----------------------------------------------------------------------------- */
|
||||
SWIGRUNTIME(void)
|
||||
SWIG_Python_LookupTypePointer(swig_type_info ***type_list_handle) {
|
||||
PyObject *module, *pointer;
|
||||
void *type_pointer;
|
||||
|
||||
/* first check if module already created */
|
||||
type_pointer = PyCObject_Import("swig_runtime_data", "type_pointer");
|
||||
if (type_pointer) {
|
||||
*type_list_handle = (swig_type_info **) type_pointer;
|
||||
} else {
|
||||
PyErr_Clear();
|
||||
/* create a new module and variable */
|
||||
module = Py_InitModule("swig_runtime_data", NULL);
|
||||
pointer = PyCObject_FromVoidPtr((void *) (*type_list_handle), NULL);
|
||||
if (pointer && module) {
|
||||
PyModule_AddObject(module, "type_pointer", pointer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* SWIG_NOINCLUDE */
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue