New way of sharing type information between modules for chicken, mzscheme,
ruby, tcl, and perl. git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@6332 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
19ea3b5242
commit
6ed2f7e90e
13 changed files with 203 additions and 84 deletions
|
|
@ -104,6 +104,24 @@ typedef struct swig_instance {
|
|||
#define SWIG_MethodCommand SWIG_Tcl_MethodCommand
|
||||
#define SWIG_ObjectDelete SWIG_Tcl_ObjectDelete
|
||||
|
||||
static void
|
||||
SWIG_Tcl_LookupTypePointer(Tcl_Interp *interp) {
|
||||
char buf[512];
|
||||
char *data;
|
||||
|
||||
/* first check if pointer already created */
|
||||
data = (char *) Tcl_GetVar(interp, "swig_runtime_data_type_pointer", TCL_GLOBAL_ONLY);
|
||||
if (data) {
|
||||
SWIG_UnpackData(data, &swig_type_list_handle, sizeof(swig_type_info **));
|
||||
} else {
|
||||
/* create a new pointer */
|
||||
data = SWIG_PackData(buf, &swig_type_list_handle, sizeof(swig_type_info **));
|
||||
*data = 0;
|
||||
Tcl_SetVar(interp, "swig_runtime_data_type_pointer", buf, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#ifdef SWIG_NOINCLUDE
|
||||
|
||||
SWIGIMPORT(int) SWIG_Tcl_ConvertPtrFromString(Tcl_Interp *, char *, void **, swig_type_info *,int flags);
|
||||
|
|
|
|||
|
|
@ -5,6 +5,24 @@
|
|||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
%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 */
|
||||
|
||||
%}
|
||||
%runtime "common.swg"
|
||||
%runtime "swigtcl8.swg"
|
||||
|
||||
|
|
@ -646,6 +664,9 @@ SWIGEXPORT(int) SWIG_init(Tcl_Interp *interp) {
|
|||
Tcl_Eval(interp, "namespace eval " SWIG_namespace " { }");
|
||||
#endif
|
||||
if (!_init) {
|
||||
#ifdef SWIG_DISABLE_RUNTIME
|
||||
SWIG_Tcl_LookupTypePointer(interp);
|
||||
#endif
|
||||
for (i = 0; swig_types_initial[i]; i++) {
|
||||
swig_types[i] = SWIG_TypeRegister(swig_types_initial[i]);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue