Remove symbol clashes between runtime libraries.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5181 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
4a30a92fb1
commit
3e216a67dc
8 changed files with 80 additions and 26 deletions
|
|
@ -10,6 +10,7 @@
|
|||
#include "chicken.h"
|
||||
%}
|
||||
|
||||
%insert(runtime) "precommon.swg"
|
||||
%insert(runtime) "common.swg"; // Common type-checking code
|
||||
%insert(runtime) "chickenrun.swg"; // CHICKEN run-time code
|
||||
|
||||
|
|
|
|||
16
SWIG/Lib/chicken/precommon.swg
Normal file
16
SWIG/Lib/chicken/precommon.swg
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
/*************************************************************** -*- c -*-
|
||||
* chicken/precommon.swg
|
||||
*
|
||||
* Rename all exported symbols from common.swg, to avoid symbol
|
||||
* clashes if multiple interpreters are included
|
||||
*
|
||||
************************************************************************/
|
||||
|
||||
#define SWIG_TypeRegister SWIG_Chicken_TypeRegister
|
||||
#define SWIG_TypeCheck SWIG_Chicken_TypeCheck
|
||||
#define SWIG_TypeCast SWIG_Chicken_TypeCast
|
||||
#define SWIG_TypeDynamicCast SWIG_Chicken_TypeDynamicCast
|
||||
#define SWIG_TypeName SWIG_Chicken_TypeName
|
||||
#define SWIG_TypeQuery SWIG_Chicken_TypeQuery
|
||||
#define SWIG_TypeClientData SWIG_Chicken_TypeClientData
|
||||
|
||||
|
|
@ -3,6 +3,7 @@
|
|||
with SCM_ flavor.
|
||||
*/
|
||||
|
||||
%runtime "precommon.swg"
|
||||
%runtime "common.swg"
|
||||
%runtime "guile_scm_run.swg"
|
||||
%include "ghinterface.i"
|
||||
|
|
|
|||
16
SWIG/Lib/guile/precommon.swg
Normal file
16
SWIG/Lib/guile/precommon.swg
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
/*************************************************************** -*- c -*-
|
||||
* guile/precommon.swg
|
||||
*
|
||||
* Rename all exported symbols from common.swg, to avoid symbol
|
||||
* clashes if multiple interpreters are included
|
||||
*
|
||||
************************************************************************/
|
||||
|
||||
#define SWIG_TypeRegister SWIG_Guile_TypeRegister
|
||||
#define SWIG_TypeCheck SWIG_Guile_TypeCheck
|
||||
#define SWIG_TypeCast SWIG_Guile_TypeCast
|
||||
#define SWIG_TypeDynamicCast SWIG_Guile_TypeDynamicCast
|
||||
#define SWIG_TypeName SWIG_Guile_TypeName
|
||||
#define SWIG_TypeQuery SWIG_Guile_TypeQuery
|
||||
#define SWIG_TypeClientData SWIG_Guile_TypeClientData
|
||||
|
||||
|
|
@ -14,21 +14,35 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Common SWIG API */
|
||||
|
||||
#define SWIG_ConvertPtr(s, result, type, flags) \
|
||||
SWIG_MzScheme_ConvertPtr(s, result, type, flags)
|
||||
#define SWIG_NewPointerObj(ptr, type, owner) \
|
||||
SWIG_MzScheme_NewPointerObj((void *)ptr, type, owner)
|
||||
#define SWIG_MustGetPtr(s, type, argnum, flags) \
|
||||
SWIG_MzScheme_MustGetPtr(s, type, argnum, flags, FUNC_NAME, argc, argv)
|
||||
|
||||
/* MzScheme-specific SWIG API */
|
||||
|
||||
#define SWIG_malloc(size) SWIG_MzScheme_Malloc(size, FUNC_NAME)
|
||||
#define SWIG_free(mem) free(mem)
|
||||
|
||||
#define MAXVALUES 6
|
||||
#define swig_make_boolean(b) (b ? scheme_true : scheme_false)
|
||||
|
||||
#ifdef SWIG_NOINCLUDE
|
||||
|
||||
SWIGIMPORT(void) SWIG_Mzscheme_Init();
|
||||
SWIGIMPORT(void) SWIG_MzScheme_Init();
|
||||
/* If there is a type-mismatch, return nonzero; on success, return 0. */
|
||||
SWIGIMPORT(int) SWIG_Mzscheme_ConvertPtr(Scheme_Object *s, void **result, swig_type_info *type, int flags);
|
||||
SWIGIMPORT(int) SWIG_MzScheme_ConvertPtr(Scheme_Object *s, void **result, swig_type_info *type, int flags);
|
||||
/* If there is a type-mismatch, signal a wrong-type-arg error for the given argument number. */
|
||||
SWIGIMPORT(void *) SWIG_Mzscheme_MustGetPtr(Scheme_Object *s, swig_type_info *type,
|
||||
SWIGIMPORT(void *) SWIG_MzScheme_MustGetPtr(Scheme_Object *s, swig_type_info *type,
|
||||
int argnum, int flags, const char *func_name,
|
||||
int argc, Scheme_Object **argv);
|
||||
SWIGIMPORT(Scheme_Object *) SWIG_Mzscheme_NewPointerObj(void *ptr, swig_type_info *type, int owner);
|
||||
SWIGIMPORT(void *) SWIG_Mzscheme_Malloc(size_t size, const char *func_name);
|
||||
SWIGIMPORT(Scheme_Object *) SWIG_Mzscheme_PackageValues(int num, Scheme_Object **values);
|
||||
SWIGIMPORT(Scheme_Object *) SWIG_MzScheme_NewPointerObj(void *ptr, swig_type_info *type, int owner);
|
||||
SWIGIMPORT(void *) SWIG_MzScheme_Malloc(size_t size, const char *func_name);
|
||||
SWIGIMPORT(Scheme_Object *) SWIG_MzScheme_PackageValues(int num, Scheme_Object **values);
|
||||
|
||||
#else
|
||||
|
||||
|
|
@ -53,7 +67,7 @@ static void mz_free_swig(void *p, void *data) {
|
|||
}
|
||||
|
||||
SWIGRUNTIME(Scheme_Object *)
|
||||
SWIG_Mzscheme_NewPointerObj(void *ptr, swig_type_info *type, int owner) {
|
||||
SWIG_MzScheme_NewPointerObj(void *ptr, swig_type_info *type, int owner) {
|
||||
struct swig_mz_proxy *new_proxy;
|
||||
new_proxy = (struct swig_mz_proxy *) scheme_malloc(sizeof(struct swig_mz_proxy));
|
||||
new_proxy->mztype = swig_type;
|
||||
|
|
@ -66,7 +80,7 @@ SWIG_Mzscheme_NewPointerObj(void *ptr, swig_type_info *type, int owner) {
|
|||
}
|
||||
|
||||
SWIGRUNTIME(int)
|
||||
SWIG_Mzscheme_ConvertPtr(Scheme_Object *s, void **result, swig_type_info *type, int flags) {
|
||||
SWIG_MzScheme_ConvertPtr(Scheme_Object *s, void **result, swig_type_info *type, int flags) {
|
||||
swig_type_info *cast;
|
||||
|
||||
if (SCHEME_NULLP(s)) {
|
||||
|
|
@ -91,18 +105,18 @@ SWIG_Mzscheme_ConvertPtr(Scheme_Object *s, void **result, swig_type_info *type,
|
|||
}
|
||||
|
||||
SWIGRUNTIME(void *)
|
||||
SWIG_Mzscheme_MustGetPtr(Scheme_Object *s, swig_type_info *type,
|
||||
SWIG_MzScheme_MustGetPtr(Scheme_Object *s, swig_type_info *type,
|
||||
int argnum, int flags, const char *func_name,
|
||||
int argc, Scheme_Object **argv) {
|
||||
void *result;
|
||||
if (SWIG_Mzscheme_ConvertPtr(s, &result, type, flags)) {
|
||||
if (SWIG_MzScheme_ConvertPtr(s, &result, type, flags)) {
|
||||
scheme_wrong_type(func_name, type->str ? type->str : "void *", argnum, argc, argv);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
SWIGRUNTIME(void)
|
||||
SWIG_Mzscheme_Init() {
|
||||
SWIG_MzScheme_Init() {
|
||||
if (!swig_mz_initialized) {
|
||||
swig_type = scheme_make_type((char *)"swig");
|
||||
swig_mz_initialized = 1;
|
||||
|
|
@ -110,7 +124,7 @@ SWIG_Mzscheme_Init() {
|
|||
}
|
||||
|
||||
SWIGRUNTIME(void *)
|
||||
SWIG_Mzscheme_Malloc(size_t size, const char *func_name) {
|
||||
SWIG_MzScheme_Malloc(size_t size, const char *func_name) {
|
||||
void *p = malloc(size);
|
||||
if (p == NULL) {
|
||||
scheme_signal_error("swig-memory-error");
|
||||
|
|
@ -118,7 +132,7 @@ SWIG_Mzscheme_Malloc(size_t size, const char *func_name) {
|
|||
}
|
||||
|
||||
SWIGIMPORT(Scheme_Object *)
|
||||
SWIG_Mzscheme_PackageValues(int num, Scheme_Object **values) {
|
||||
SWIG_MzScheme_PackageValues(int num, Scheme_Object **values) {
|
||||
/* ignore first value if void */
|
||||
if (num > 0 && SCHEME_VOIDP(values[0]))
|
||||
num--, values++;
|
||||
|
|
|
|||
|
|
@ -2,18 +2,8 @@
|
|||
This file is parsed by SWIG before reading any other interface
|
||||
file. */
|
||||
|
||||
%runtime %{
|
||||
#define SWIG_malloc(size) SWIG_Mzscheme_Malloc(size, FUNC_NAME)
|
||||
#define SWIG_free(mem) free(mem)
|
||||
#define SWIG_ConvertPtr(s, result, type, flags) \
|
||||
SWIG_Mzscheme_ConvertPtr(s, result, type, flags)
|
||||
#define SWIG_MustGetPtr(s, type, argnum, flags) \
|
||||
SWIG_Mzscheme_MustGetPtr(s, type, argnum, flags, FUNC_NAME, argc, argv)
|
||||
#define SWIG_NewPointerObj(ptr, type, owner) \
|
||||
SWIG_Mzscheme_NewPointerObj((void *)ptr, type, owner)
|
||||
%}
|
||||
|
||||
/* Include headers */
|
||||
%runtime "precommon.swg"
|
||||
%runtime "common.swg"
|
||||
%runtime "mzrun.swg"
|
||||
|
||||
|
|
@ -42,5 +32,5 @@
|
|||
}
|
||||
_swig_init = 1;
|
||||
}
|
||||
SWIG_Mzscheme_Init();
|
||||
SWIG_MzScheme_Init();
|
||||
%}
|
||||
|
|
|
|||
16
SWIG/Lib/mzscheme/precommon.swg
Normal file
16
SWIG/Lib/mzscheme/precommon.swg
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
/*************************************************************** -*- c -*-
|
||||
* mzscheme/precommon.swg
|
||||
*
|
||||
* Rename all exported symbols from common.swg, to avoid symbol
|
||||
* clashes if multiple interpreters are included
|
||||
*
|
||||
************************************************************************/
|
||||
|
||||
#define SWIG_TypeRegister SWIG_MzScheme_TypeRegister
|
||||
#define SWIG_TypeCheck SWIG_MzScheme_TypeCheck
|
||||
#define SWIG_TypeCast SWIG_MzScheme_TypeCast
|
||||
#define SWIG_TypeDynamicCast SWIG_MzScheme_TypeDynamicCast
|
||||
#define SWIG_TypeName SWIG_MzScheme_TypeName
|
||||
#define SWIG_TypeQuery SWIG_MzScheme_TypeQuery
|
||||
#define SWIG_TypeClientData SWIG_MzScheme_TypeClientData
|
||||
|
||||
|
|
@ -398,7 +398,7 @@ public:
|
|||
|
||||
// Wrap things up (in a manner of speaking)
|
||||
|
||||
Printv(f->code, tab4, "return SWIG_Mzscheme_PackageValues(lenv, values);\n", NIL);
|
||||
Printv(f->code, tab4, "return SWIG_MzScheme_PackageValues(lenv, values);\n", NIL);
|
||||
Printf(f->code, "#undef FUNC_NAME\n");
|
||||
Printv(f->code, "}\n",NIL);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue