Fix %extend with static const integral types.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@8223 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
67e13d9c19
commit
63a6a8ce09
1 changed files with 13 additions and 18 deletions
|
|
@ -754,7 +754,7 @@ int Language::cDeclaration(Node *n) {
|
||||||
if (ImportMode) return SWIG_NOWRAP;
|
if (ImportMode) return SWIG_NOWRAP;
|
||||||
|
|
||||||
/* If we're in extend mode and there is code, replace the $descriptor macros */
|
/* If we're in extend mode and there is code, replace the $descriptor macros */
|
||||||
if (Getattr(n,"feature:extend")) {
|
if (Extend) {
|
||||||
String *code = Getattr(n,"code");
|
String *code = Getattr(n,"code");
|
||||||
if (code) {
|
if (code) {
|
||||||
Setfile(code,Getfile(n));
|
Setfile(code,Getfile(n));
|
||||||
|
|
@ -1426,7 +1426,7 @@ Language::staticmembervariableHandler(Node *n)
|
||||||
|
|
||||||
String *name = Getattr(n,"name");
|
String *name = Getattr(n,"name");
|
||||||
String *cname = NewStringf("%s::%s", classname,name);
|
String *cname = NewStringf("%s::%s", classname,name);
|
||||||
if (Getattr(n,"feature:extend")) {
|
if (Extend) {
|
||||||
/* the variable is a synthesized one.
|
/* the variable is a synthesized one.
|
||||||
There's nothing we can do; we just keep the given value */
|
There's nothing we can do; we just keep the given value */
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -1515,30 +1515,25 @@ int Language::enumforwardDeclaration(Node *n) {
|
||||||
|
|
||||||
int Language::memberconstantHandler(Node *n) {
|
int Language::memberconstantHandler(Node *n) {
|
||||||
|
|
||||||
Swig_require("memberconstantHandler",n,"*name","*sym:name","*value",NIL);
|
Swig_require("memberconstantHandler",n,"*name","*sym:name","value",NIL);
|
||||||
|
|
||||||
String *name = Getattr(n,"name");
|
String *name = Getattr(n,"name");
|
||||||
String *symname = Getattr(n,"sym:name");
|
String *symname = Getattr(n,"sym:name");
|
||||||
String *value = Getattr(n,"value");
|
String *value = Getattr(n,"value");
|
||||||
|
|
||||||
String *mrename;
|
String *mrename = Swig_name_member(ClassPrefix, symname);
|
||||||
String *new_value;
|
|
||||||
|
|
||||||
mrename = Swig_name_member(ClassPrefix, symname);
|
|
||||||
/* Fixed by namespace-enum patch
|
|
||||||
if ((!value) || (Cmp(value,name) == 0)) {
|
|
||||||
new_value = NewStringf("%s::%s",ClassName,name);
|
|
||||||
} else {
|
|
||||||
new_value = NewString(value);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
new_value = Copy(value);
|
|
||||||
Setattr(n,"sym:name", mrename);
|
Setattr(n,"sym:name", mrename);
|
||||||
Setattr(n,"value", new_value);
|
|
||||||
Setattr(n,"name", NewStringf("%s::%s", ClassName,name));
|
String *new_name = 0;
|
||||||
|
if (Extend)
|
||||||
|
new_name = Copy(value);
|
||||||
|
else
|
||||||
|
new_name = NewStringf("%s::%s", ClassName, name);
|
||||||
|
Setattr(n,"name", new_name);
|
||||||
|
|
||||||
constantWrapper(n);
|
constantWrapper(n);
|
||||||
Delete(mrename);
|
Delete(mrename);
|
||||||
Delete(new_value);
|
Delete(new_name);
|
||||||
Swig_restore(n);
|
Swig_restore(n);
|
||||||
return SWIG_OK;
|
return SWIG_OK;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue