From 40cb2afe0d3da75654f79daeceb7b7e0a2ce2c1d 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/SWIG@5328 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- Lib/ruby/rubyhead.swg | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Lib/ruby/rubyhead.swg b/Lib/ruby/rubyhead.swg index a34f7eab7..90becd694 100644 --- a/Lib/ruby/rubyhead.swg +++ b/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 +