From 8d7f52dfc6fa0b6b1c8a5f66b32037097df4fdb7 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Tue, 18 Nov 2003 22:38:34 +0000 Subject: [PATCH] Contract assert macro modification to handle void and non-void return types git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5339 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- SWIG/Source/Modules/csharp.cxx | 3 +++ SWIG/Source/Modules/java.cxx | 3 +++ 2 files changed, 6 insertions(+) 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