avoid using reference value for static members, since it can generate unresolved symbols for static const
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@6916 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
ba413fd500
commit
63ecf6ec37
3 changed files with 20 additions and 4 deletions
|
|
@ -52,6 +52,5 @@
|
|||
|
||||
%{
|
||||
const int Foo::z = 3;
|
||||
const int Foo::zz;
|
||||
int Foo::zx;
|
||||
%}
|
||||
|
|
|
|||
|
|
@ -1207,13 +1207,25 @@ Language::membervariableHandler(Node *n) {
|
|||
|
||||
int assignable = is_assignable(n);
|
||||
|
||||
if (SmartPointer) {
|
||||
if (!Getattr(n,"classname")) {
|
||||
Setattr(n,"classname",Getattr(CurrentClass,"allocate:smartpointerbase"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (assignable) {
|
||||
int make_wrapper = 1;
|
||||
String *tm = 0;
|
||||
String *target = 0;
|
||||
if (!Extend) {
|
||||
if (SmartPointer) {
|
||||
target = NewStringf("(*%s)->%s", Swig_cparm_name(0,0),name);
|
||||
if (checkAttribute(n, "storage", "static")) {
|
||||
String *base = Getattr(n,"classname");
|
||||
target = NewStringf("%s::%s", base,name);
|
||||
} else {
|
||||
target = NewStringf("(*%s)->%s",Swig_cparm_name(0,0),name);
|
||||
}
|
||||
} else {
|
||||
target = NewStringf("%s->%s", Swig_cparm_name(0,0),name);
|
||||
}
|
||||
|
|
@ -1254,7 +1266,7 @@ Language::membervariableHandler(Node *n) {
|
|||
}
|
||||
/* Emit get function */
|
||||
{
|
||||
Swig_MembergetToFunction(n,ClassType,Extend | SmartPointer);
|
||||
Swig_MembergetToFunction(n,ClassType, Extend | SmartPointer);
|
||||
Setattr(n,"sym:name", mrename_get);
|
||||
functionWrapper(n);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1147,7 +1147,12 @@ Swig_MembergetToFunction(Node *n, String *classname, int flags) {
|
|||
varref = flags & CWRAP_VAR_REFERENCE;
|
||||
|
||||
if (flags & CWRAP_SMART_POINTER) {
|
||||
self = NewString("(*this)->");
|
||||
if (checkAttribute(n, "storage", "static")) {
|
||||
String *base = Getattr(n,"classname");
|
||||
self = NewStringf("%s::", base);
|
||||
} else {
|
||||
self = NewString("(*this)->");
|
||||
}
|
||||
}
|
||||
|
||||
name = Getattr(n,"name");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue