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:
parent
1337fbf65e
commit
88cf71c939
3 changed files with 33 additions and 2 deletions
|
|
@ -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();
|
%newobject GetNewCharString();
|
||||||
|
|
||||||
%inline {
|
%inline {
|
||||||
|
|
|
||||||
|
|
@ -22,3 +22,33 @@ void foo1(Foo<int> f, const Foo<int>& ff) {}
|
||||||
void foo2(Foo<short> f, const Foo<short>& 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"; }
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1252,7 +1252,8 @@ String *Swig_typemap_lookup_new(const String_or_char *op, Node *node, const Stri
|
||||||
if (qsn) {
|
if (qsn) {
|
||||||
if (StringLen(qsn) && !Equal(qsn,pname)) {
|
if (StringLen(qsn) && !Equal(qsn,pname)) {
|
||||||
tm = Swig_typemap_search(op,type,qsn,&mtype);
|
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;
|
tm = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue