From 0fcff4f28f4b1f2493ecb17b3fac46bff8c8140c Mon Sep 17 00:00:00 2001 From: ame Date: Tue, 23 Jan 2024 14:13:45 -0600 Subject: almost working great, fix 35th con --- src/lua.h | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) (limited to 'src/lua.h') diff --git a/src/lua.h b/src/lua.h index 6b146f6..625a0c1 100644 --- a/src/lua.h +++ b/src/lua.h @@ -1,8 +1,21 @@ -#include -#include -#include +#include +#include +#include -#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 -- cgit v1.2.3