add patch 903150
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@6339 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
c6f20f2306
commit
9303e3af22
2 changed files with 42 additions and 1 deletions
|
|
@ -343,6 +343,47 @@ macro(size_t, pfx, sizet)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
%inline {
|
%inline {
|
||||||
|
struct Foo
|
||||||
|
{
|
||||||
|
int _a;
|
||||||
|
|
||||||
|
Foo (int a) : _a(a)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
Foo(const Foo&)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
;
|
||||||
|
|
||||||
|
Foo copy(Foo x)
|
||||||
|
{
|
||||||
|
return x;
|
||||||
|
}
|
||||||
|
|
||||||
|
const Foo copy_c(const Foo x)
|
||||||
|
{
|
||||||
|
return x;
|
||||||
|
}
|
||||||
|
|
||||||
|
const Foo& copy_r(const Foo& x)
|
||||||
|
{
|
||||||
|
return x;
|
||||||
|
}
|
||||||
|
|
||||||
|
Foo* this_p()
|
||||||
|
{
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
Foo& this_r()
|
||||||
|
{
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
struct Test
|
struct Test
|
||||||
{
|
{
|
||||||
Test()
|
Test()
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,7 @@
|
||||||
%typemap(out) SWIGTYPE
|
%typemap(out) SWIGTYPE
|
||||||
{
|
{
|
||||||
$&1_ltype resultptr;
|
$&1_ltype resultptr;
|
||||||
resultptr = new $1_ltype(($1_ltype &) $1);
|
resultptr = new $1_ltype(static_cast<$1_type &>($1));
|
||||||
$result = SWIG_NewPointerObj((void *)(resultptr), $&1_descriptor, 1);
|
$result = SWIG_NewPointerObj((void *)(resultptr), $&1_descriptor, 1);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue