diff options
author | William S Fulton <wsf@fultondesigns.co.uk> | 2018-04-07 12:34:08 +0100 |
---|---|---|
committer | William S Fulton <wsf@fultondesigns.co.uk> | 2018-04-07 12:34:08 +0100 |
commit | 5ccae6eac6554f484e12c2121426c379d91682a3 (patch) | |
tree | ab078fb5c8e90e27aebe2d47ba7a0e35d1248fe7 /Source/Modules/ruby.cxx | |
parent | 3bea8f6b7e0449946c12a0ce2c5aa893d6026883 (diff) | |
parent | a1cea4f483144952989580f54e73f38f94b90562 (diff) | |
download | swig-5ccae6eac6554f484e12c2121426c379d91682a3.tar.gz |
Merge branch 'goatshriek-ruby-alias'
* goatshriek-ruby-alias:
Fix ruby %alias directive for native c functions
Diffstat (limited to 'Source/Modules/ruby.cxx')
-rw-r--r-- | Source/Modules/ruby.cxx | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Source/Modules/ruby.cxx b/Source/Modules/ruby.cxx index 641604620..a2ede5ff6 100644 --- a/Source/Modules/ruby.cxx +++ b/Source/Modules/ruby.cxx @@ -1316,7 +1316,13 @@ public: Iterator alias = First(aliases); while (alias.item) { if (Len(alias.item) > 0) { - if (multipleInheritance) { + if (current == NO_CPP) { + if (useGlobalModule) { + Printv(f_init, tab4, "rb_define_alias(rb_cObject, \"", alias.item, "\", \"", iname, "\");\n", NIL); + } else { + Printv(f_init, tab4, "rb_define_alias(rb_singleton_class(", modvar, "), \"", alias.item, "\", \"", iname, "\");\n", NIL); + } + } else if (multipleInheritance) { Printv(klass->init, tab4, "rb_define_alias(", klass->mImpl, ", \"", alias.item, "\", \"", iname, "\");\n", NIL); } else { Printv(klass->init, tab4, "rb_define_alias(", klass->vname, ", \"", alias.item, "\", \"", iname, "\");\n", NIL); |