From 0b3f8bf2ceb438acecb700e8603fe8739a699dad Mon Sep 17 00:00:00 2001 From: Marcelo Matus Date: Tue, 5 Oct 2004 23:20:34 +0000 Subject: [PATCH] LookupTypePointer now as pyrun git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@6335 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- Lib/python/pyapi.swg | 26 -------------------------- Lib/python/pyrun.swg | 29 ++++++++++++++++++++++++++++- 2 files changed, 28 insertions(+), 27 deletions(-) diff --git a/Lib/python/pyapi.swg b/Lib/python/pyapi.swg index 2c5c3fd82..6cade6ad3 100644 --- a/Lib/python/pyapi.swg +++ b/Lib/python/pyapi.swg @@ -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 diff --git a/Lib/python/pyrun.swg b/Lib/python/pyrun.swg index 49dc38aa8..0c5c243e7 100644 --- a/Lib/python/pyrun.swg +++ b/Lib/python/pyrun.swg @@ -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 */