fix fnc_ptr wrap for functions with ref,enums,etc
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@6280 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
625985875d
commit
526e70e592
1 changed files with 20 additions and 3 deletions
|
|
@ -512,6 +512,7 @@ SwigType_ltype(SwigType *s) {
|
||||||
List *elements;
|
List *elements;
|
||||||
int nelements, i;
|
int nelements, i;
|
||||||
int firstarray = 1;
|
int firstarray = 1;
|
||||||
|
int notypeconv = 0;
|
||||||
|
|
||||||
result = NewString("");
|
result = NewString("");
|
||||||
tc = Copy(s);
|
tc = Copy(s);
|
||||||
|
|
@ -535,6 +536,10 @@ SwigType_ltype(SwigType *s) {
|
||||||
/* Now, walk the type list and start emitting */
|
/* Now, walk the type list and start emitting */
|
||||||
for (i = 0; i < nelements; i++) {
|
for (i = 0; i < nelements; i++) {
|
||||||
element = Getitem(elements,i);
|
element = Getitem(elements,i);
|
||||||
|
/* when we see a function, we need to preserve the following types */
|
||||||
|
if (SwigType_isfunction(element)) {
|
||||||
|
notypeconv = 1;
|
||||||
|
}
|
||||||
if (SwigType_isqualifier(element)) {
|
if (SwigType_isqualifier(element)) {
|
||||||
/* Do nothing. Ignore */
|
/* Do nothing. Ignore */
|
||||||
} else if (SwigType_ispointer(element)) {
|
} else if (SwigType_ispointer(element)) {
|
||||||
|
|
@ -544,13 +549,25 @@ SwigType_ltype(SwigType *s) {
|
||||||
Append(result,element);
|
Append(result,element);
|
||||||
firstarray = 0;
|
firstarray = 0;
|
||||||
} else if (SwigType_isreference(element)) {
|
} else if (SwigType_isreference(element)) {
|
||||||
Append(result,"p.");
|
if (notypeconv) {
|
||||||
|
Append(result,element);
|
||||||
|
} else {
|
||||||
|
Append(result,"p.");
|
||||||
|
}
|
||||||
firstarray = 0;
|
firstarray = 0;
|
||||||
} else if (SwigType_isarray(element) && firstarray) {
|
} else if (SwigType_isarray(element) && firstarray) {
|
||||||
Append(result,"p.");
|
if (notypeconv) {
|
||||||
|
Append(result,element);
|
||||||
|
} else {
|
||||||
|
Append(result,"p.");
|
||||||
|
}
|
||||||
firstarray = 0;
|
firstarray = 0;
|
||||||
} else if (SwigType_isenum(element)) {
|
} else if (SwigType_isenum(element)) {
|
||||||
Append(result,"int");
|
if (notypeconv) {
|
||||||
|
Append(result,element);
|
||||||
|
} else {
|
||||||
|
Append(result,"int");
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
Append(result,element);
|
Append(result,element);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue