diff --git a/Examples/test-suite/java_director_exception_feature.i b/Examples/test-suite/java_director_exception_feature.i index a92193f1d..d6f1e3f55 100644 --- a/Examples/test-suite/java_director_exception_feature.i +++ b/Examples/test-suite/java_director_exception_feature.i @@ -80,6 +80,7 @@ // throws typemaps for c++->java exception conversions %typemap(throws,throws="MyJavaException1") MyNS::Exception1 %{ + (void)$1; jclass excpcls = jenv->FindClass("java_director_exception_feature/MyJavaException1"); if (excpcls) { jenv->ThrowNew(excpcls, $1.what()); @@ -88,6 +89,7 @@ %} %typemap(throws,throws="MyJavaException1") int %{ + (void)$1; jclass excpcls = jenv->FindClass("java_director_exception_feature/MyJavaException1"); if (excpcls) { jenv->ThrowNew(excpcls, "Threw some integer"); diff --git a/Examples/test-suite/java_director_exception_feature_nspace.i b/Examples/test-suite/java_director_exception_feature_nspace.i index aea362905..264c2a938 100644 --- a/Examples/test-suite/java_director_exception_feature_nspace.i +++ b/Examples/test-suite/java_director_exception_feature_nspace.i @@ -95,6 +95,7 @@ %} %typemap(throws,throws=PACKAGEDOT"MyNS.MyJavaException1") int %{ + (void)$1; jclass excpcls = jenv->FindClass(PACKAGESLASH"MyNS/MyJavaException1"); if (excpcls) { jenv->ThrowNew(excpcls, "Threw some integer"); diff --git a/Examples/test-suite/template_typemaps.i b/Examples/test-suite/template_typemaps.i index c68eba730..d01945460 100644 --- a/Examples/test-suite/template_typemaps.i +++ b/Examples/test-suite/template_typemaps.i @@ -7,10 +7,11 @@ /* do nothing */ } -%typemap(out) Integer1 -{ - /* do nothing */ -} +#ifdef SWIGCSHARP +%typemap(out) Integer1 { /* do nothing */ $result = 0; } +#else +%typemap(out) Integer1 { /* do nothing */ } +#endif %typemap(in) Integer2 { @@ -18,10 +19,11 @@ /* do nothing */ } -%typemap(out) Integer2 -{ - /* do nothing */ -} +#ifdef SWIGCSHARP +%typemap(out) Integer2 { /* do nothing */ $result = 0; } +#else +%typemap(out) Integer2 { /* do nothing */ } +#endif %{ typedef int Integer1; diff --git a/Examples/test-suite/typemap_various.i b/Examples/test-suite/typemap_various.i index 2a1777ea8..c2f70ce55 100644 --- a/Examples/test-suite/typemap_various.i +++ b/Examples/test-suite/typemap_various.i @@ -55,14 +55,19 @@ void foo2(Foo f, const Foo& ff) {} }; } +#ifdef SWIGCSHARP +#define TYPEMAP_OUT_INIT $result = 0; +#else +#define TYPEMAP_OUT_INIT +#endif // Test obscure bug where named typemaps where not being applied when symbol name contained a number %typemap(out) double "_typemap_for_double_no_compile_" -%typemap(out) double ABCD::meth "$1 = 0.0;" -%typemap(out) double ABCD::m1 "$1 = 0.0;" -%typemap(out) double ABCD::_x2 "$1 = 0.0;" -%typemap(out) double ABCD::y_ "$1 = 0.0;" -%typemap(out) double ABCD::_3 "$1 = 0.0;" +%typemap(out) double ABCD::meth {$1 = 0.0; TYPEMAP_OUT_INIT} +%typemap(out) double ABCD::m1 {$1 = 0.0; TYPEMAP_OUT_INIT} +%typemap(out) double ABCD::_x2 {$1 = 0.0; TYPEMAP_OUT_INIT} +%typemap(out) double ABCD::y_ {$1 = 0.0; TYPEMAP_OUT_INIT} +%typemap(out) double ABCD::_3 {$1 = 0.0; TYPEMAP_OUT_INIT} %inline %{ struct ABCD { double meth() { return 0.0; }