- Add SWIG_RUNTIME_VERSION to new type sharing code. This is for future-proof, if

the format of swig_type_info ever changes, this number should be incremented
- Add SWIG_LINK_RUNTIME and SWIG_STATIC_RUNTIME symbols to python
- Convert inline into SWIGINLINE


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@6475 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
John Lenz 2004-10-21 21:53:54 +00:00
commit 0c57969c61
14 changed files with 140 additions and 41 deletions

View file

@ -181,7 +181,7 @@ SWIG_Python_TypeError(const char *type, PyObject *obj)
}
}
static inline void
static SWIGINLINE void
SWIG_Python_NullRef(const char *type)
{
if (type) {
@ -346,7 +346,7 @@ type_error:
}
/* Convert a pointer value, signal an exception on a type mismatch */
static inline void *
static void *
SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int argnum, int flags) {
void *result;
if (SWIG_Python_ConvertPtr(obj, &result, ty, flags) == -1) {
@ -539,16 +539,16 @@ SWIG_Python_LookupTypePointer(swig_type_info ***type_list_handle) {
void *type_pointer;
/* first check if module already created */
type_pointer = PyCObject_Import("swig_runtime_data", "type_pointer");
type_pointer = PyCObject_Import("swig_runtime_data" SWIG_RUNTIME_VERSION, "type_pointer" SWIG_TYPE_TABLE_NAME);
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);
module = Py_InitModule("swig_runtime_data" SWIG_RUNTIME_VERSION, NULL);
pointer = PyCObject_FromVoidPtr((void *) (*type_list_handle), NULL);
if (pointer && module) {
PyModule_AddObject(module, "type_pointer", pointer);
PyModule_AddObject(module, "type_pointer" SWIG_TYPE_TABLE_NAME, pointer);
}
}
}