From de27e32afb5c97f8e99db6a01a78ff764e2b8f9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20K=C3=B6ppe?= Date: Sun, 2 Nov 2003 13:48:17 +0000 Subject: Use the preprocessor to rename external functions of the SWIG runtime API to follow the naming convention SWIG__. This should allow linking more than one interpreter into a program. git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5242 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- Lib/perl5/perl5.swg | 1 + Lib/perl5/precommon.swg | 16 ++++++++++++++++ Lib/php4/php4.swg | 1 + Lib/php4/precommon.swg | 16 ++++++++++++++++ Lib/pike/pike.swg | 1 + Lib/pike/pikerun.swg | 11 +++++++---- Lib/pike/precommon.swg | 16 ++++++++++++++++ Lib/python/precommon.swg | 16 ++++++++++++++++ Lib/python/python.swg | 1 + Lib/ruby/precommon.swg | 16 ++++++++++++++++ Lib/ruby/ruby.swg | 1 + Lib/tcl/precommon.swg | 16 ++++++++++++++++ Lib/tcl/tcl8.swg | 1 + 13 files changed, 109 insertions(+), 4 deletions(-) create mode 100644 Lib/perl5/precommon.swg create mode 100644 Lib/php4/precommon.swg create mode 100644 Lib/pike/precommon.swg create mode 100644 Lib/python/precommon.swg create mode 100644 Lib/ruby/precommon.swg create mode 100644 Lib/tcl/precommon.swg (limited to 'Lib') diff --git a/Lib/perl5/perl5.swg b/Lib/perl5/perl5.swg index 6221b5d4f..7101bdc7c 100644 --- a/Lib/perl5/perl5.swg +++ b/Lib/perl5/perl5.swg @@ -4,6 +4,7 @@ * Perl 5 configuration file * ----------------------------------------------------------------------------- */ +%runtime "precommon.swg" %runtime "common.swg" // common type checking code %runtime "perlrun.swg" // Perl runtime functions %runtime "noembed.h" // undefine Perl5 macros diff --git a/Lib/perl5/precommon.swg b/Lib/perl5/precommon.swg new file mode 100644 index 000000000..b8473bf04 --- /dev/null +++ b/Lib/perl5/precommon.swg @@ -0,0 +1,16 @@ +/*************************************************************** -*- c -*- + * perl5/precommon.swg + * + * Rename all exported symbols from common.swg, to avoid symbol + * clashes if multiple interpreters are included + * + ************************************************************************/ + +#define SWIG_TypeRegister SWIG_Perl_TypeRegister +#define SWIG_TypeCheck SWIG_Perl_TypeCheck +#define SWIG_TypeCast SWIG_Perl_TypeCast +#define SWIG_TypeDynamicCast SWIG_Perl_TypeDynamicCast +#define SWIG_TypeName SWIG_Perl_TypeName +#define SWIG_TypeQuery SWIG_Perl_TypeQuery +#define SWIG_TypeClientData SWIG_Perl_TypeClientData + diff --git a/Lib/php4/php4.swg b/Lib/php4/php4.swg index 81bb482b7..99d6ebbd2 100644 --- a/Lib/php4/php4.swg +++ b/Lib/php4/php4.swg @@ -5,6 +5,7 @@ * */ +%runtime "precommon.swg" %runtime "common.swg" // common type checking code %runtime "php4run.swg" // Php4 runtime functions %include "utils.i" // building blocks diff --git a/Lib/php4/precommon.swg b/Lib/php4/precommon.swg new file mode 100644 index 000000000..f97445305 --- /dev/null +++ b/Lib/php4/precommon.swg @@ -0,0 +1,16 @@ +/*************************************************************** -*- c -*- + * php4/precommon.swg + * + * Rename all exported symbols from common.swg, to avoid symbol + * clashes if multiple interpreters are included + * + ************************************************************************/ + +#define SWIG_TypeRegister SWIG_PHP4_TypeRegister +#define SWIG_TypeCheck SWIG_PHP4_TypeCheck +#define SWIG_TypeCast SWIG_PHP4_TypeCast +#define SWIG_TypeDynamicCast SWIG_PHP4_TypeDynamicCast +#define SWIG_TypeName SWIG_PHP4_TypeName +#define SWIG_TypeQuery SWIG_PHP4_TypeQuery +#define SWIG_TypeClientData SWIG_PHP4_TypeClientData + diff --git a/Lib/pike/pike.swg b/Lib/pike/pike.swg index 9b73d2193..592d6c152 100644 --- a/Lib/pike/pike.swg +++ b/Lib/pike/pike.swg @@ -4,6 +4,7 @@ * Pike configuration module. * ----------------------------------------------------------------------------- */ +%insert(runtime) "precommon.swg" %insert(runtime) "common.swg"; // Common type-checking code %insert(runtime) "pikerun.swg"; // Pike run-time code diff --git a/Lib/pike/pikerun.swg b/Lib/pike/pikerun.swg index 5ca7effb5..63af4c607 100644 --- a/Lib/pike/pikerun.swg +++ b/Lib/pike/pikerun.swg @@ -27,16 +27,19 @@ typedef struct swig_object_wrapper { #endif #define THIS (((swig_object_wrapper *) Pike_fp->current_storage)->self) +#define SWIG_ConvertPtr SWIG_Pike_ConvertPtr +#define SWIG_NewPointerObj SWIG_Pike_NewPointerObj + #ifdef SWIG_NOINCLUDE -SWIGEXPORT(int) SWIG_ConvertPtr(struct object *, void **, swig_type_info *, int); -SWIGEXPORT(struct object *) SWIG_NewPointerObj(void *, swig_type_info *, int); +SWIGEXPORT(int) SWIG_Pike_ConvertPtr(struct object *, void **, swig_type_info *, int); +SWIGEXPORT(struct object *) SWIG_Pike_NewPointerObj(void *, swig_type_info *, int); #else /* Convert a pointer value */ SWIGRUNTIME(int) -SWIG_ConvertPtr(struct object *obj, void **ptr, swig_type_info *ty, int flags) { +SWIG_Pike_ConvertPtr(struct object *obj, void **ptr, swig_type_info *ty, int flags) { char *storage; struct program *pr; if (ty) { @@ -52,7 +55,7 @@ SWIG_ConvertPtr(struct object *obj, void **ptr, swig_type_info *ty, int flags) { /* Create a new pointer object */ SWIGRUNTIME(struct object *) -SWIG_NewPointerObj(void *ptr, swig_type_info *type, int own) { +SWIG_Pike_NewPointerObj(void *ptr, swig_type_info *type, int own) { return 0; } diff --git a/Lib/pike/precommon.swg b/Lib/pike/precommon.swg new file mode 100644 index 000000000..a36a5dd3b --- /dev/null +++ b/Lib/pike/precommon.swg @@ -0,0 +1,16 @@ +/*************************************************************** -*- c -*- + * pike/precommon.swg + * + * Rename all exported symbols from common.swg, to avoid symbol + * clashes if multiple interpreters are included + * + ************************************************************************/ + +#define SWIG_TypeRegister SWIG_Pike_TypeRegister +#define SWIG_TypeCheck SWIG_Pike_TypeCheck +#define SWIG_TypeCast SWIG_Pike_TypeCast +#define SWIG_TypeDynamicCast SWIG_Pike_TypeDynamicCast +#define SWIG_TypeName SWIG_Pike_TypeName +#define SWIG_TypeQuery SWIG_Pike_TypeQuery +#define SWIG_TypeClientData SWIG_Pike_TypeClientData + diff --git a/Lib/python/precommon.swg b/Lib/python/precommon.swg new file mode 100644 index 000000000..88e68fd1e --- /dev/null +++ b/Lib/python/precommon.swg @@ -0,0 +1,16 @@ +/*************************************************************** -*- 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_TypeQuery SWIG_Python_TypeQuery +#define SWIG_TypeClientData SWIG_Python_TypeClientData + diff --git a/Lib/python/python.swg b/Lib/python/python.swg index 3f21c110f..b49a74433 100644 --- a/Lib/python/python.swg +++ b/Lib/python/python.swg @@ -10,6 +10,7 @@ #include "Python.h" %} +%insert(runtime) "precommon.swg"; %insert(runtime) "common.swg"; // Common type-checking code %insert(runtime) "pyrun.swg"; // Python run-time code diff --git a/Lib/ruby/precommon.swg b/Lib/ruby/precommon.swg new file mode 100644 index 000000000..df4c6cdaa --- /dev/null +++ b/Lib/ruby/precommon.swg @@ -0,0 +1,16 @@ +/*************************************************************** -*- 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_TypeQuery SWIG_Ruby_TypeQuery +#define SWIG_TypeClientData SWIG_Ruby_TypeClientData + diff --git a/Lib/ruby/ruby.swg b/Lib/ruby/ruby.swg index 2c8a045a9..805ace816 100644 --- a/Lib/ruby/ruby.swg +++ b/Lib/ruby/ruby.swg @@ -5,6 +5,7 @@ * ---------------------------------------------------------------------- */ %runtime "rubyhead.swg" +%runtime "precommon.swg" %runtime "common.swg" #ifdef SWIG_NOINCLUDE diff --git a/Lib/tcl/precommon.swg b/Lib/tcl/precommon.swg new file mode 100644 index 000000000..97bd6ec7d --- /dev/null +++ b/Lib/tcl/precommon.swg @@ -0,0 +1,16 @@ +/*************************************************************** -*- c -*- + * Tcl/precommon.swg + * + * Rename all exported symbols from common.swg, to avoid symbol + * clashes if multiple interpreters are included + * + ************************************************************************/ + +#define SWIG_TypeRegister SWIG_Tcl_TypeRegister +#define SWIG_TypeCheck SWIG_Tcl_TypeCheck +#define SWIG_TypeCast SWIG_Tcl_TypeCast +#define SWIG_TypeDynamicCast SWIG_Tcl_TypeDynamicCast +#define SWIG_TypeName SWIG_Tcl_TypeName +#define SWIG_TypeQuery SWIG_Tcl_TypeQuery +#define SWIG_TypeClientData SWIG_Tcl_TypeClientData + diff --git a/Lib/tcl/tcl8.swg b/Lib/tcl/tcl8.swg index a3ff7d1aa..b8c8f2543 100644 --- a/Lib/tcl/tcl8.swg +++ b/Lib/tcl/tcl8.swg @@ -4,6 +4,7 @@ * Tcl8 configuration module. * ----------------------------------------------------------------------------- */ +%runtime "precommon.swg" %runtime "common.swg" %runtime "swigtcl8.swg" -- cgit v1.2.1