diff options
Diffstat (limited to 'Examples/test-suite/dynamic_cast.i')
-rw-r--r-- | Examples/test-suite/dynamic_cast.i | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/Examples/test-suite/dynamic_cast.i b/Examples/test-suite/dynamic_cast.i index ccbaa5b47..392b3bfd1 100644 --- a/Examples/test-suite/dynamic_cast.i +++ b/Examples/test-suite/dynamic_cast.i @@ -1,7 +1,7 @@ /* File : example.i */ %module dynamic_cast -#if !defined(SWIGJAVA) && !defined(SWIGCSHARP) && !defined(SWIGGO) +#if !defined(SWIGJAVA) && !defined(SWIGCSHARP) && !defined(SWIGGO) && !defined(SWIGD) %apply SWIGTYPE *DYNAMIC { Foo * }; #endif @@ -17,7 +17,7 @@ public: }; %} -#if defined(SWIGJAVA) || defined(SWIGCSHARP) || defined(SWIGGO) +#if defined(SWIGJAVA) || defined(SWIGCSHARP) || defined(SWIGGO) || defined(SWIGD) %typemap(out) Foo *blah { Bar *downcast = dynamic_cast<Bar *>($1); *(Bar **)&$result = downcast; @@ -37,6 +37,13 @@ public: } #endif +#if defined(SWIGD) +%typemap(dout, excode=SWIGEXCODE) Foo * { + Bar ret = new Bar($imcall, $owner);$excode + return ret; +} +#endif + #if defined(SWIGGO) %insert(go_runtime) %{ func FooToBar(f Foo) Bar { @@ -62,7 +69,7 @@ char *do_test(Bar *b) { } %} -#if !defined(SWIGJAVA) && !defined(SWIGCSHARP) && !defined(SWIGGO) +#if !defined(SWIGJAVA) && !defined(SWIGCSHARP) && !defined(SWIGGO) && !defined(SWIGD) // A general purpose function for dynamic casting of a Foo * %{ static swig_type_info * |