Change typemap matching rules for the default type (SWIGTYPE) to follow template partial specialization type deduction. Fixes some containers of const pointers. SWIGTYPE*& typemps removed and replaced with SWIGTYPE *const&.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11958 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
b1c5940786
commit
bdb136d611
41 changed files with 477 additions and 122 deletions
|
|
@ -40,7 +40,7 @@
|
|||
%typemap(consttab) long long, unsigned long long
|
||||
{ SWIG_LUA_STRING, (char *) "$symname", 0, 0, (void *)"$value", 0}
|
||||
|
||||
%typemap(consttab) SWIGTYPE *, SWIGTYPE &, SWIGTYPE []
|
||||
%typemap(consttab) SWIGTYPE *, SWIGTYPE *const, SWIGTYPE &, SWIGTYPE []
|
||||
{ SWIG_LUA_POINTER, (char *)"$symname", 0, 0, (void *)$value, &$1_descriptor}
|
||||
|
||||
// member function pointers
|
||||
|
|
|
|||
|
|
@ -167,11 +167,11 @@ temp=($basetype)lua_tonumber(L,$input); $1=&temp;%}
|
|||
// Also needed for object ptrs by const ref
|
||||
// eg A* const& ref_pointer(A* const& a);
|
||||
// found in mixed_types.i
|
||||
%typemap(in,checkfn="lua_isuserdata") SWIGTYPE *&($*ltype temp)
|
||||
%typemap(in,checkfn="lua_isuserdata") SWIGTYPE *const&($*ltype temp)
|
||||
%{temp=($*ltype)SWIG_MustGetPtr(L,$input,$*descriptor,0,$argnum,"$symname");
|
||||
$1=&temp;%}
|
||||
$1=($1_ltype)&temp;%}
|
||||
|
||||
%typemap(out) SWIGTYPE *&
|
||||
%typemap(out) SWIGTYPE *const&
|
||||
%{SWIG_NewPointerObj(L,*$1,$*descriptor,$owner); SWIG_arg++; %}
|
||||
|
||||
|
||||
|
|
@ -335,7 +335,7 @@ parmeters match which function
|
|||
// Also needed for object ptrs by const ref
|
||||
// eg const A* ref_pointer(A* const& a);
|
||||
// found in mixed_types.i
|
||||
%typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE* const &
|
||||
%typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE *const&
|
||||
{
|
||||
void *ptr;
|
||||
if (lua_isuserdata(L,$input)==0 || SWIG_ConvertPtr(L,$input, (void **) &ptr, $*descriptor, 0)) {
|
||||
|
|
@ -352,6 +352,9 @@ parmeters match which function
|
|||
// Array reference typemaps
|
||||
%apply SWIGTYPE & { SWIGTYPE ((&)[ANY]) }
|
||||
|
||||
/* const pointers */
|
||||
%apply SWIGTYPE * { SWIGTYPE *const }
|
||||
|
||||
// size_t (which is just a unsigned long)
|
||||
%apply unsigned long { size_t };
|
||||
%apply const unsigned long & { const size_t & };
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue