Refactored the overloaded method error into
a simple auxiliary function in a .swg file. This makes the resulting .cxx files a little bit less bloated. git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@9767 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
f6f61e8328
commit
8e630bd57d
2 changed files with 23 additions and 7 deletions
|
|
@ -87,6 +87,9 @@ SWIG_Ruby_ErrorType(int SWIG_code) {
|
|||
}
|
||||
|
||||
|
||||
/* This function is called when a user inputs a wrong argument to
|
||||
a method.
|
||||
*/
|
||||
SWIGINTERN
|
||||
const char* Ruby_Format_TypeError( const char* msg,
|
||||
const char* type,
|
||||
|
|
@ -132,3 +135,19 @@ const char* Ruby_Format_TypeError( const char* msg,
|
|||
|
||||
return StringValuePtr( str );
|
||||
}
|
||||
|
||||
/* This function is called when an overloaded method fails */
|
||||
SWIGINTERN
|
||||
void Ruby_Format_OverloadedError(
|
||||
const int argc,
|
||||
const int maxargs,
|
||||
const char* method,
|
||||
const char* prototypes
|
||||
)
|
||||
{
|
||||
const char* msg = "Wrong # of arguments";
|
||||
if ( argc <= maxargs ) msg = "Wrong arguments";
|
||||
rb_raise(rb_eArgError,"%s for overloaded method '%s'.\n"
|
||||
"Possible C/C++ prototypes are:\n%s",
|
||||
msg, method, prototypes);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue