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:
Marcelo Matus 2004-01-15 09:58:09 +00:00
commit cbcb2216b8

View 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*)
{
}
};
%}