Fixed a minor issue in the test-suite regarding
trying to compile overloaded functions under C. Fixed refcount test crashing due to autodoc. git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@9765 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
a87644dc12
commit
0e4b239b3e
2 changed files with 32 additions and 23 deletions
|
|
@ -2,11 +2,20 @@ Version 1.3.32 (in progress)
|
||||||
============================
|
============================
|
||||||
|
|
||||||
05/03/2007: gga
|
05/03/2007: gga
|
||||||
|
[Ruby]
|
||||||
|
Applied patch for -minherit bug and exception classes.
|
||||||
|
This issue should be revisited more closely, as Multiple
|
||||||
|
Inheritance in Ruby is still problematic.
|
||||||
|
(patch/bug #1604878)
|
||||||
|
|
||||||
|
05/03/2007: gga
|
||||||
|
[Ruby]
|
||||||
Overloaded functions in ruby will now report to the user
|
Overloaded functions in ruby will now report to the user
|
||||||
the possible prototypes when the user mistypes the number or
|
the possible prototypes when the user mistypes the number or
|
||||||
type of a parameter.
|
type of a parameter.
|
||||||
|
|
||||||
05/03/2007: gga
|
05/03/2007: gga
|
||||||
|
[Ruby]
|
||||||
Forgot to document the bug fixing of an old bug regarding
|
Forgot to document the bug fixing of an old bug regarding
|
||||||
exceptions.
|
exceptions.
|
||||||
(bug #1458247)
|
(bug #1458247)
|
||||||
|
|
@ -82,7 +91,8 @@ Version 1.3.32 (in progress)
|
||||||
05/02/2007: gga
|
05/02/2007: gga
|
||||||
[Ruby]
|
[Ruby]
|
||||||
Changed the value of SWIG_TYPECHECK_BOOL to be 10000 (ie. higher
|
Changed the value of SWIG_TYPECHECK_BOOL to be 10000 (ie. higher
|
||||||
than that of all integers). This is because Ruby allows typecasting
|
than that of all integers).
|
||||||
|
This is because Ruby allows typecasting
|
||||||
integers down to booleans which can make overloaded functions on
|
integers down to booleans which can make overloaded functions on
|
||||||
bools and integers to fail.
|
bools and integers to fail.
|
||||||
(bug# 1488142)
|
(bug# 1488142)
|
||||||
|
|
|
||||||
|
|
@ -232,6 +232,7 @@ private:
|
||||||
* ------------------------------------------------------------ */
|
* ------------------------------------------------------------ */
|
||||||
|
|
||||||
String *docstring(Node *n, autodoc_t ad_type) {
|
String *docstring(Node *n, autodoc_t ad_type) {
|
||||||
|
|
||||||
String *str = Getattr(n, "feature:docstring");
|
String *str = Getattr(n, "feature:docstring");
|
||||||
bool have_ds = (str != NULL && Len(str) > 0);
|
bool have_ds = (str != NULL && Len(str) > 0);
|
||||||
bool have_auto = (Getattr(n, "feature:autodoc") && !GetFlag(n, "feature:noautodoc"));
|
bool have_auto = (Getattr(n, "feature:autodoc") && !GetFlag(n, "feature:noautodoc"));
|
||||||
|
|
@ -412,13 +413,13 @@ private:
|
||||||
n = Getattr(n, "sym:previousSibling");
|
n = Getattr(n, "sym:previousSibling");
|
||||||
|
|
||||||
Node *pn = Swig_methodclass(n);
|
Node *pn = Swig_methodclass(n);
|
||||||
String* class_name = Copy( Getattr(pn, "sym:name") );
|
|
||||||
|
|
||||||
String* super_names = NewString("");
|
String* super_names = NewString("");
|
||||||
|
String* class_name = Getattr(pn, "sym:name") ;
|
||||||
|
|
||||||
if ( !class_name ) class_name = NewString("");
|
if ( !class_name ) class_name = NewString("");
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
class_name = Copy(class_name);
|
||||||
List *baselist = Getattr(pn, "bases");
|
List *baselist = Getattr(pn, "bases");
|
||||||
if (baselist && Len(baselist)) {
|
if (baselist && Len(baselist)) {
|
||||||
Iterator base = First(baselist);
|
Iterator base = First(baselist);
|
||||||
|
|
@ -438,7 +439,8 @@ private:
|
||||||
String *parent_name = Copy( Getattr(parent, "sym:name") );
|
String *parent_name = Copy( Getattr(parent, "sym:name") );
|
||||||
if ( !parent_name ) {
|
if ( !parent_name ) {
|
||||||
Node* mod = Getattr(parent, "module");
|
Node* mod = Getattr(parent, "module");
|
||||||
parent_name = Copy( Getattr(mod, "name") );
|
if ( mod )
|
||||||
|
parent_name = Copy( Getattr(mod, "name") );
|
||||||
if ( parent_name )
|
if ( parent_name )
|
||||||
{
|
{
|
||||||
(Char(parent_name))[0] = toupper((Char(parent_name))[0]);
|
(Char(parent_name))[0] = toupper((Char(parent_name))[0]);
|
||||||
|
|
@ -1976,13 +1978,15 @@ public:
|
||||||
|
|
||||||
// Constructors will be treated specially
|
// Constructors will be treated specially
|
||||||
const bool isCtor = Cmp(Getattr(sibl,"feature:new"), "1") == 0;
|
const bool isCtor = Cmp(Getattr(sibl,"feature:new"), "1") == 0;
|
||||||
const bool isMethod = Cmp(Getattr(sibl, "ismember"), "1") == 0 && (!isCtor);
|
const bool isMethod = ( Cmp(Getattr(sibl, "ismember"), "1") == 0 &&
|
||||||
|
(!isCtor) );
|
||||||
|
|
||||||
// Construct real method name
|
// Construct real method name
|
||||||
String* methodName = NewString("");
|
String* methodName = NewString("");
|
||||||
if ( isMethod ) Printv( methodName, Getattr(parentNode(sibl),"sym:name"), ".", NIL );
|
if ( isMethod )
|
||||||
|
Printv( methodName, Getattr(parentNode(sibl),"sym:name"), ".", NIL );
|
||||||
Append( methodName, Getattr(sibl,"name" ) );
|
Append( methodName, Getattr(sibl,"name" ) );
|
||||||
if ( isCtor ) Append( methodName, ".new" );
|
if ( isCtor ) Append( methodName, ".new" );
|
||||||
|
|
||||||
// Generate prototype list
|
// Generate prototype list
|
||||||
String *protoTypes = NewString("");
|
String *protoTypes = NewString("");
|
||||||
|
|
@ -2001,13 +2005,13 @@ public:
|
||||||
Append( protoTypes, ")\\n\"" );
|
Append( protoTypes, ")\\n\"" );
|
||||||
} while ((sibl = Getattr(sibl, "sym:nextSibling")));
|
} while ((sibl = Getattr(sibl, "sym:nextSibling")));
|
||||||
|
|
||||||
Append(f->code, "fail:\n");
|
Append(f->code, "fail:\n{\n");
|
||||||
Printf(f->code, "const char* msg = \"Wrong # of arguments\";\n");
|
Printf(f->code, "const char* msg = \"Wrong # of arguments\";\n");
|
||||||
Printf(f->code, "if ( argc <= %d ) msg = \"Wrong arguments\";\n", maxargs);
|
Printf(f->code, "if ( argc <= %d ) msg = \"Wrong arguments\";\n", maxargs);
|
||||||
Printf(f->code, "rb_raise(rb_eArgError,"
|
Printf(f->code, "rb_raise(rb_eArgError,"
|
||||||
"\"%%s for overloaded method '%s'.\\n"
|
"\"%%s for overloaded method '%s'.\\n"
|
||||||
" Possible C/C++ prototypes are:\\n\"%s, msg);\n", methodName, protoTypes);
|
" Possible C/C++ prototypes are:\\n\"%s, msg);\n", methodName, protoTypes);
|
||||||
Append(f->code, "return Qnil;\n");
|
Append(f->code, "}\nreturn Qnil;\n");
|
||||||
|
|
||||||
Delete(methodName);
|
Delete(methodName);
|
||||||
Delete(type);
|
Delete(type);
|
||||||
|
|
@ -2389,21 +2393,16 @@ public:
|
||||||
Printv(klass->type, Getattr(n, "classtype"), NIL);
|
Printv(klass->type, Getattr(n, "classtype"), NIL);
|
||||||
Printv(f_wrappers, "swig_class c", valid_name, ";\n\n", NIL);
|
Printv(f_wrappers, "swig_class c", valid_name, ";\n\n", NIL);
|
||||||
Printv(klass->init, "\n", tab4, NIL);
|
Printv(klass->init, "\n", tab4, NIL);
|
||||||
if (multipleInheritance) {
|
|
||||||
if (!useGlobalModule) {
|
if (!useGlobalModule) {
|
||||||
Printv(klass->init, klass->vname, " = rb_define_class_under(", modvar, ", \"", klass->name, "\", rb_cObject);\n", NIL);
|
Printv(klass->init, klass->vname, " = rb_define_class_under(", modvar, ", \"", klass->name, "\", $super);\n", NIL);
|
||||||
} else {
|
|
||||||
Printv(klass->init, klass->vname, " = rb_define_class(\"", klass->name, "\", rb_cObject);\n", NIL);
|
|
||||||
}
|
|
||||||
Printv(klass->init, klass->mImpl, " = rb_define_module_under(", klass->vname, ", \"Impl\");\n", NIL);
|
|
||||||
} else {
|
} else {
|
||||||
if (!useGlobalModule) {
|
Printv(klass->init, klass->vname, " = rb_define_class(\"", klass->name,
|
||||||
Printv(klass->init, klass->vname, " = rb_define_class_under(", modvar,
|
"\", $super);\n", NIL);
|
||||||
", \"", klass->name, "\", $super);\n", NIL);
|
}
|
||||||
} else {
|
|
||||||
Printv(klass->init, klass->vname, " = rb_define_class(\"", klass->name,
|
if (multipleInheritance) {
|
||||||
"\", $super);\n", NIL);
|
Printv(klass->init, klass->mImpl, " = rb_define_module_under(", klass->vname, ", \"Impl\");\n", NIL);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SwigType *tt = NewString(name);
|
SwigType *tt = NewString(name);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue