Add a level of indirection for the static variable "swig_type_list".
The Guile module uses this to merge type information between modules. git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@6064 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
ce14f90987
commit
341ebe5c11
1 changed files with 6 additions and 5 deletions
|
|
@ -77,13 +77,14 @@ SWIGIMPORT(char *) SWIG_UnpackData(char *, void *, int);
|
||||||
#else
|
#else
|
||||||
|
|
||||||
static swig_type_info *swig_type_list = 0;
|
static swig_type_info *swig_type_list = 0;
|
||||||
|
static swig_type_info **swig_type_list_handle = &swig_type_list;
|
||||||
|
|
||||||
/* Register a type mapping with the type-checking */
|
/* Register a type mapping with the type-checking */
|
||||||
SWIGRUNTIME(swig_type_info *)
|
SWIGRUNTIME(swig_type_info *)
|
||||||
SWIG_TypeRegister(swig_type_info *ti) {
|
SWIG_TypeRegister(swig_type_info *ti) {
|
||||||
swig_type_info *tc, *head, *ret, *next;
|
swig_type_info *tc, *head, *ret, *next;
|
||||||
/* Check to see if this type has already been registered */
|
/* Check to see if this type has already been registered */
|
||||||
tc = swig_type_list;
|
tc = *swig_type_list_handle;
|
||||||
while (tc) {
|
while (tc) {
|
||||||
if (strcmp(tc->name, ti->name) == 0) {
|
if (strcmp(tc->name, ti->name) == 0) {
|
||||||
/* Already exists in the table. Just add additional types to the list */
|
/* Already exists in the table. Just add additional types to the list */
|
||||||
|
|
@ -98,8 +99,8 @@ SWIG_TypeRegister(swig_type_info *ti) {
|
||||||
next = 0;
|
next = 0;
|
||||||
|
|
||||||
/* Place in list */
|
/* Place in list */
|
||||||
ti->prev = swig_type_list;
|
ti->prev = *swig_type_list_handle;
|
||||||
swig_type_list = ti;
|
*swig_type_list_handle = ti;
|
||||||
|
|
||||||
/* Build linked lists */
|
/* Build linked lists */
|
||||||
l1:
|
l1:
|
||||||
|
|
@ -228,7 +229,7 @@ SWIG_TypeEquiv(const char *nb, const char *tb) {
|
||||||
/* Search for a swig_type_info structure */
|
/* Search for a swig_type_info structure */
|
||||||
SWIGRUNTIME(swig_type_info *)
|
SWIGRUNTIME(swig_type_info *)
|
||||||
SWIG_TypeQuery(const char *name) {
|
SWIG_TypeQuery(const char *name) {
|
||||||
swig_type_info *ty = swig_type_list;
|
swig_type_info *ty = *swig_type_list_handle;
|
||||||
while (ty) {
|
while (ty) {
|
||||||
if (ty->str && (SWIG_TypeEquiv(ty->str,name))) return ty;
|
if (ty->str && (SWIG_TypeEquiv(ty->str,name))) return ty;
|
||||||
if (ty->name && (strcmp(name,ty->name) == 0)) return ty;
|
if (ty->name && (strcmp(name,ty->name) == 0)) return ty;
|
||||||
|
|
@ -246,7 +247,7 @@ SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
|
||||||
equiv = ti->next;
|
equiv = ti->next;
|
||||||
while (equiv) {
|
while (equiv) {
|
||||||
if (!equiv->converter) {
|
if (!equiv->converter) {
|
||||||
tc = swig_type_list;
|
tc = *swig_type_list_handle;
|
||||||
while (tc) {
|
while (tc) {
|
||||||
if ((strcmp(tc->name, equiv->name) == 0))
|
if ((strcmp(tc->name, equiv->name) == 0))
|
||||||
SWIG_TypeClientData(tc,clientdata);
|
SWIG_TypeClientData(tc,clientdata);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue