From 31edb1fcbd029c81d9340341115d4f35ea729ec3 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Tue, 18 Nov 2003 22:31:50 +0000 Subject: [PATCH] Contract assert macro added git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5337 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- Lib/java/javahead.swg | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Lib/java/javahead.swg b/Lib/java/javahead.swg index 70ef1d62f..1a6d84759 100644 --- a/Lib/java/javahead.swg +++ b/Lib/java/javahead.swg @@ -88,4 +88,8 @@ void SWIG_JavaThrowException(JNIEnv *jenv, SWIG_JavaExceptionCodes code, const c } %insert(runtime) %{ #endif + +/* Contract support */ + +#define SWIG_contract_assert(nullreturn, expr, msg) if (!(expr)) {SWIG_JavaThrowException(jenv, SWIG_JavaIllegalArgumentException, msg); return nullreturn; } else %}