From 72abd9a73b13e15e467ad96ec15d8217837b21e4 Mon Sep 17 00:00:00 2001 From: Daniel Silverstone Date: Wed, 8 Jul 2015 21:18:20 +0100 Subject: Better support for Lua 5.2 --- luascrypt.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'luascrypt.c') diff --git a/luascrypt.c b/luascrypt.c index e824cea..f9dce0a 100644 --- a/luascrypt.c +++ b/luascrypt.c @@ -146,6 +146,11 @@ luascrypt_functions[] = { int luaopen_scrypt(lua_State *L) { +#if LUA_VERSION_NUM > 501 + lua_newtable(L); + luaL_setfuncs(L, luascrypt_functions, 0); +#else luaL_register(L, "scrypt", luascrypt_functions); +#endif return 1; } -- cgit v1.2.1