Fix for global "const char *" variables.
Fix testcases arrays_dimensionless, arrays_global. git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@7272 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
f4aaf0f5f0
commit
624cb6e892
1 changed files with 7 additions and 1 deletions
|
|
@ -8,10 +8,12 @@
|
|||
%typemap(in) SWIGTYPE *, SWIGTYPE &, SWIGTYPE [] {
|
||||
$1 = ($1_ltype)SWIG_MustGetPtr($input, $descriptor, $argnum, 0);
|
||||
}
|
||||
%typemap(freearg) SWIGTYPE *, SWIGTYPE &, SWIGTYPE [] "";
|
||||
|
||||
%typemap(in) void * {
|
||||
$1 = SWIG_MustGetPtr($input, NULL, $argnum, 0);
|
||||
}
|
||||
%typemap(freearg) void * "";
|
||||
|
||||
%typemap(varin) SWIGTYPE * {
|
||||
$1 = ($1_ltype)SWIG_MustGetPtr($input, $descriptor, 1, 0);
|
||||
|
|
@ -258,13 +260,17 @@
|
|||
|
||||
%typemap (freearg) char *OUTPUT, char *BOTH "";
|
||||
|
||||
/* If we set a string variable, delete the old result first. */
|
||||
/* If we set a string variable, delete the old result first, unless const. */
|
||||
|
||||
%typemap (varin) char * {
|
||||
if ($1) free($1);
|
||||
$1 = SWIG_scm2str($input);
|
||||
}
|
||||
|
||||
%typemap (varin) const char * {
|
||||
$1 = SWIG_scm2str($input);
|
||||
}
|
||||
|
||||
/* Void */
|
||||
|
||||
%typemap (out,doc="") void "gswig_result = SCM_UNSPECIFIED;";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue