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
|
|
@ -2005,13 +2005,10 @@ public:
|
|||
Append( protoTypes, ")\\n\"" );
|
||||
} while ((sibl = Getattr(sibl, "sym:nextSibling")));
|
||||
|
||||
Append(f->code, "fail:\n{\n");
|
||||
Printf(f->code, "const char* swigMsg = \"Wrong # of arguments\";\n");
|
||||
Printf(f->code, "if ( argc <= %d ) msg = \"Wrong arguments\";\n", maxargs);
|
||||
Printf(f->code, "rb_raise(rb_eArgError,"
|
||||
"\"%%s for overloaded method '%s'.\\n"
|
||||
" Possible C/C++ prototypes are:\\n\"%s, swigMsg);\n", methodName, protoTypes);
|
||||
Append(f->code, "}\nreturn Qnil;\n");
|
||||
Append(f->code, "fail:\n");
|
||||
Printf(f->code, "Ruby_Format_OverloadedError( argc, %d, \"%s\", %s);\n",
|
||||
maxargs, methodName, protoTypes);
|
||||
Append(f->code, "\nreturn Qnil;\n");
|
||||
|
||||
Delete(methodName);
|
||||
Delete(type);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue