Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/luax.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ namespace luax {
inline bool isinteger(lua_State* L, int idx, int64_t* out = NULL)
{
#if LUA_VERSION_NUM >= 503
if (lua_isinteger(L, idx)) // but it maybe not detect all integers.
if (lua_isinteger(L, idx))
{
if (out)
*out = lua_tointeger(L, idx);
return true;
}
#endif
#else
double intpart;
if (std::modf(lua_tonumber(L, idx), &intpart) == 0.0)
{
Expand All @@ -53,6 +53,7 @@ namespace luax {
return true;
}
}
#endif
return false;
}

Expand Down