adding more cases
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@6905 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
c264ed2c5b
commit
9689cebfe8
3 changed files with 33 additions and 9 deletions
|
|
@ -2,12 +2,10 @@
|
|||
|
||||
%inline %{
|
||||
|
||||
|
||||
struct A
|
||||
{
|
||||
int x;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
A a;
|
||||
A *ap;
|
||||
|
|
@ -16,7 +14,13 @@
|
|||
|
||||
int x;
|
||||
int *xp;
|
||||
void *vp;
|
||||
|
||||
int& c = x;
|
||||
|
||||
void *vp;
|
||||
|
||||
enum Hello { Hi, Hola };
|
||||
|
||||
Hello h;
|
||||
Hello *hp;
|
||||
Hello &hr = h;
|
||||
%}
|
||||
|
|
|
|||
|
|
@ -9,9 +9,10 @@
|
|||
int x[4];
|
||||
int y;
|
||||
static const int z;
|
||||
static const int zz = 3;
|
||||
static int zx;
|
||||
|
||||
static int boo() { return 0;}
|
||||
|
||||
};
|
||||
|
||||
class Bar {
|
||||
|
|
@ -49,4 +50,6 @@
|
|||
|
||||
%{
|
||||
const int Foo::z = 3;
|
||||
const int Foo::zz;
|
||||
int Foo::zx;
|
||||
%}
|
||||
|
|
|
|||
|
|
@ -178,10 +178,27 @@ namespace ns1 {
|
|||
|
||||
typedef CTemplate<CFoo> TBla; // OK
|
||||
typedef void (*TFunc1)(CFoo arg); // OK
|
||||
typedef void (*TFunc2)(CTemplate<CFoo> arg); // crashes SWIG
|
||||
typedef void (*TFunc3)(CTemplate<CFoo>* arg); // crashes SWIG
|
||||
|
||||
typedef void (*TFunc2)(CTemplate<CFoo> arg); // OK
|
||||
typedef void (*TFunc3)(CTemplate<CFoo>* arg); // OK
|
||||
|
||||
int foo(TFunc1 a, TFunc2 b, TFunc3 c);
|
||||
}
|
||||
%}
|
||||
|
||||
|
||||
%include std_vector.i
|
||||
|
||||
%{
|
||||
#include <vector>
|
||||
%}
|
||||
|
||||
%inline %{
|
||||
void g(std::vector<double>* s = 0) {}
|
||||
void q(double = 0) {}
|
||||
%}
|
||||
|
||||
|
||||
%constant void (*Bf)(std::vector<double> *p = 0) = g;
|
||||
%constant void (*Cf)(double = 0) = q;
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue