lua: push integer constants as integer
This allows better compatibility with Lua 5.3. Otherwise function overloading assuming integer parameters might not work.
This commit is contained in:
parent
6988b00aba
commit
ece1009c5d
1 changed files with 1 additions and 1 deletions
|
|
@ -1831,7 +1831,7 @@ SWIG_Lua_InstallConstants(lua_State *L, swig_lua_const_info constants[]) {
|
||||||
switch(constants[i].type) {
|
switch(constants[i].type) {
|
||||||
case SWIG_LUA_INT:
|
case SWIG_LUA_INT:
|
||||||
lua_pushstring(L,constants[i].name);
|
lua_pushstring(L,constants[i].name);
|
||||||
lua_pushnumber(L,(lua_Number)constants[i].lvalue);
|
lua_pushinteger(L,(lua_Number)constants[i].lvalue);
|
||||||
lua_rawset(L,-3);
|
lua_rawset(L,-3);
|
||||||
break;
|
break;
|
||||||
case SWIG_LUA_FLOAT:
|
case SWIG_LUA_FLOAT:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue