diff --git a/Source/Modules/csharp.cxx b/Source/Modules/csharp.cxx index a0652b824..e6f6f803d 100644 --- a/Source/Modules/csharp.cxx +++ b/Source/Modules/csharp.cxx @@ -670,6 +670,7 @@ class CSHARP : public Language { /* Look to see if there is any newfree cleanup code */ if (Getattr(n,"feature:new")) { if ((tm = Swig_typemap_lookup_new("newfree",n,"result",0))) { + addThrows(n, "tmap:newfree", n); Replaceall(tm,"$source","result"); /* deprecated */ Printf(f->code,"%s\n",tm); } @@ -1299,6 +1300,7 @@ class CSHARP : public Language { // Use typemaps to transform type used in C# wrapper function (in proxy class) to type used in PInvoke function (in intermediary class) if ((tm = Getattr(p,"tmap:csin"))) { + addThrows(n, "tmap:csin", p); substituteClassname(pt, tm); Replaceall(tm, "$csinput", arg); Printv(imcall, tm, NIL); @@ -1321,22 +1323,24 @@ class CSHARP : public Language { Printf(imcall, ")"); Printf(function_code, ")"); - generateThrowsClause(n, function_code); // Transform return type used in PInvoke function (in intermediary class) to type used in C# wrapper function (in proxy class) if ((tm = Swig_typemap_lookup_new("csout",n,"",0))) { + addThrows(n, "tmap:csout", n); if (Getattr(n,"feature:new")) Replaceall(tm,"$owner","true"); else Replaceall(tm,"$owner","false"); substituteClassname(t, tm); Replaceall(tm, "$imcall", imcall); - Printf(function_code, " %s\n\n", tm); } else { Swig_warning(WARN_CSHARP_TYPEMAP_CSOUT_UNDEF, input_file, line_number, "No csout typemap defined for %s\n", SwigType_str(t,0)); } + generateThrowsClause(n, function_code); + Printf(function_code, " %s\n\n", tm ? tm : empty_string); + if(proxy_flag && wrapping_member_flag && !enum_constant_flag) { // Properties if(setter_flag) { @@ -1441,6 +1445,7 @@ class CSHARP : public Language { // Use typemaps to transform type used in C# wrapper function (in proxy class) to type used in PInvoke function (in intermediary class) if ((tm = Getattr(p,"tmap:csin"))) { + addThrows(n, "tmap:csin", p); substituteClassname(pt, tm); Replaceall(tm, "$csinput", arg); Printv(imcall, tm, NIL); @@ -1678,6 +1683,7 @@ class CSHARP : public Language { // Use typemaps to transform type used in C# wrapper function (in proxy class) to type used in PInvoke function (in intermediary class) if ((tm = Getattr(p,"tmap:csin"))) { + addThrows(n, "tmap:csin", p); substituteClassname(pt, tm); Replaceall(tm, "$csinput", arg); Printv(imcall, tm, NIL); @@ -1699,22 +1705,24 @@ class CSHARP : public Language { Printf(imcall, ")"); Printf(function_code, ")"); - generateThrowsClause(n, function_code); // Transform return type used in PInvoke function (in intermediary class) to type used in C# wrapper function (in module class) if ((tm = Swig_typemap_lookup_new("csout",n,"",0))) { + addThrows(n, "tmap:csout", n); if (Getattr(n,"feature:new")) Replaceall(tm,"$owner","true"); else Replaceall(tm,"$owner","false"); substituteClassname(t, tm); Replaceall(tm, "$imcall", imcall); - Printf(function_code, " %s\n\n", tm); } else { Swig_warning(WARN_CSHARP_TYPEMAP_CSOUT_UNDEF, input_file, line_number, "No csout typemap defined for %s\n", SwigType_str(t,0)); } + generateThrowsClause(n, function_code); + Printf(function_code, " %s\n\n", tm ? tm : empty_string); + if (proxy_flag && global_variable_flag) { // Properties if(setter_flag) { diff --git a/Source/Modules/java.cxx b/Source/Modules/java.cxx index 9e755c777..df08e2f01 100644 --- a/Source/Modules/java.cxx +++ b/Source/Modules/java.cxx @@ -743,6 +743,7 @@ class JAVA : public Language { /* Look to see if there is any newfree cleanup code */ if (Getattr(n,"feature:new")) { if ((tm = Swig_typemap_lookup_new("newfree",n,"result",0))) { + addThrows(n, "tmap:newfree", n); Replaceall(tm,"$source","result"); /* deprecated */ Printf(f->code,"%s\n",tm); } @@ -1398,6 +1399,7 @@ class JAVA : public Language { // Use typemaps to transform type used in Java proxy wrapper (in proxy class) to type used in JNI function (in intermediary class) if ((tm = Getattr(p,"tmap:javain"))) { + addThrows(n, "tmap:javain", p); substituteClassname(pt, tm); Replaceall(tm, "$javainput", arg); Printv(imcall, tm, NIL); @@ -1420,22 +1422,23 @@ class JAVA : public Language { Printf(imcall, ")"); Printf(function_code, ")"); - generateThrowsClause(n, function_code); // Transform return type used in JNI function (in intermediary class) to type used in Java wrapper function (in proxy class) if ((tm = Swig_typemap_lookup_new("javaout",n,"",0))) { + addThrows(n, "tmap:javaout", n); if (Getattr(n,"feature:new")) Replaceall(tm,"$owner","true"); else Replaceall(tm,"$owner","false"); substituteClassname(t, tm); Replaceall(tm, "$jnicall", imcall); - Printf(function_code, " %s\n\n", tm); } else { Swig_warning(WARN_JAVA_TYPEMAP_JAVAOUT_UNDEF, input_file, line_number, "No javaout typemap defined for %s\n", SwigType_str(t,0)); } + generateThrowsClause(n, function_code); + Printf(function_code, " %s\n\n", tm ? tm : empty_string); Printv(proxy_class_code, function_code, NIL); Delete(function_code); @@ -1506,6 +1509,7 @@ class JAVA : public Language { // Use typemaps to transform type used in Java wrapper function (in proxy class) to type used in JNI function (in intermediary class) if ((tm = Getattr(p,"tmap:javain"))) { + addThrows(n, "tmap:javain", p); substituteClassname(pt, tm); Replaceall(tm, "$javainput", arg); Printv(imcall, tm, NIL); @@ -1704,6 +1708,7 @@ class JAVA : public Language { // Use typemaps to transform type used in Java wrapper function (in proxy class) to type used in JNI function (in intermediary class) if ((tm = Getattr(p,"tmap:javain"))) { + addThrows(n, "tmap:javain", p); substituteClassname(pt, tm); Replaceall(tm, "$javainput", arg); Printv(imcall, tm, NIL); @@ -1725,22 +1730,23 @@ class JAVA : public Language { Printf(imcall, ")"); Printf(function_code, ")"); - generateThrowsClause(n, function_code); // Transform return type used in JNI function (in intermediary class) to type used in Java wrapper function (in module class) if ((tm = Swig_typemap_lookup_new("javaout",n,"",0))) { + addThrows(n, "tmap:javaout", n); if (Getattr(n,"feature:new")) Replaceall(tm,"$owner","true"); else Replaceall(tm,"$owner","false"); substituteClassname(t, tm); Replaceall(tm, "$jnicall", imcall); - Printf(function_code, " %s\n\n", tm); } else { Swig_warning(WARN_JAVA_TYPEMAP_JAVAOUT_UNDEF, input_file, line_number, "No javaout typemap defined for %s\n", SwigType_str(t,0)); } + generateThrowsClause(n, function_code); + Printf(function_code, " %s\n\n", tm ? tm : empty_string); Printv(module_class_code, function_code, NIL); Delete(function_code);