diff options
Diffstat (limited to 'src/tools.h')
-rw-r--r-- | src/tools.h | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/src/tools.h b/src/tools.h index 708421c..8e8bb7d 100644 --- a/src/tools.h +++ b/src/tools.h | |||
@@ -16,31 +16,6 @@ | |||
16 | #define inline __inline | 16 | #define inline __inline |
17 | #endif | 17 | #endif |
18 | 18 | ||
19 | // code is now using Lua 5.2 API | ||
20 | // add Lua 5.2 API when building for Lua 5.1 | ||
21 | #if LUA_VERSION_NUM == 501 | ||
22 | #define lua_absindex( L, idx) (((idx) >= 0 || (idx) <= LUA_REGISTRYINDEX) ? (idx) : lua_gettop(L) + (idx) +1) | ||
23 | #define lua_pushglobaltable(L) lua_pushvalue( L, LUA_GLOBALSINDEX) | ||
24 | #define lua_setuservalue lua_setfenv | ||
25 | #define lua_getuservalue lua_getfenv | ||
26 | #define lua_rawlen lua_objlen | ||
27 | #define luaG_registerlibfuncs( L, _funcs) luaL_register( L, NULL, _funcs) | ||
28 | #define LUA_OK 0 | ||
29 | #define LUA_ERRGCMM 666 // doesn't exist in Lua 5.1, we don't care about the actual value | ||
30 | void luaL_requiref (lua_State* L, const char* modname, lua_CFunction openf, int glb); // implementation copied from Lua 5.2 sources | ||
31 | #endif // LUA_VERSION_NUM == 501 | ||
32 | |||
33 | // wrap Lua 5.2 calls under Lua 5.1 API when it is simpler that way | ||
34 | #if LUA_VERSION_NUM == 502 | ||
35 | #ifndef lua_equal // already defined when compatibility is active in luaconf.h | ||
36 | #define lua_equal( L, a, b) lua_compare( L, a, b, LUA_OPEQ) | ||
37 | #endif // lua_equal | ||
38 | #ifndef lua_lessthan // already defined when compatibility is active in luaconf.h | ||
39 | #define lua_lessthan( L, a, b) lua_compare( L, a, b, LUA_OPLT) | ||
40 | #endif // lua_lessthan | ||
41 | #define luaG_registerlibfuncs( L, _funcs) luaL_setfuncs( L, _funcs, 0) | ||
42 | #endif // LUA_VERSION_NUM == 502 | ||
43 | |||
44 | // For some reason, LuaJIT 64bits doesn't support lua_newstate() | 19 | // For some reason, LuaJIT 64bits doesn't support lua_newstate() |
45 | // If you build specifically for this situation, change value to 0 | 20 | // If you build specifically for this situation, change value to 0 |
46 | #define PROPAGATE_ALLOCF 1 | 21 | #define PROPAGATE_ALLOCF 1 |