From edf8fc96ce3973d225ccbc96004479d889d53da2 Mon Sep 17 00:00:00 2001 From: Logan Johnson Date: Mon, 17 Nov 2003 20:24:13 +0000 Subject: [PATCH] Added Ruby module runtime support for SWIG_contract_assert() macro. git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5328 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- SWIG/Lib/ruby/rubyhead.swg | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/SWIG/Lib/ruby/rubyhead.swg b/SWIG/Lib/ruby/rubyhead.swg index a34f7eab7..90becd694 100644 --- a/SWIG/Lib/ruby/rubyhead.swg +++ b/SWIG/Lib/ruby/rubyhead.swg @@ -106,3 +106,7 @@ typedef struct { #define rb_undef_alloc_func(klass) rb_undef_method(CLASS_OF((klass)), "new") #endif +/* Contract support */ + +#define SWIG_contract_assert(expr, msg) if (!(expr)) { rb_raise(rb_eRuntimeError, (char *) msg ); } else +