error fix in lang.cxx and more comments
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5871 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
cdf6bd6d74
commit
aa33886558
2 changed files with 10 additions and 8 deletions
|
|
@ -307,12 +307,11 @@ static void add_symbols(Node *n) {
|
||||||
Setattr(n,"access", "protected");
|
Setattr(n,"access", "protected");
|
||||||
only_csymbol = !need_protected(n, dirprot_mode);
|
only_csymbol = !need_protected(n, dirprot_mode);
|
||||||
} else {
|
} else {
|
||||||
|
/* private are needed only when they are pure virtuals */
|
||||||
Setattr(n,"access", "private");
|
Setattr(n,"access", "private");
|
||||||
if ((Cmp(Getattr(n,"storage"),"virtual") == 0)
|
if ((Cmp(Getattr(n,"storage"),"virtual") == 0)
|
||||||
&& (Cmp(Getattr(n,"value"),"0") == 0)) {
|
&& (Cmp(Getattr(n,"value"),"0") == 0)) {
|
||||||
only_csymbol = !need_protected(n, dirprot_mode);
|
only_csymbol = !need_protected(n, dirprot_mode);
|
||||||
} else {
|
|
||||||
Setattr(n,"feature:ignore","1");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (only_csymbol) {
|
if (only_csymbol) {
|
||||||
|
|
|
||||||
|
|
@ -735,10 +735,13 @@ int Language::cDeclaration(Node *n) {
|
||||||
if (cplus_mode != CPLUS_PUBLIC) {
|
if (cplus_mode != CPLUS_PUBLIC) {
|
||||||
/* except for friends, they are not affected by access control */
|
/* except for friends, they are not affected by access control */
|
||||||
int isfriend = storage && (Cmp(storage,"friend") == 0);
|
int isfriend = storage && (Cmp(storage,"friend") == 0);
|
||||||
if (!isfriend) {
|
if (!isfriend ) {
|
||||||
/* and for protected/private members, we check what director needs */
|
/* and for protected/private members, we check what director
|
||||||
if ((cplus_mode == CPLUS_PRIVATE) && (IsVirtual != PURE_VIRTUAL)) return SWIG_NOWRAP;
|
needs. The private members will only be considered if they
|
||||||
if (!(dirprot_mode() && is_member_director(CurrentClass,n)))
|
are pure virtuals */
|
||||||
|
int need_nopublic = dirprot_mode() &&
|
||||||
|
(is_protected(n) || (is_private(n) && (Cmp(Getattr(n,"value"),"0") == 0)));
|
||||||
|
if (!(need_nopublic && is_member_director(CurrentClass,n)))
|
||||||
return SWIG_NOWRAP;
|
return SWIG_NOWRAP;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1788,7 +1791,7 @@ int Language::classDeclaration(Node *n) {
|
||||||
int ndir = checkAttribute(n, "feature:director", "1") || director_mode;
|
int ndir = checkAttribute(n, "feature:director", "1") || director_mode;
|
||||||
int nndir = checkAttribute(n, "feature:nodirector", "1");
|
int nndir = checkAttribute(n, "feature:nodirector", "1");
|
||||||
/* 'nodirector' has precedence over 'director' */
|
/* 'nodirector' has precedence over 'director' */
|
||||||
int dir = (ndir || nndir) ? (ndir && !nndir) : 1;
|
int dir = (ndir || nndir) ? (ndir && !nndir) : 0;
|
||||||
if (directorsEnabled() && dir) {
|
if (directorsEnabled() && dir) {
|
||||||
classDirector(n);
|
classDirector(n);
|
||||||
}
|
}
|
||||||
|
|
@ -1864,8 +1867,8 @@ int Language::classHandler(Node *n) {
|
||||||
Node* parentnode = Getattr(method, "parentNode");
|
Node* parentnode = Getattr(method, "parentNode");
|
||||||
String* methodname = Getattr(method,"sym:name");
|
String* methodname = Getattr(method,"sym:name");
|
||||||
String* wrapname = NewStringf("%s_%s", symname,methodname);
|
String* wrapname = NewStringf("%s_%s", symname,methodname);
|
||||||
|
/* only pure virtual abstract private methods are needed */
|
||||||
int need_private = (is_private(method)
|
int need_private = (is_private(method)
|
||||||
&& (Cmp(Getattr(method,"storage"),"virtual") == 0)
|
|
||||||
&& (Cmp(Getattr(method,"value"),"0") == 0));
|
&& (Cmp(Getattr(method,"value"),"0") == 0));
|
||||||
if (!Getattr(symbols,wrapname)
|
if (!Getattr(symbols,wrapname)
|
||||||
&& !Cmp(director,"1")
|
&& !Cmp(director,"1")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue