Fix wrapping of function pointers and member function pointers when the function returns by reference

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12157 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2010-07-16 18:45:22 +00:00
commit 568607c5ea
7 changed files with 67 additions and 4 deletions

View file

@ -735,6 +735,7 @@ String *SwigType_rcaststr(SwigType *s, const_String_or_char_ptr name) {
int clear = 1;
int firstarray = 1;
int isreference = 0;
int isfunction = 0;
int isarray = 0;
result = NewStringEmpty();
@ -835,6 +836,7 @@ String *SwigType_rcaststr(SwigType *s, const_String_or_char_ptr name) {
}
Append(result, ")");
Delete(parms);
isfunction = 1;
} else {
String *bs = SwigType_namestr(element);
Insert(result, 0, " ");
@ -850,10 +852,12 @@ String *SwigType_rcaststr(SwigType *s, const_String_or_char_ptr name) {
cast = NewStringf("(%s)", result);
}
if (name) {
if (isreference) {
if (isarray)
Clear(cast);
Append(cast, "*");
if (!isfunction) {
if (isreference) {
if (isarray)
Clear(cast);
Append(cast, "*");
}
}
Append(cast, name);
}