diff options
| author | ame <[email protected]> | 2024-01-23 14:13:45 -0600 |
|---|---|---|
| committer | ame <[email protected]> | 2024-01-23 14:13:45 -0600 |
| commit | 0fcff4f28f4b1f2493ecb17b3fac46bff8c8140c (patch) | |
| tree | 0671f1abedab63573f3212d82d5c759b80c15422 /src/lua.h | |
| parent | 85c4718212e44b0e01485260b5f1574d5c7411a9 (diff) | |
almost working great, fix 35th con
Diffstat (limited to 'src/lua.h')
| -rw-r--r-- | src/lua.h | 23 |
1 files changed, 18 insertions, 5 deletions
@@ -1,8 +1,21 @@ -#include <lua5.4/lua.h> -#include <lua5.4/lualib.h> -#include <lua5.4/lauxlib.h> +#include <lua.h> +#include <lualib.h> +#include <lauxlib.h> -#define lua_objlen(L,i) lua_rawlen(L,(i)) -#define luaL_register(L, M, F) luaL_newlib(L, F); + +#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 |
