fix typemap issue reported by Bob Marinier

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@8819 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Marcelo Matus 2006-02-15 22:55:56 +00:00
commit 88cf71c939
3 changed files with 33 additions and 2 deletions

View file

@ -115,7 +115,7 @@ const char global_const_char_array2[sizeof(CPLUSPLUS_MSG)+1] = CPLUSPLUS_MSG;
%}
// %typemap(newfree) char *GetNewCharString() { /* hello */ delete[] $1; }
%typemap(newfree) char *GetNewCharString() { /* hello */ delete[] $1; }
%newobject GetNewCharString();
%inline {

View file

@ -22,3 +22,33 @@ void foo1(Foo<int> f, const Foo<int>& ff) {}
void foo2(Foo<short> f, const Foo<short>& ff) {}
%}
#ifdef SWIGUTL
%typemap(ret) int Bar1::foo() { /* hello1 */ };
%typemap(ret) int Bar2::foo() { /* hello2 */ };
%typemap(ret) int foo() {/* hello3 */ };
#endif
%inline %{
struct Bar1 {
int foo() { return 1;}
};
struct Bar2 {
int foo() { return 1;}
};
%}
%newobject FFoo::Bar(bool) const ;
%typemap(newfree) char* Bar(bool) {
/* hello */ delete[] result;
}
%inline {
class FFoo {
public:
char * Bar(bool b) const { return "x"; }
};
}

View file

@ -1252,7 +1252,8 @@ String *Swig_typemap_lookup_new(const String_or_char *op, Node *node, const Stri
if (qsn) {
if (StringLen(qsn) && !Equal(qsn,pname)) {
tm = Swig_typemap_search(op,type,qsn,&mtype);
if (tm && strstr(Char(Getattr(tm,k_type)),"SWIGTYPE")) {
if (tm && (!Getattr(tm,k_pname) ||
strstr(Char(Getattr(tm,k_type)),"SWIGTYPE"))) {
tm = 0;
}
}