error fix in lang.cxx and more comments

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5871 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Marcelo Matus 2004-04-11 08:09:57 +00:00
commit 64c0b01733
2 changed files with 10 additions and 8 deletions

View file

@ -307,12 +307,11 @@ static void add_symbols(Node *n) {
Setattr(n,"access", "protected");
only_csymbol = !need_protected(n, dirprot_mode);
} else {
/* private are needed only when they are pure virtuals */
Setattr(n,"access", "private");
if ((Cmp(Getattr(n,"storage"),"virtual") == 0)
&& (Cmp(Getattr(n,"value"),"0") == 0)) {
only_csymbol = !need_protected(n, dirprot_mode);
} else {
Setattr(n,"feature:ignore","1");
}
}
if (only_csymbol) {

View file

@ -735,10 +735,13 @@ int Language::cDeclaration(Node *n) {
if (cplus_mode != CPLUS_PUBLIC) {
/* except for friends, they are not affected by access control */
int isfriend = storage && (Cmp(storage,"friend") == 0);
if (!isfriend) {
/* and for protected/private members, we check what director needs */
if ((cplus_mode == CPLUS_PRIVATE) && (IsVirtual != PURE_VIRTUAL)) return SWIG_NOWRAP;
if (!(dirprot_mode() && is_member_director(CurrentClass,n)))
if (!isfriend ) {
/* and for protected/private members, we check what director
needs. The private members will only be considered if they
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;
}
}
@ -1788,7 +1791,7 @@ int Language::classDeclaration(Node *n) {
int ndir = checkAttribute(n, "feature:director", "1") || director_mode;
int nndir = checkAttribute(n, "feature:nodirector", "1");
/* 'nodirector' has precedence over 'director' */
int dir = (ndir || nndir) ? (ndir && !nndir) : 1;
int dir = (ndir || nndir) ? (ndir && !nndir) : 0;
if (directorsEnabled() && dir) {
classDirector(n);
}
@ -1864,8 +1867,8 @@ int Language::classHandler(Node *n) {
Node* parentnode = Getattr(method, "parentNode");
String* methodname = Getattr(method,"sym:name");
String* wrapname = NewStringf("%s_%s", symname,methodname);
/* only pure virtual abstract private methods are needed */
int need_private = (is_private(method)
&& (Cmp(Getattr(method,"storage"),"virtual") == 0)
&& (Cmp(Getattr(method,"value"),"0") == 0));
if (!Getattr(symbols,wrapname)
&& !Cmp(director,"1")