From effab096e57219d6852ce262f1cfdc9129854c59 Mon Sep 17 00:00:00 2001 From: Gonzalo Garramuno Date: Sun, 29 Apr 2007 20:49:19 +0000 Subject: [PATCH] Added Ruby_Format_TypeError() function to format swig type errors for ruby properly. git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@9710 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- Lib/ruby/rubyerrors.swg | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Lib/ruby/rubyerrors.swg b/Lib/ruby/rubyerrors.swg index 9f2737334..53c494f8e 100644 --- a/Lib/ruby/rubyerrors.swg +++ b/Lib/ruby/rubyerrors.swg @@ -87,4 +87,13 @@ SWIG_Ruby_ErrorType(int SWIG_code) { } - +const char* Ruby_Format_TypeError( const char* msg, + const char* type, + const char* name, + const int argn ) +{ + static char buf[1024]; + sprintf( buf, "%sin method '%s', argument %d of type %s", + msg, name, argn-1, type ); + return buf; +}