diff --git a/SWIG/Source/Modules/csharp.cxx b/SWIG/Source/Modules/csharp.cxx index de488c89e..4a7f84e84 100644 --- a/SWIG/Source/Modules/csharp.cxx +++ b/SWIG/Source/Modules/csharp.cxx @@ -696,6 +696,9 @@ class CSHARP : public Language { /* Substitute the cleanup code */ Replaceall(f->code,"$cleanup",cleanup); + /* Contract macro modification */ + Replaceall(f->code, "SWIG_contract_assert(", "SWIG_contract_assert($null, "); + if(!is_void_return) Replaceall(f->code,"$null","0"); else diff --git a/SWIG/Source/Modules/java.cxx b/SWIG/Source/Modules/java.cxx index db6425b77..8ec952ee6 100644 --- a/SWIG/Source/Modules/java.cxx +++ b/SWIG/Source/Modules/java.cxx @@ -974,6 +974,9 @@ class JAVA : public Language { /* Substitute the cleanup code */ Replaceall(f->code,"$cleanup",cleanup); + /* Contract macro modification */ + Replaceall(f->code, "SWIG_contract_assert(", "SWIG_contract_assert($null, "); + if(!is_void_return) Replaceall(f->code,"$null","0"); else