Few C typemaps fixes (still using experimental approach).

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2008-maciekd@10658 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Maciej Drwal 2008-07-11 16:12:14 +00:00
commit 542c21b6fe
7 changed files with 84 additions and 41 deletions

View file

@ -4,7 +4,10 @@ Bar foo_ret_val() {
return Bar();
}
Bar* foo_ret_ptr(Bar* bar) {
Bar *foo_ret_ptr(Bar *bar) {
return bar;
}
Bar &foo_ret_ref(Bar &bar) {
return bar;
}

View file

@ -11,6 +11,6 @@ public:
};
Bar foo_ret_val();
//Bar& foo_ret_ref(Bar* bar);
Bar& foo_ret_ref(Bar& bar);
Bar* foo_ret_ptr(Bar* bar);

View file

@ -3,9 +3,13 @@
#include "example_proxy.h"
int main(int argc, char** argv) {
Bar b = foo_ret_val();
//Bar * bp = foo_ret_ptr(NULL);
printf("x = %d\n", Bar_get(&b));
Bar *b = foo_ret_val();
printf("x = %d\n", Bar_get(b));
Bar *bp = foo_ret_ptr(NULL);
Bar *br = foo_ret_ref(new_Bar());
delete_Bar(b);
delete_Bar(br);
return 0;
}