add test for %extend on member variable
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11382 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
224c83ef09
commit
0576ffcde7
3 changed files with 50 additions and 1 deletions
22
Examples/test-suite/memberin_extend.i
Normal file
22
Examples/test-suite/memberin_extend.i
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
%module memberin_extend
|
||||
|
||||
// Tests memberin typemap. The default char * memberin typemap will be used.
|
||||
// The test extends the struct with a pseudo member variable
|
||||
|
||||
%inline %{
|
||||
#include <string>
|
||||
struct ExtendMe {
|
||||
};
|
||||
%}
|
||||
|
||||
%{
|
||||
#include <map>
|
||||
std::map<ExtendMe*, char *> ExtendMeStringMap;
|
||||
#define ExtendMe_thing_set(self_, val_) ExtendMeStringMap[self_]
|
||||
#define ExtendMe_thing_get(self_) ExtendMeStringMap[self_]
|
||||
%}
|
||||
|
||||
%extend ExtendMe {
|
||||
char *thing;
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue