Several major fixes for: arrays, static members, member func.ptrs., exceptions, ... Lots of tests runs ok now.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2008-maciekd@11188 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
8c74fa0f46
commit
a2dc2756c8
6 changed files with 331 additions and 274 deletions
|
|
@ -9,10 +9,14 @@
|
|||
int globalints[] = {100, 200, 300};
|
||||
const int constglobalints[] = {400, 500, 600};
|
||||
|
||||
class CC {};
|
||||
|
||||
struct Bar {
|
||||
static int ints[];
|
||||
static CC ccs[];
|
||||
};
|
||||
int Bar::ints[] = {700, 800, 900};
|
||||
CC Bar::ccs[] = {CC(), CC()};
|
||||
|
||||
double arr_bool(bool array[], int length) { double sum=0.0; int i=0; for(; i<length; i++) { sum += array[i]; array[i]=!array[i]; } return sum; }
|
||||
double arr_char(char array[], int length) { double sum=0.0; int i=0; for(; i<length; i++) { sum += array[i]; array[i]*=2; } return sum; }
|
||||
|
|
|
|||
|
|
@ -19,6 +19,13 @@ CPP_TEST_CASES = cast_operator \
|
|||
enums \
|
||||
enum_plus
|
||||
|
||||
#
|
||||
# BROKEN TEST CASES:
|
||||
# default_constructor - last case: when using %extend generates 2 ctors wrappers,
|
||||
# both using new, while the class constructor is private
|
||||
#
|
||||
CPP_TEST_BROKEN_CXX = default_constructor
|
||||
|
||||
include $(srcdir)/../common.mk
|
||||
|
||||
INTERFACEDIR = ../../
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/* File : example.i */
|
||||
%module dynamic_cast
|
||||
|
||||
#if !defined(SWIGJAVA) && !defined(SWIGCSHARP)
|
||||
#if !defined(SWIGJAVA) && !defined(SWIGCSHARP) && !defined(SWIGC)
|
||||
%apply SWIGTYPE *DYNAMIC { Foo * };
|
||||
#endif
|
||||
|
||||
|
|
@ -17,14 +17,14 @@ public:
|
|||
};
|
||||
%}
|
||||
|
||||
#if defined(SWIGJAVA) || defined(SWIGCSHARP)
|
||||
#if defined(SWIGJAVA) || defined(SWIGCSHARP) || defined(SWIGC)
|
||||
%typemap(out) Foo *blah {
|
||||
Bar *downcast = dynamic_cast<Bar *>($1);
|
||||
*(Bar **)&$result = downcast;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(SWIGJAVA)
|
||||
#if defined(SWIGJAVA)
|
||||
%typemap(javaout) Foo * {
|
||||
return new Bar($jnicall, $owner);
|
||||
}
|
||||
|
|
@ -54,7 +54,7 @@ char *do_test(Bar *b) {
|
|||
}
|
||||
%}
|
||||
|
||||
#if !defined(SWIGJAVA) && !defined(SWIGCSHARP)
|
||||
#if !defined(SWIGJAVA) && !defined(SWIGCSHARP) && !defined(SWIGC)
|
||||
// A general purpose function for dynamic casting of a Foo *
|
||||
%{
|
||||
static swig_type_info *
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue