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,46 +0,0 @@
|
|||
/*************************************************************** -*- c -*-
|
||||
* ruby/precommon.swg
|
||||
*
|
||||
* Rename all exported symbols from common.swg, to avoid symbol
|
||||
* clashes if multiple interpreters are included
|
||||
*
|
||||
************************************************************************/
|
||||
|
||||
#define SWIG_TypeRegister SWIG_Ruby_TypeRegister
|
||||
#define SWIG_TypeCheck SWIG_Ruby_TypeCheck
|
||||
#define SWIG_TypeCast SWIG_Ruby_TypeCast
|
||||
#define SWIG_TypeDynamicCast SWIG_Ruby_TypeDynamicCast
|
||||
#define SWIG_TypeName SWIG_Ruby_TypeName
|
||||
#define SWIG_TypePrettyName SWIG_Ruby_TypePrettyName
|
||||
#define SWIG_TypeQuery SWIG_Ruby_TypeQuery
|
||||
#define SWIG_TypeClientData SWIG_Ruby_TypeClientData
|
||||
#define SWIG_PackData SWIG_Ruby_PackData
|
||||
#define SWIG_UnpackData SWIG_Ruby_UnpackData
|
||||
|
||||
/* Also rename all exported symbols from rubydef.swig */
|
||||
|
||||
/* Common SWIG API */
|
||||
#define SWIG_ConvertPtr(obj, pp, type, flags) \
|
||||
SWIG_Ruby_ConvertPtr(obj, pp, type, flags)
|
||||
#define SWIG_NewPointerObj(p, type, flags) \
|
||||
SWIG_Ruby_NewPointerObj(p, type, flags)
|
||||
#define SWIG_MustGetPtr(p, type, argnum, flags) \
|
||||
SWIG_Ruby_MustGetPtr(p, type, argnum, flags)
|
||||
|
||||
/* Ruby-specific SWIG API */
|
||||
|
||||
#define SWIG_InitRuntime() \
|
||||
SWIG_Ruby_InitRuntime()
|
||||
#define SWIG_define_class(ty) \
|
||||
SWIG_Ruby_define_class(ty)
|
||||
#define SWIG_NewClassInstance(value, ty) \
|
||||
SWIG_Ruby_NewClassInstance(value, ty)
|
||||
#define SWIG_MangleStr(value) \
|
||||
SWIG_Ruby_MangleStr(value)
|
||||
#define SWIG_CheckConvert(value, ty) \
|
||||
SWIG_Ruby_CheckConvert(value, ty)
|
||||
#define SWIG_NewPackedObj(ptr, sz, ty) \
|
||||
SWIG_Ruby_NewPackedObj(ptr, sz, ty)
|
||||
#define SWIG_ConvertPacked(obj, ptr, sz, ty, flags) \
|
||||
SWIG_Ruby_ConvertPacked(obj, ptr, sz, ty, flags)
|
||||
|
||||
|
|
@ -5,38 +5,8 @@
|
|||
* ---------------------------------------------------------------------- */
|
||||
|
||||
%runtime "rubyhead.swg"
|
||||
%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"
|
||||
|
||||
%insert(runtime) %{
|
||||
#ifdef SWIG_NOINCLUDE
|
||||
%}
|
||||
%runtime "rubydec.swg"
|
||||
%insert(runtime) %{
|
||||
#else
|
||||
%}
|
||||
%runtime "rubydef.swg"
|
||||
%insert(runtime) %{
|
||||
#endif
|
||||
%}
|
||||
|
||||
#define %alias %feature("alias")
|
||||
#define %freefunc %feature("freefunc")
|
||||
|
|
|
|||
|
|
@ -1,19 +0,0 @@
|
|||
/* rubydec.swg -*- c -*- */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
SWIGIMPORT(void) SWIG_Ruby_InitRuntime(void);
|
||||
SWIGIMPORT(void) SWIG_Ruby_define_class(swig_type_info *);
|
||||
SWIGIMPORT(VALUE) SWIG_Ruby_NewPointerObj(void *, swig_type_info *, int);
|
||||
SWIGIMPORT(VALUE) SWIG_Ruby_NewClassInstance(VALUE, swig_type_info *);
|
||||
SWIGIMPORT(char *) SWIG_Ruby_MangleStr(VALUE);
|
||||
SWIGIMPORT(int) SWIG_Ruby_ConvertPtr(VALUE, void**, swig_type_info *, int);
|
||||
SWIGIMPORT(void *) SWIG_Ruby_MustGetPtr(VALUE, swig_type_info *, int, int);
|
||||
SWIGIMPORT(int) SWIG_Ruby_CheckConvert(VALUE, swig_type_info *);
|
||||
SWIGIMPORT(VALUE) SWIG_Ruby_NewPackedObj(void *ptr, int sz, swig_type_info *type);
|
||||
SWIGIMPORT(void) SWIG_Ruby_ConvertPacked(VALUE obj, void *ptr, int sz, swig_type_info *ty, int flags);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
@ -1,3 +1,28 @@
|
|||
/* Common SWIG API */
|
||||
#define SWIG_ConvertPtr(obj, pp, type, flags) \
|
||||
SWIG_Ruby_ConvertPtr(obj, pp, type, flags)
|
||||
#define SWIG_NewPointerObj(p, type, flags) \
|
||||
SWIG_Ruby_NewPointerObj(p, type, flags)
|
||||
#define SWIG_MustGetPtr(p, type, argnum, flags) \
|
||||
SWIG_Ruby_MustGetPtr(p, type, argnum, flags)
|
||||
|
||||
/* Ruby-specific SWIG API */
|
||||
|
||||
#define SWIG_InitRuntime() \
|
||||
SWIG_Ruby_InitRuntime()
|
||||
#define SWIG_define_class(ty) \
|
||||
SWIG_Ruby_define_class(ty)
|
||||
#define SWIG_NewClassInstance(value, ty) \
|
||||
SWIG_Ruby_NewClassInstance(value, ty)
|
||||
#define SWIG_MangleStr(value) \
|
||||
SWIG_Ruby_MangleStr(value)
|
||||
#define SWIG_CheckConvert(value, ty) \
|
||||
SWIG_Ruby_CheckConvert(value, ty)
|
||||
#define SWIG_NewPackedObj(ptr, sz, ty) \
|
||||
SWIG_Ruby_NewPackedObj(ptr, sz, ty)
|
||||
#define SWIG_ConvertPacked(obj, ptr, sz, ty, flags) \
|
||||
SWIG_Ruby_ConvertPacked(obj, ptr, sz, ty, flags)
|
||||
|
||||
/* rubydef.swg */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
|
@ -8,7 +33,7 @@ static VALUE _cSWIG_Pointer = Qnil;
|
|||
static VALUE swig_runtime_data_type_pointer = Qnil;
|
||||
|
||||
/* Initialize Ruby runtime support */
|
||||
SWIGRUNTIME(void)
|
||||
static void
|
||||
SWIG_Ruby_InitRuntime(void)
|
||||
{
|
||||
VALUE pointer;
|
||||
|
|
@ -17,7 +42,6 @@ SWIG_Ruby_InitRuntime(void)
|
|||
_mSWIG = rb_define_module("SWIG");
|
||||
}
|
||||
|
||||
#ifdef SWIG_DISABLE_RUNTIME
|
||||
/* first check if pointer already created */
|
||||
pointer = rb_gv_get("$swig_runtime_data_type_pointer");
|
||||
if (pointer != Qnil) {
|
||||
|
|
@ -29,11 +53,10 @@ SWIG_Ruby_InitRuntime(void)
|
|||
swig_runtime_data_type_pointer = Data_Wrap_Struct(cl, 0, 0, swig_type_list_handle);
|
||||
rb_define_readonly_variable("$swig_runtime_data_type_pointer", &swig_runtime_data_type_pointer);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Define Ruby class for C type */
|
||||
SWIGRUNTIME(void)
|
||||
static void
|
||||
SWIG_Ruby_define_class(swig_type_info *type)
|
||||
{
|
||||
VALUE klass;
|
||||
|
|
@ -48,7 +71,7 @@ SWIG_Ruby_define_class(swig_type_info *type)
|
|||
}
|
||||
|
||||
/* Create a new pointer object */
|
||||
SWIGRUNTIME(VALUE)
|
||||
static VALUE
|
||||
SWIG_Ruby_NewPointerObj(void *ptr, swig_type_info *type, int own)
|
||||
{
|
||||
char *klass_name;
|
||||
|
|
@ -74,7 +97,7 @@ SWIG_Ruby_NewPointerObj(void *ptr, swig_type_info *type, int own)
|
|||
}
|
||||
|
||||
/* Create a new class instance (always owned) */
|
||||
SWIGRUNTIME(VALUE)
|
||||
static VALUE
|
||||
SWIG_Ruby_NewClassInstance(VALUE klass, swig_type_info *type)
|
||||
{
|
||||
VALUE obj;
|
||||
|
|
@ -85,7 +108,7 @@ SWIG_Ruby_NewClassInstance(VALUE klass, swig_type_info *type)
|
|||
}
|
||||
|
||||
/* Get type mangle from class name */
|
||||
SWIGRUNTIME(char *)
|
||||
static char *
|
||||
SWIG_Ruby_MangleStr(VALUE obj)
|
||||
{
|
||||
VALUE stype = rb_iv_get(obj, "__swigtype__");
|
||||
|
|
@ -93,7 +116,7 @@ SWIG_Ruby_MangleStr(VALUE obj)
|
|||
}
|
||||
|
||||
/* Convert a pointer value */
|
||||
SWIGRUNTIME(int)
|
||||
static int
|
||||
SWIG_Ruby_ConvertPtr(VALUE obj, void **ptr, swig_type_info *ty, int flags)
|
||||
{
|
||||
char *c;
|
||||
|
|
@ -135,7 +158,7 @@ SWIG_Ruby_ConvertPtr(VALUE obj, void **ptr, swig_type_info *ty, int flags)
|
|||
}
|
||||
|
||||
/* Convert a pointer value, signal an exception on a type mismatch */
|
||||
SWIGRUNTIME(void *)
|
||||
static inline void *
|
||||
SWIG_Ruby_MustGetPtr(VALUE obj, swig_type_info *ty, int argnum, int flags)
|
||||
{
|
||||
void *result;
|
||||
|
|
@ -144,7 +167,7 @@ SWIG_Ruby_MustGetPtr(VALUE obj, swig_type_info *ty, int argnum, int flags)
|
|||
}
|
||||
|
||||
/* Check convert */
|
||||
SWIGRUNTIME(int)
|
||||
static inline int
|
||||
SWIG_Ruby_CheckConvert(VALUE obj, swig_type_info *ty)
|
||||
{
|
||||
char *c = SWIG_MangleStr(obj);
|
||||
|
|
@ -153,7 +176,7 @@ SWIG_Ruby_CheckConvert(VALUE obj, swig_type_info *ty)
|
|||
return SWIG_TypeCheck(c,ty) != 0;
|
||||
}
|
||||
|
||||
SWIGRUNTIME(VALUE)
|
||||
static VALUE
|
||||
SWIG_Ruby_NewPackedObj(void *ptr, int sz, swig_type_info *type) {
|
||||
char result[1024];
|
||||
char *r = result;
|
||||
|
|
@ -165,7 +188,7 @@ SWIG_Ruby_NewPackedObj(void *ptr, int sz, swig_type_info *type) {
|
|||
}
|
||||
|
||||
/* Convert a packed value value */
|
||||
SWIGRUNTIME(void)
|
||||
static void
|
||||
SWIG_Ruby_ConvertPacked(VALUE obj, void *ptr, int sz, swig_type_info *ty, int flags) {
|
||||
swig_type_info *tc;
|
||||
char *c;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue