const enum reference typemaps fixed
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@9891 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
6e4d5b4b3a
commit
7797ae82aa
2 changed files with 10 additions and 5 deletions
|
|
@ -1,6 +1,9 @@
|
||||||
Version 1.3.32 (in progress)
|
Version 1.3.32 (in progress)
|
||||||
============================
|
============================
|
||||||
|
|
||||||
|
08/10/2007: wsfulton
|
||||||
|
[Lua] const enum reference typemaps fixed.
|
||||||
|
|
||||||
08/09/2007: wsfulton
|
08/09/2007: wsfulton
|
||||||
[C#] Added missing support for C++ class member pointers.
|
[C#] Added missing support for C++ class member pointers.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -33,9 +33,7 @@
|
||||||
%{ lua_pushnumber(L, (lua_Number) $1); SWIG_arg++;%}
|
%{ lua_pushnumber(L, (lua_Number) $1); SWIG_arg++;%}
|
||||||
|
|
||||||
/* enums have to be handled slightly differently
|
/* enums have to be handled slightly differently
|
||||||
VC++ .net will not allow a cast from double to enum directly
|
VC++ .NET will not allow a cast from double to enum directly.
|
||||||
therefore cast to an int first.
|
|
||||||
Thanks to Jason Rego <JasonR@rainbowstudios.com> for finding this.
|
|
||||||
*/
|
*/
|
||||||
%typemap(in,checkfn="lua_isnumber") enum SWIGTYPE
|
%typemap(in,checkfn="lua_isnumber") enum SWIGTYPE
|
||||||
%{$1 = ($type)(int)lua_tonumber(L, $input);%}
|
%{$1 = ($type)(int)lua_tonumber(L, $input);%}
|
||||||
|
|
@ -321,11 +319,15 @@ SWIG_NUMBER_BY_CONST_REF(unsigned char);
|
||||||
SWIG_NUMBER_BY_CONST_REF(signed char);
|
SWIG_NUMBER_BY_CONST_REF(signed char);
|
||||||
SWIG_NUMBER_BY_CONST_REF(float);
|
SWIG_NUMBER_BY_CONST_REF(float);
|
||||||
SWIG_NUMBER_BY_CONST_REF(double);
|
SWIG_NUMBER_BY_CONST_REF(double);
|
||||||
SWIG_NUMBER_BY_CONST_REF(enum SWIGTYPE);
|
|
||||||
SWIG_NUMBER_BY_CONST_REF(long long);
|
SWIG_NUMBER_BY_CONST_REF(long long);
|
||||||
SWIG_NUMBER_BY_CONST_REF(signed long long);
|
SWIG_NUMBER_BY_CONST_REF(signed long long);
|
||||||
SWIG_NUMBER_BY_CONST_REF(unsigned long long);
|
SWIG_NUMBER_BY_CONST_REF(unsigned long long);
|
||||||
|
|
||||||
|
%typemap(in,checkfn="lua_isnumber") const enum SWIGTYPE &($basetype temp)
|
||||||
|
%{ temp=($basetype)(int)lua_tonumber(L,$input); $1=&temp;%}
|
||||||
|
%typemap(out) const enum SWIGTYPE &
|
||||||
|
%{ lua_pushnumber(L, (lua_Number) *$1); SWIG_arg++;%}
|
||||||
|
|
||||||
%apply const unsigned long & { const size_t & }; // size_t is the same as unsigned long
|
%apply const unsigned long & { const size_t & }; // size_t is the same as unsigned long
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue