Fix wrapping of char * member variables (or any types with a memberin typemap) when using allprotected mode.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10431 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
d967ef74bd
commit
efa0db04c6
3 changed files with 9 additions and 3 deletions
|
|
@ -1,6 +1,10 @@
|
||||||
Version 1.3.36 (in progress)
|
Version 1.3.36 (in progress)
|
||||||
=============================
|
=============================
|
||||||
|
|
||||||
|
05/09/2008: wsfulton
|
||||||
|
Fix wrapping of char * member variables when using allprotected mode.
|
||||||
|
Bug reported by Warren Wang.
|
||||||
|
|
||||||
05/09/2008: olly
|
05/09/2008: olly
|
||||||
[PHP] Fix bad PHP code generated when wrapping an enum in a
|
[PHP] Fix bad PHP code generated when wrapping an enum in a
|
||||||
namespace (uncovered by testcase arrays_scope).
|
namespace (uncovered by testcase arrays_scope).
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ class PublicBase {
|
||||||
public:
|
public:
|
||||||
enum AnEnum { EnumVal1, EnumVal2 };
|
enum AnEnum { EnumVal1, EnumVal2 };
|
||||||
public:
|
public:
|
||||||
PublicBase(const char* s): str(s) {}
|
PublicBase(const char* s): str(s), instanceMemberVariable(0), anEnum(EnumVal1), stringMember(0) {}
|
||||||
virtual ~PublicBase() { }
|
virtual ~PublicBase() { }
|
||||||
virtual std::string virtualMethod() const { return "PublicBase"; }
|
virtual std::string virtualMethod() const { return "PublicBase"; }
|
||||||
Klass instanceMethod(Klass k) const { return k; }
|
Klass instanceMethod(Klass k) const { return k; }
|
||||||
|
|
@ -41,6 +41,7 @@ public:
|
||||||
static int staticMemberVariable;
|
static int staticMemberVariable;
|
||||||
static const int staticConstMemberVariable = 20;
|
static const int staticConstMemberVariable = 20;
|
||||||
AnEnum anEnum;
|
AnEnum anEnum;
|
||||||
|
char *stringMember;
|
||||||
};
|
};
|
||||||
int PublicBase::staticMemberVariable = 10;
|
int PublicBase::staticMemberVariable = 10;
|
||||||
|
|
||||||
|
|
@ -50,7 +51,7 @@ public:
|
||||||
enum AnEnum { EnumVal1, EnumVal2 };
|
enum AnEnum { EnumVal1, EnumVal2 };
|
||||||
std::string getName() { return str; }
|
std::string getName() { return str; }
|
||||||
protected:
|
protected:
|
||||||
ProtectedBase(const char* s): str(s) {}
|
ProtectedBase(const char* s): str(s), instanceMemberVariable(0), anEnum(EnumVal1), stringMember(0), protectedenum(ProtEnumVal1) {}
|
||||||
virtual ~ProtectedBase() { }
|
virtual ~ProtectedBase() { }
|
||||||
virtual std::string virtualMethod() const { return "ProtectedBase"; }
|
virtual std::string virtualMethod() const { return "ProtectedBase"; }
|
||||||
Klass instanceMethod(Klass k) const { return k; }
|
Klass instanceMethod(Klass k) const { return k; }
|
||||||
|
|
@ -63,6 +64,7 @@ protected:
|
||||||
static int staticMemberVariable;
|
static int staticMemberVariable;
|
||||||
static const int staticConstMemberVariable = 20;
|
static const int staticConstMemberVariable = 20;
|
||||||
AnEnum anEnum;
|
AnEnum anEnum;
|
||||||
|
char *stringMember;
|
||||||
|
|
||||||
// unsupported: types defined with protected access and thus methods/variables which use them
|
// unsupported: types defined with protected access and thus methods/variables which use them
|
||||||
enum ProtectedEnum { ProtEnumVal1, ProtEnumVal2 };
|
enum ProtectedEnum { ProtEnumVal1, ProtEnumVal2 };
|
||||||
|
|
|
||||||
|
|
@ -1428,7 +1428,7 @@ int Language::membervariableHandler(Node *n) {
|
||||||
Delete(pname);
|
Delete(pname);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
String *pname = Swig_cparm_name(0, 0);
|
String *pname = is_non_virtual_protected_access(n) ? NewString("darg") : Swig_cparm_name(0, 0);
|
||||||
target = NewStringf("%s->%s", pname, name);
|
target = NewStringf("%s->%s", pname, name);
|
||||||
Delete(pname);
|
Delete(pname);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue