Revert support for %extend and memberin typemaps added in swig-1.3.39. The memberin typemaps are ignored again for member variables within a %extend block. Documentation inconsistency reported by Torsten Landschoff.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11762 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
b9817010fb
commit
2bd190dbf1
9 changed files with 85 additions and 38 deletions
25
Examples/test-suite/memberin_extend_c.i
Normal file
25
Examples/test-suite/memberin_extend_c.i
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
%module memberin_extend_c
|
||||
|
||||
/* Example from the Manual, section 5.5.6: "Adding member functions to C structures" */
|
||||
|
||||
%{
|
||||
typedef struct {
|
||||
char name[50];
|
||||
} Person;
|
||||
%}
|
||||
|
||||
typedef struct {
|
||||
%extend {
|
||||
char *name;
|
||||
}
|
||||
} Person;
|
||||
|
||||
/* Specific implementation of set/get functions */
|
||||
%{
|
||||
char *Person_name_get(Person *p) {
|
||||
return p->name;
|
||||
}
|
||||
void Person_name_set(Person *p, char *val) {
|
||||
strncpy(p->name,val,50);
|
||||
}
|
||||
%}
|
||||
Loading…
Add table
Add a link
Reference in a new issue