1 /* This interface file tests whether SWIG handles pointer-reference
4 SWIG 1.3a5 signals a syntax error.
7 %module pointer_reference
9 %warnfilter(SWIGWARN_TYPEMAP_SWIGTYPELEAK); /* memory leak when setting a ptr/ref variable */
12 /* A silly testing typemap for feeding a doubly indirect integer */
13 %typemap(in) int *&XYZZY (int temp1, int *temp2) {
14 temp1 = gh_scm2int($input); temp2 = &temp1; $1 = &temp2;
19 void foo(int *&XYZZY) {}
23 // Test pointer reference typemaps shipped with SWIG (add in SWIG 1.3.28 for many languages)
27 Struct(int v) : value(v) {}
28 static Struct instance;
29 static Struct *pInstance;
32 void set(Struct *& s) {
33 Struct::instance = *s;
36 return Struct::pInstance;
41 Struct Struct::instance = Struct(10);
42 Struct *Struct::pInstance = &Struct::instance;