aboutsummaryrefslogtreecommitdiff
path: root/src/lua.h
blob: 625a0c16fa19b7f0c4ba685f7dba7c676a932474 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <lua.h>
#include <lualib.h>
#include <lauxlib.h>


#if LUA_VERSION_NUM == 504
    #define lreg(N, FN)\
        lua_pushstring(L, N);\
        luaL_register(L, NULL, FN);\
        lua_settable(L, -3);

    #define lua_objlen(L,i) lua_rawlen(L,(i))
    #define luaL_register(L, M, F) luaL_newlib(L, F);
#else
    #define lreg(N, FN)\
        lua_newtable(L);\
        luaL_register(L, NULL, FN);\
        lua_setfield(L, 2, N);
#endif