using the global runtime.swg instead of python/pyrunalias.swg. Now the same solution can be used in other languages
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@6763 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
c573cfe3a8
commit
492c58c659
6 changed files with 91 additions and 17 deletions
|
|
@ -9,10 +9,10 @@ SWIGOPT =
|
||||||
all::
|
all::
|
||||||
$(SWIG) -co swigrun.swg
|
$(SWIG) -co swigrun.swg
|
||||||
$(SWIG) -o pyrun.swg -co python/pyrun.swg
|
$(SWIG) -o pyrun.swg -co python/pyrun.swg
|
||||||
$(SWIG) -o pyrunalias.swg -co python/pyrunalias.swg
|
$(SWIG) -o runtime.swg -co runtime.swg
|
||||||
$(MAKE) -f $(TOP)/Makefile $(SWIGLIB) CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \
|
$(MAKE) -f $(TOP)/Makefile $(SWIGLIB) CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \
|
||||||
SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' python_cpp
|
SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' python_cpp
|
||||||
rm -f swigrun.swg pyrun.swg pyrunalias.swg
|
rm -f *.swg
|
||||||
|
|
||||||
static::
|
static::
|
||||||
$(MAKE) -f $(TOP)/Makefile $(SWIGLIB) CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \
|
$(MAKE) -f $(TOP)/Makefile $(SWIGLIB) CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \
|
||||||
|
|
@ -21,7 +21,7 @@ static::
|
||||||
clean::
|
clean::
|
||||||
$(MAKE) -f $(TOP)/Makefile python_clean
|
$(MAKE) -f $(TOP)/Makefile python_clean
|
||||||
rm -f $(TARGET).py
|
rm -f $(TARGET).py
|
||||||
rm -f swigrun.swg pyrun.swg pyrunalias.swg
|
rm -f *.swg
|
||||||
|
|
||||||
check: all
|
check: all
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
#include <Python.h>
|
#include <Python.h>
|
||||||
#include "swigrun.swg"
|
#include "swigrun.swg"
|
||||||
#include "pyrun.swg"
|
#include "pyrun.swg"
|
||||||
#include "pyrunalias.swg"
|
#include "runtime.swg"
|
||||||
|
|
||||||
#include "example.h"
|
#include "example.h"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,7 @@ CPP_TEST_CASES += \
|
||||||
nondynamic \
|
nondynamic \
|
||||||
primitive_types \
|
primitive_types \
|
||||||
std_containers \
|
std_containers \
|
||||||
|
swigobject
|
||||||
|
|
||||||
C_TEST_CASES += \
|
C_TEST_CASES += \
|
||||||
file_test \
|
file_test \
|
||||||
|
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
||||||
/* -----------------------------------------------------------------------------*
|
|
||||||
* Standard SWIG API Alias
|
|
||||||
* -----------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
|
|
||||||
#define SWIG_TypeQuery(name) SWIG_Python_TypeQuery(name)
|
|
||||||
#define SWIG_TypeRegister(ti) SWIG_Python_TypeRegister(ti)
|
|
||||||
#define SWIG_TypeClientData(ti, cd) SWIG_Python_TypeClientData(ti, cd)
|
|
||||||
#define SWIG_PropagateClientData(ti) SWIG_Python_PropagateClientData(ti)
|
|
||||||
41
Lib/runtime.swg
Normal file
41
Lib/runtime.swg
Normal file
|
|
@ -0,0 +1,41 @@
|
||||||
|
/* -----------------------------------------------------------------------------*
|
||||||
|
Standard SWIG API for use inside user code.
|
||||||
|
|
||||||
|
You need to include in your code as follow:
|
||||||
|
|
||||||
|
#include <Python.h> // or using your favorite language
|
||||||
|
#include <swigrun.swg>
|
||||||
|
#include <python/pyrun.swg> // or using your favorite language
|
||||||
|
#include <runtime.swg>
|
||||||
|
|
||||||
|
* -----------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
SWIGRUNTIMEINLINE swig_type_info *
|
||||||
|
SWIG_Runtime_TypeQuery(const char *name) {
|
||||||
|
swig_type_info *tl = SWIG_Runtime_GetTypeList();
|
||||||
|
return SWIG_TypeQueryTL(tl, name);
|
||||||
|
}
|
||||||
|
|
||||||
|
SWIGRUNTIMEINLINE swig_type_info *
|
||||||
|
SWIG_Runtime_TypeRegister(swig_type_info *ti) {
|
||||||
|
swig_type_info *tl = SWIG_Runtime_GetTypeList();
|
||||||
|
return SWIG_TypeRegisterTL(&tl, ti);
|
||||||
|
}
|
||||||
|
|
||||||
|
SWIGRUNTIMEINLINE void
|
||||||
|
SWIG_Runtime_TypeClientData(swig_type_info *ti, void *clientdata) {
|
||||||
|
swig_type_info *tl = SWIG_Runtime_GetTypeList();
|
||||||
|
SWIG_TypeClientDataTL(tl, ti, clientdata);
|
||||||
|
}
|
||||||
|
|
||||||
|
SWIGRUNTIMEINLINE void
|
||||||
|
SWIG_Runtime_PropagateClientData(swig_type_info *type) {
|
||||||
|
swig_type_info *tl = SWIG_Runtime_GetTypeList();
|
||||||
|
SWIG_PropagateClientDataTL(tl, type);
|
||||||
|
}
|
||||||
|
|
||||||
|
#define SWIG_GetTypeList() SWIG_Runtime_GetTypeList()
|
||||||
|
#define SWIG_TypeQuery(name) SWIG_Runtime_TypeQuery(name)
|
||||||
|
#define SWIG_TypeRegister(ti) SWIG_Runtime_TypeRegister(ti)
|
||||||
|
#define SWIG_TypeClientData(ti, cd) SWIG_Runtime_TypeClientData(ti, cd)
|
||||||
|
#define SWIG_PropagateClientData(ti) SWIG_Runtime_PropagateClientData(ti)
|
||||||
|
|
@ -41,7 +41,7 @@
|
||||||
#define SWIGRUNTIME static
|
#define SWIGRUNTIME static
|
||||||
#endif
|
#endif
|
||||||
#ifndef SWIGRUNTIMEINLINE
|
#ifndef SWIGRUNTIMEINLINE
|
||||||
#define SWIGRUNTIMEINLINE static SWIGINLINE
|
#define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
@ -152,7 +152,7 @@ SWIG_TypeRegisterTL(swig_type_info **tl, swig_type_info *ti) {
|
||||||
Check the typename
|
Check the typename
|
||||||
*/
|
*/
|
||||||
SWIGRUNTIME swig_type_info *
|
SWIGRUNTIME swig_type_info *
|
||||||
SWIG_TypeCheck(char *c, swig_type_info *ty) {
|
SWIG_TypeCheck(const char *c, swig_type_info *ty) {
|
||||||
swig_type_info *s;
|
swig_type_info *s;
|
||||||
if (!ty) return 0; /* Void pointer */
|
if (!ty) return 0; /* Void pointer */
|
||||||
s = ty->next; /* First element always just a name */
|
s = ty->next; /* First element always just a name */
|
||||||
|
|
@ -284,8 +284,8 @@ SWIG_PackData(char *c, void *ptr, size_t sz) {
|
||||||
/*
|
/*
|
||||||
Unpack binary data from a string
|
Unpack binary data from a string
|
||||||
*/
|
*/
|
||||||
SWIGRUNTIME char *
|
SWIGRUNTIME const char *
|
||||||
SWIG_UnpackData(char *c, void *ptr, size_t sz) {
|
SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
|
||||||
register unsigned char *u = (unsigned char *) ptr;
|
register unsigned char *u = (unsigned char *) ptr;
|
||||||
register const unsigned char *eu = u + sz;
|
register const unsigned char *eu = u + sz;
|
||||||
for (; u != eu; ++u) {
|
for (; u != eu; ++u) {
|
||||||
|
|
@ -347,6 +347,47 @@ SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
|
||||||
return buff;
|
return buff;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SWIGRUNTIME const char *
|
||||||
|
SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
|
||||||
|
if (*c != '_') {
|
||||||
|
if (strcmp(c,"NULL") == 0) {
|
||||||
|
*ptr = (void *) 0;
|
||||||
|
return name;
|
||||||
|
} else {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return SWIG_UnpackData(++c,ptr,sizeof(void *));
|
||||||
|
}
|
||||||
|
|
||||||
|
SWIGRUNTIME char *
|
||||||
|
SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
|
||||||
|
char *r = buff;
|
||||||
|
size_t lname = (name ? strlen(name) : 0);
|
||||||
|
if ((2*sz + 2 + lname) > bsz) return 0;
|
||||||
|
*(r++) = '_';
|
||||||
|
r = SWIG_PackData(r,ptr,sz);
|
||||||
|
if (lname) {
|
||||||
|
strncpy(r,name,lname+1);
|
||||||
|
} else {
|
||||||
|
*r = 0;
|
||||||
|
}
|
||||||
|
return buff;
|
||||||
|
}
|
||||||
|
|
||||||
|
SWIGRUNTIME const char *
|
||||||
|
SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
|
||||||
|
if (*c != '_') {
|
||||||
|
if (strcmp(c,"NULL") == 0) {
|
||||||
|
memset(ptr,0,sz);
|
||||||
|
return name;
|
||||||
|
} else {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return SWIG_UnpackData(++c,ptr,sz);
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue