Use the preprocessor to rename external functions of the SWIG runtime

API to follow the naming convention SWIG_<language>_<function>.  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
This commit is contained in:
Matthias Köppe 2003-11-02 13:48:17 +00:00
commit de27e32afb
14 changed files with 127 additions and 16 deletions

View file

@ -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

View file

@ -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;
}

16
Lib/pike/precommon.swg Normal file
View file

@ -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