add test for %newobject
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@8488 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
42383077ea
commit
414989ff28
1 changed files with 12 additions and 0 deletions
|
|
@ -113,3 +113,15 @@ const char global_const_char_array1[] = CPLUSPLUS_MSG;
|
|||
const char global_const_char_array2[sizeof(CPLUSPLUS_MSG)+1] = CPLUSPLUS_MSG;
|
||||
|
||||
%}
|
||||
|
||||
|
||||
// %typemap(newfree) char *GetNewCharString() { /* hello */ delete[] $1; }
|
||||
%newobject GetNewCharString();
|
||||
|
||||
%inline {
|
||||
char *GetNewCharString() {
|
||||
char *nstr = new char[sizeof(CPLUSPLUS_MSG)+1];
|
||||
strcpy(nstr, CPLUSPLUS_MSG);
|
||||
return nstr;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue