aboutsummaryrefslogtreecommitdiffstats
path: root/openssl.c
diff options
context:
space:
mode:
authorLibravatarLibravatar William Ahern <william@Williams-MacBook-Air.local> 2012-10-10 16:46:28 -0700
committerLibravatarLibravatar William Ahern <william@Williams-MacBook-Air.local> 2012-10-10 16:46:28 -0700
commit7bdf2557bbf7267542604567a0db809657b54d97 (patch)
tree13ba523c6f40b70536bc4ca8c4cc661948f831a8 /openssl.c
parentac93581c90d8a1612ce01e3a308d572f98002924 (diff)
downloadluaossl-7bdf2557bbf7267542604567a0db809657b54d97.tar.gz
luaossl-7bdf2557bbf7267542604567a0db809657b54d97.tar.bz2
luaossl-7bdf2557bbf7267542604567a0db809657b54d97.zip
-n
fix compile for LuaJIT
Diffstat (limited to 'openssl.c')
-rw-r--r--openssl.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/openssl.c b/openssl.c
index c0196bd..4ab0688 100644
--- a/openssl.c
+++ b/openssl.c
@@ -52,6 +52,9 @@
#include <lualib.h>
#include <lauxlib.h>
+#if LUA_VERSION_NUM < 502
+#include "compat52.h"
+#endif
#define BIGNUM_CLASS "OpenSSL Bignum"
#define PUBKEY_CLASS "OpenSSL Pubkey"
@@ -1665,7 +1668,11 @@ static int xc_digest(lua_State *L) {
luaL_Buffer B;
unsigned i;
+#if LUA_VERSION_NUM < 502
+ luaL_buffinit(L, &B);
+#else
luaL_buffinitsize(L, &B, 2 * len);
+#endif
for (i = 0; i < len; i++) {
luaL_addchar(&B, x[0x0f & (md[i] >> 4)]);