mirror of
https://port.numenaute.org/aleajactaest/khanat-code-old.git
synced 2024-12-12 12:14:48 +00:00
Fixed: In Lua, all integers are numbers and numbers can be converted to integers
This commit is contained in:
parent
ecfaa12fe8
commit
206026ac9d
1 changed files with 6 additions and 10 deletions
|
@ -231,10 +231,6 @@ namespace NLGUI
|
|||
|
||||
}
|
||||
|
||||
#if LUA_VERSION_NUM < 503
|
||||
#define lua_isinteger(a, b) lua_isnumber(a, b)
|
||||
#endif
|
||||
|
||||
// ***************************************************************************
|
||||
#define LUA_REGISTER_BASIC(_type_) \
|
||||
luabind::detail::yes_t is_user_defined(luabind::detail::by_value<_type_>); \
|
||||
|
@ -244,11 +240,11 @@ namespace NLGUI
|
|||
} \
|
||||
int match_lua_to_cpp(lua_State* L, luabind::detail::by_value<_type_>, int index) \
|
||||
{ \
|
||||
if (lua_isinteger(L, index)) return 0; else return -1; \
|
||||
return lua_isnumber(L, index) ? 0:-1; \
|
||||
} \
|
||||
void convert_cpp_to_lua(lua_State* L, const _type_& v) \
|
||||
{ \
|
||||
lua_pushinteger(L, (double)v); \
|
||||
lua_pushinteger(L, (lua_Integer)v); \
|
||||
}
|
||||
|
||||
// Basic LUA types
|
||||
|
|
Loading…
Reference in a new issue