adding support for structs, docu

This commit is contained in:
Frank Schlimbach 2019-02-28 02:48:05 -06:00 • committed by Olly Betts
commit 4ce2964ab8
2 changed files with 7 additions and 6 deletions

View file

@ -6,17 +6,15 @@
%inline %{ %inline %{
namespace interface1 namespace interface1
{ {
class A struct A
{ {
public:
int get(int) {return 10;} int get(int) {return 10;}
}; };
} }
using interface1::A; using interface1::A;
class B : public A struct B : public A
{ {
public:
using A::get; using A::get;
int get(double) {return 20;} int get(double) {return 20;}
}; };

View file

@ -384,12 +384,15 @@ String *Swig_symbol_qualified_language_scopename(Symtab *n) {
/* ----------------------------------------------------------------------------- /* -----------------------------------------------------------------------------
* Swig_symbol_add_using() * Swig_symbol_add_using()
*
* Adds a node to the C symbol table for a using declaration.
* Used for using-declarations within classes/structs.
* ----------------------------------------------------------------------------- */ * ----------------------------------------------------------------------------- */
void Swig_symbol_add_using(String * name, String * uname, Node * n) { void Swig_symbol_add_using(String * name, String * uname, Node * n) {
Hash *h; Hash *h;
h = Swig_symbol_clookup(uname,0); h = Swig_symbol_clookup(uname, 0);
if (h && checkAttribute(h, "kind", "class")) { if (h && (checkAttribute(h, "kind", "class") || checkAttribute(h, "kind", "struct"))) {
String *qcurrent = Swig_symbol_qualifiedscopename(0); String *qcurrent = Swig_symbol_qualifiedscopename(0);
if (qcurrent) { if (qcurrent) {
Append(qcurrent, "::"); Append(qcurrent, "::");