-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
51 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#include "LuaJIT-Compact.h" | ||
|
||
#ifdef LUAJIT | ||
int lua_isinteger(lua_State *L, int idx) { | ||
if (lua_type(L, idx) == LUA_TNUMBER) | ||
{ | ||
lua_Number n = lua_tonumber(L, idx); | ||
return n == (lua_Integer)n; | ||
} | ||
return 0; | ||
} | ||
|
||
int luaL_len(lua_State *L, int idx) { | ||
return lua_objlen(L, idx); | ||
} | ||
|
||
int lua_geti(lua_State *L, int idx, lua_Integer n) { | ||
lua_rawgeti(L, idx, n); | ||
return lua_type(L, -1); | ||
} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#ifndef LUAJIT_COMPACT_H | ||
#define LUAJIT_COMPACT_H | ||
|
||
#ifdef LUAJIT | ||
extern "C" { | ||
#include "lua.h" | ||
#include "lualib.h" | ||
#include "lauxlib.h" | ||
} | ||
|
||
int lua_isinteger(lua_State *L, int idx); | ||
|
||
int luaL_len(lua_State *L, int idx); | ||
|
||
int lua_geti(lua_State *L, int idx, lua_Integer n); | ||
#endif LUAJIT | ||
#endif //LUAJIT_COMPACT_H |