summaryrefslogtreecommitdiff
path: root/luascrypt.c
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2015-07-08 21:18:20 +0100
committerDaniel Silverstone <dsilvers@digital-scurf.org>2015-07-08 21:18:20 +0100
commit72abd9a73b13e15e467ad96ec15d8217837b21e4 (patch)
tree7b58acfe0b713ab9053a323033ed2439f6d949bf /luascrypt.c
parent4e0ed16d7cce90d61118db52c06c507772177714 (diff)
downloadlua-scrypt-git-72abd9a73b13e15e467ad96ec15d8217837b21e4.tar.gz
Better support for Lua 5.2v1.0
Diffstat (limited to 'luascrypt.c')
-rw-r--r--luascrypt.c5
1 files changed, 5 insertions, 0 deletions
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;
}