[lua] bugfix 1938142 (bool& and bool* support)
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10527 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
32617f7804
commit
de6d6ccaa8
4 changed files with 67 additions and 2 deletions
|
|
@ -73,7 +73,7 @@
|
|||
%{$1 = (lua_toboolean(L, $input)!=0);%}
|
||||
|
||||
%typemap(out) bool
|
||||
%{ lua_pushboolean(L,(int)($1==true)); SWIG_arg++;%}
|
||||
%{ lua_pushboolean(L,(int)($1!=0)); SWIG_arg++;%}
|
||||
|
||||
// for const bool&, SWIG treats this as a const bool* so we must dereference it
|
||||
%typemap(in,checkfn="lua_isboolean") const bool& (bool temp)
|
||||
|
|
@ -81,7 +81,7 @@
|
|||
$1=&temp;%}
|
||||
|
||||
%typemap(out) const bool&
|
||||
%{ lua_pushboolean(L,(int)(*$1==true)); SWIG_arg++;%}
|
||||
%{ lua_pushboolean(L,(int)((*$1)!=0)); SWIG_arg++;%}
|
||||
|
||||
// strings (char* and char[])
|
||||
%typemap(in,checkfn="lua_isstring") const char*, char*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue