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:
Marcelo Matus 2004-12-21 07:10:54 +00:00
commit 9689cebfe8
3 changed files with 33 additions and 9 deletions

View file

@ -2,13 +2,11 @@
%inline %{ %inline %{
struct A struct A
{ {
int x; int x;
}; };
A a; A a;
A *ap; A *ap;
const A *cap; const A *cap;
@ -16,7 +14,13 @@
int x; int x;
int *xp; int *xp;
int& c = x;
void *vp; void *vp;
enum Hello { Hi, Hola };
Hello h;
Hello *hp;
Hello &hr = h;
%} %}

View file

@ -9,9 +9,10 @@
int x[4]; int x[4];
int y; int y;
static const int z; static const int z;
static const int zz = 3;
static int zx;
static int boo() { return 0;} static int boo() { return 0;}
}; };
class Bar { class Bar {
@ -49,4 +50,6 @@
%{ %{
const int Foo::z = 3; const int Foo::z = 3;
const int Foo::zz;
int Foo::zx;
%} %}

View file

@ -178,10 +178,27 @@ namespace ns1 {
typedef CTemplate<CFoo> TBla; // OK typedef CTemplate<CFoo> TBla; // OK
typedef void (*TFunc1)(CFoo arg); // OK typedef void (*TFunc1)(CFoo arg); // OK
typedef void (*TFunc2)(CTemplate<CFoo> arg); // crashes SWIG typedef void (*TFunc2)(CTemplate<CFoo> arg); // OK
typedef void (*TFunc3)(CTemplate<CFoo>* arg); // crashes SWIG typedef void (*TFunc3)(CTemplate<CFoo>* arg); // OK
int foo(TFunc1 a, TFunc2 b, TFunc3 c); 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;