added new testing case
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5638 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
63f7c13322
commit
cbcb2216b8
1 changed files with 33 additions and 0 deletions
33
Examples/test-suite/typemap_self.i
Normal file
33
Examples/test-suite/typemap_self.i
Normal file
|
|
@ -0,0 +1,33 @@
|
||||||
|
%module typemap_self
|
||||||
|
|
||||||
|
// This typemap should be ignored for self?
|
||||||
|
%typemap(in) A* (A* ptr) {
|
||||||
|
if (SWIG_ConvertPtr($input, (void**) &ptr, $1_descriptor, 0) != -1) {
|
||||||
|
$1 = ptr;
|
||||||
|
} else {
|
||||||
|
$1 = new A();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Simple but unsecure current fix
|
||||||
|
//%apply SWIGTYPE* {A* self}
|
||||||
|
|
||||||
|
|
||||||
|
%inline %{
|
||||||
|
|
||||||
|
struct A
|
||||||
|
{
|
||||||
|
int foo()
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
struct B
|
||||||
|
{
|
||||||
|
B(A*)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
%}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue