Removed ability to share type information by C linking
All type sharing happens through a global variable in the target language. git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@6390 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
02cffc8047
commit
75e462baa8
50 changed files with 204 additions and 1162 deletions
|
|
@ -1,19 +0,0 @@
|
|||
/*************************************************************** -*- c -*-
|
||||
* python/precommon.swg
|
||||
*
|
||||
* Rename all exported symbols from common.swg, to avoid symbol
|
||||
* clashes if multiple interpreters are included
|
||||
*
|
||||
************************************************************************/
|
||||
|
||||
#define SWIG_TypeRegister SWIG_Python_TypeRegister
|
||||
#define SWIG_TypeCheck SWIG_Python_TypeCheck
|
||||
#define SWIG_TypeCast SWIG_Python_TypeCast
|
||||
#define SWIG_TypeDynamicCast SWIG_Python_TypeDynamicCast
|
||||
#define SWIG_TypeName SWIG_Python_TypeName
|
||||
#define SWIG_TypePrettyName SWIG_Python_TypePrettyName
|
||||
#define SWIG_TypeQuery SWIG_Python_TypeQuery
|
||||
#define SWIG_TypeClientData SWIG_Python_TypeClientData
|
||||
#define SWIG_PackData SWIG_Python_PackData
|
||||
#define SWIG_UnpackData SWIG_Python_UnpackData
|
||||
|
||||
|
|
@ -22,9 +22,7 @@ SWIGEXPORT(void) SWIG_init(void) {
|
|||
d = PyModule_GetDict(m);
|
||||
|
||||
if (!typeinit) {
|
||||
#ifdef SWIG_DISABLE_RUNTIME
|
||||
SWIG_Python_LookupTypePointer(&swig_type_list_handle);
|
||||
#endif
|
||||
for (i = 0; swig_types_initial[i]; i++) {
|
||||
swig_types[i] = SWIG_TypeRegister(swig_types_initial[i]);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,37 +12,6 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef SWIG_NOINCLUDE
|
||||
|
||||
/* -----------------------------------------------------------------------------
|
||||
* SWIG extern declarations
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
|
||||
SWIGIMPORT(int) SWIG_Python_ConvertPtr(PyObject *, void **, swig_type_info *, int);
|
||||
SWIGIMPORT(PyObject *) SWIG_Python_NewPointerObj(void *, swig_type_info *,int own);
|
||||
SWIGIMPORT(void *) SWIG_Python_MustGetPtr(PyObject *, swig_type_info *, int, int);
|
||||
SWIGIMPORT(PyObject *) SWIG_Python_newvarlink(void);
|
||||
SWIGIMPORT(void) SWIG_Python_addvarlink(PyObject *, char *, PyObject *(*)(void), int (*)(PyObject *));
|
||||
SWIGIMPORT(int) SWIG_Python_ConvertPacked(PyObject *, void *, size_t sz, swig_type_info *, int);
|
||||
SWIGIMPORT(PyObject *) SWIG_Python_NewPackedObj(void *, size_t sz, swig_type_info *);
|
||||
SWIGIMPORT(void) SWIG_Python_InstallConstants(PyObject *d, swig_const_info constants[]);
|
||||
SWIGIMPORT(char *) SWIG_Python_PointerStr(char *buff, void *ptr, const char *name, size_t bsz);
|
||||
SWIGIMPORT(void) SWIG_Python_FixMethods(PyMethodDef *methods,
|
||||
swig_const_info *const_table,
|
||||
swig_type_info **types,
|
||||
swig_type_info **types_initial);
|
||||
|
||||
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 */
|
||||
|
||||
/* -----------------------------------------------------------------------------
|
||||
* global variable support code.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
|
@ -166,7 +135,7 @@ static PyTypeObject varlinktype = {
|
|||
};
|
||||
|
||||
/* Create a variable linking object for use later */
|
||||
SWIGRUNTIME(PyObject *)
|
||||
static PyObject *
|
||||
SWIG_Python_newvarlink(void) {
|
||||
swig_varlinkobject *result = 0;
|
||||
result = PyMem_NEW(swig_varlinkobject,1);
|
||||
|
|
@ -178,7 +147,7 @@ SWIG_Python_newvarlink(void) {
|
|||
return ((PyObject*) result);
|
||||
}
|
||||
|
||||
SWIGRUNTIME(void)
|
||||
static void
|
||||
SWIG_Python_addvarlink(PyObject *p, char *name, PyObject *(*get_attr)(void), int (*set_attr)(PyObject *p)) {
|
||||
swig_varlinkobject *v;
|
||||
swig_globalvar *gv;
|
||||
|
|
@ -196,7 +165,7 @@ SWIG_Python_addvarlink(PyObject *p, char *name, PyObject *(*get_attr)(void), int
|
|||
* errors manipulation
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
SWIGRUNTIME(void)
|
||||
static void
|
||||
SWIG_Python_TypeError(const char *type, PyObject *obj)
|
||||
{
|
||||
const char *otype = (obj ? obj->ob_type->tp_name : 0);
|
||||
|
|
@ -212,7 +181,7 @@ SWIG_Python_TypeError(const char *type, PyObject *obj)
|
|||
}
|
||||
}
|
||||
|
||||
SWIGRUNTIME(void)
|
||||
static inline void
|
||||
SWIG_Python_NullRef(const char *type)
|
||||
{
|
||||
if (type) {
|
||||
|
|
@ -222,7 +191,7 @@ SWIG_Python_NullRef(const char *type)
|
|||
}
|
||||
}
|
||||
|
||||
SWIGRUNTIME(int)
|
||||
static int
|
||||
SWIG_Python_AddErrMesg(const char* mesg, int infront)
|
||||
{
|
||||
if (PyErr_Occurred()) {
|
||||
|
|
@ -247,7 +216,7 @@ SWIG_Python_AddErrMesg(const char* mesg, int infront)
|
|||
}
|
||||
}
|
||||
|
||||
SWIGRUNTIME(int)
|
||||
static int
|
||||
SWIG_Python_ArgFail(int argnum)
|
||||
{
|
||||
if (PyErr_Occurred()) {
|
||||
|
|
@ -266,7 +235,7 @@ SWIG_Python_ArgFail(int argnum)
|
|||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
/* Convert a pointer value */
|
||||
SWIGRUNTIME(int)
|
||||
static int
|
||||
SWIG_Python_ConvertPtr(PyObject *obj, void **ptr, swig_type_info *ty, int flags) {
|
||||
swig_type_info *tc;
|
||||
char *c = 0;
|
||||
|
|
@ -376,7 +345,7 @@ type_error:
|
|||
}
|
||||
|
||||
/* Convert a pointer value, signal an exception on a type mismatch */
|
||||
SWIGRUNTIME(void *)
|
||||
static inline 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) {
|
||||
|
|
@ -390,7 +359,7 @@ SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int argnum, int flags)
|
|||
}
|
||||
|
||||
/* Convert a packed value value */
|
||||
SWIGRUNTIME(int)
|
||||
static int
|
||||
SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, size_t sz, swig_type_info *ty, int flags) {
|
||||
swig_type_info *tc;
|
||||
char *c = 0;
|
||||
|
|
@ -420,7 +389,7 @@ type_error:
|
|||
}
|
||||
|
||||
/* Create a new pointer string */
|
||||
SWIGRUNTIME(char *)
|
||||
static char *
|
||||
SWIG_Python_PointerStr(char *buff, void *ptr, const char *name, size_t bsz) {
|
||||
char *r = buff;
|
||||
if ((2*sizeof(void *) + 2) > bsz) return 0;
|
||||
|
|
@ -433,7 +402,7 @@ SWIG_Python_PointerStr(char *buff, void *ptr, const char *name, size_t bsz) {
|
|||
|
||||
|
||||
/* Create a new pointer object */
|
||||
SWIGRUNTIME(PyObject *)
|
||||
static PyObject *
|
||||
SWIG_Python_NewPointerObj(void *ptr, swig_type_info *type, int own) {
|
||||
PyObject *robj;
|
||||
if (!ptr) {
|
||||
|
|
@ -466,7 +435,7 @@ SWIG_Python_NewPointerObj(void *ptr, swig_type_info *type, int own) {
|
|||
return robj;
|
||||
}
|
||||
|
||||
SWIGRUNTIME(PyObject *)
|
||||
static PyObject *
|
||||
SWIG_Python_NewPackedObj(void *ptr, size_t sz, swig_type_info *type) {
|
||||
char result[1024];
|
||||
char *r = result;
|
||||
|
|
@ -483,7 +452,7 @@ SWIG_Python_NewPackedObj(void *ptr, size_t sz, swig_type_info *type) {
|
|||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
/* Install Constants */
|
||||
SWIGRUNTIME(void)
|
||||
static void
|
||||
SWIG_Python_InstallConstants(PyObject *d, swig_const_info constants[]) {
|
||||
int i;
|
||||
PyObject *obj;
|
||||
|
|
@ -521,7 +490,7 @@ SWIG_Python_InstallConstants(PyObject *d, swig_const_info constants[]) {
|
|||
}
|
||||
|
||||
/* Fix SwigMethods to carry the callback ptrs when needed */
|
||||
SWIGRUNTIME(void)
|
||||
static void
|
||||
SWIG_Python_FixMethods(PyMethodDef *methods,
|
||||
swig_const_info *const_table,
|
||||
swig_type_info **types,
|
||||
|
|
@ -563,7 +532,7 @@ SWIG_Python_FixMethods(PyMethodDef *methods,
|
|||
/* -----------------------------------------------------------------------------
|
||||
* Lookup type pointer
|
||||
* ----------------------------------------------------------------------------- */
|
||||
SWIGRUNTIME(void)
|
||||
static void
|
||||
SWIG_Python_LookupTypePointer(swig_type_info ***type_list_handle) {
|
||||
PyObject *module, *pointer;
|
||||
void *type_pointer;
|
||||
|
|
@ -583,9 +552,6 @@ SWIG_Python_LookupTypePointer(swig_type_info ***type_list_handle) {
|
|||
}
|
||||
}
|
||||
|
||||
#endif /* SWIG_NOINCLUDE */
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -4,25 +4,6 @@
|
|||
#include <Python.h>
|
||||
%}
|
||||
|
||||
%insert(runtime) "precommon.swg";
|
||||
%insert(runtime) %{
|
||||
|
||||
#ifndef SWIG_ALLOW_RUNTIME
|
||||
/* -----------------------------------------------------------------------------
|
||||
* Disable runtime library use, everything is used as static
|
||||
* ----------------------------------------------------------------------------- */
|
||||
#ifndef SWIG_DISABLE_RUNTIME
|
||||
#define SWIG_DISABLE_RUNTIME
|
||||
#endif
|
||||
#ifdef SWIG_GLOBAL
|
||||
#undef SWIG_GLOBAL
|
||||
#endif
|
||||
#ifdef SWIG_NOINCLUDE
|
||||
#undef SWIG_NOINCLUDE
|
||||
#endif
|
||||
#endif /* SWIG_ALLOW_RUNTIME */
|
||||
|
||||
%}
|
||||
%insert(runtime) "common.swg"; /* Common type-checking code */
|
||||
%insert(runtime) "pyapi.swg"; /* SWIG/Pyton API */
|
||||
%insert(runtime) "pyrun.swg"; /* Python run-time code */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue